-
Notifications
You must be signed in to change notification settings - Fork 16
Home
Welcome to the Gophers-Programs wiki!
###GML A GUI library for OpenComputers
###gmlDialogs Library The gmlDialogs library adds a set of pre-defined, standard dialog boxes that can be used from any program, whether it uses gml or not. Currently only includes the filePicker dialog, which opens a gui for selecting a target to save or load a file.
###Support Libraries There are a few libraries used by and included in the gml package which can also be used independently of the gml gui library itself.
####Canvas Library The canvas library creates canvas object. Canvas objects are function-compatible with the gpu component library, having the same functions and being drawn to in the same ways. The difference is that they draw to internal memory, and the results are displayed to the screen only when you call their draw method. This means if you're doing a lot of heavy drawing, which involves rewiring elements and moving around the screen, you can potentially speed this up by doing all the messy drawing to memory and then presenting the results to the gpu in a single pass. It also lets you preserve what you've drawn in memory, where you can re-draw it later if the actual screen is overwritten with other things.
####gfxBuffer Library
The gfxBuffer library will be another kind of render target. Like canvas objects, they will have the full set of gpu library methods and be fully functioning render targets. Unlike canvases, they will not actually keep a full copy of everything drawn to them. Instead, they will simply act as a buffer, temporarily holding on to the results of each draw command, until buffer.flush()
is called. Calling flush will cause it to optimize it's list of changes and present them to their parent, after which they will empty their buffer and wait for more draw commands. Unlike canvases, you can't clear the screen and then restore what was drawn using a buffer; buffers forget everything once they're flushed. The benefit comes in when you're doing a series of writes that can be conflicting and involve overwriting in a way that would be difficult or impossible to optimize logically in the drawing code itself. Any redundancy and overwrites are removed, as well as any writes which would not change anything, and small separate writes will, where possible, be combined int a smaller number of calls.