R/CRdraw_rects.R

#' Draws outline of multiple rectangles to renderer
#'
#' Draws outline of multiple rectangles to renderer
#' param graphics_list a list created with CRopen(), containing pointers to window, renderer, surface and event
#' param rect_list list defining one or more rectangles (must contain elements x, y, w, h, each a vector of length >= 1)

CRdraw_rects <- function(graphics_list, rect_list) {

  if ( !isGraphicsList(graphics_list) ) {
    stop("Input structure must be \"graphics list\".")
    
  }
  if (!isRectList(rect_list)) {
    stop("Input structure must be \"rect list\".")
    
  }
  
  graphics_list = orderGraphicsList(graphics_list)
  invisible( .Call("SDLdraw_rects", graphics_list, rect_list$x, rect_list$y, rect_list$w, rect_list$h, length(rect_list$x), PACKAGE = "SDLDLL") )
  
}
lorweiuk/CREx documentation built on May 30, 2019, 3:44 p.m.