This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
component:gpu [2020/05/18 08:42] payonel |
component:gpu [2020/05/18 11:44] payonel |
||
---|---|---|---|
Line 113: | Line 113: | ||
Updates to vram (set, copy, fill, etc) are nearly free. They have no energy cost and no additional budget cost. Every direct component invoke (and these gpu methods are direct) has a tiny system minimum budget cost, but the gpu itself in these vram updates adds no additional cost. When bitblt'ing the vram to the screen there is some cost, similar to how updates to the screen normally incur a cost. A dirty (modified) vram back buffer has a one time budget cost that increases with the size of the source buffer. Subsequent bitblts from a clean back buffer to the screen have extremely low costs. | Updates to vram (set, copy, fill, etc) are nearly free. They have no energy cost and no additional budget cost. Every direct component invoke (and these gpu methods are direct) has a tiny system minimum budget cost, but the gpu itself in these vram updates adds no additional cost. When bitblt'ing the vram to the screen there is some cost, similar to how updates to the screen normally incur a cost. A dirty (modified) vram back buffer has a one time budget cost that increases with the size of the source buffer. Subsequent bitblts from a clean back buffer to the screen have extremely low costs. | ||
- | - `getBuffer(): number` | + | - `getActiveBuffer(): number` |
Returns the index of the currently selected buffer. 0 is reserved for the screen, and may return 0 even when there is no screen | Returns the index of the currently selected buffer. 0 is reserved for the screen, and may return 0 even when there is no screen | ||
- | - `setBuffer(index: number): number` | + | - `setActiveBuffer(index: number): number` |
Sets the active buffer to `index`. 0 is reserved for the screen and can be set even when there is no screen. Returns nil for an invalid index (0 is valid even with no screen) | Sets the active buffer to `index`. 0 is reserved for the screen and can be set even when there is no screen. Returns nil for an invalid index (0 is valid even with no screen) | ||
- `buffers(): table` | - `buffers(): table` |