-
-
Notifications
You must be signed in to change notification settings - Fork 4
GPUImpl
This is the default GPU context available through the GPU Peripheral, Image.gpuDraw or createWindow function.
Color values can be entered in multiple ways:
- single ARGB number:
0xAARRGGBB - three channels as three separate arguments: R, G, B
- four channels as four separate arguments: R, G, B, A
The GPU Peripheral has an internal buffer for processing called VRAM.
Every operation that works with large amount of data uses this buffer.
The maximum size of this buffer is configurable in the mod's config file with the maxVRAMSize setting.
It has nothing to do with the actual VRAM of the computer
Windows are a separate GPU context that can be moved, hidden or resized.
Each window has it's own internal buffer, so it uses VRAM based on it's size.
The buffer can be drawn using the sync function.
Multiple windows can be layered on top of each other by changing the order of the sync calls.
Create a window with a normal GPU context
Create a window with a 3D GPU context
See GPU3D
Draw the window buffer into the parent context or update the monitors on the GPU Peripheral.
The function accepts unpacked numbers or buffer references. Returns the decoded image or throws an error if the image is corrupted or too big
Returns the currently used VRAM by the GPU
Creates a new image with the defined size
Creates a new byte buffer with the given initial size or 32 bytes as the default.
Creates an image with an unpacked ARGB pixels buffer
Returns the maximum available VRAM
Returns the Window bounds object if the context was created using createWindow
Returns the context size in pixels
Draw filled rectangle
Draw a rectangle outline
Draw a smooth line between two points
Fills the whole window to a single color, color value defaults to black.
Draw a line between two points