Grx.Context.new
function new(w: Number(gint), h: Number(gint), memory: Grx.FrameMemory, where: Grx.Context): Grx.Context { // Gjs wrapper for grx_context_new() }
Creates a new context in system memory using the memory layout specified by Grx.frame_mode_get_screen_core.
memory must contain Grx.screen_get_n_planes pointers (usually just one, but could be as many as 4) of size Grx.screen_get_plane_size. null may also be passed to memory, in which case the memory will be dynamically allocated.
Likewise, where can be an unused Grx.Context (e.g. you may want to do this if you want a stack allocated context) or it can be null to dynamically allocate a new context.
- w
the width of the context
- h
the height of the context
- memory
memory location(s) or null
- where
an unused Grx.Context struct or null
- Returns
where or a new context if where was null. Returns null on error.