3ds_tests/docs/gfx.md
2024-10-04 18:00:49 +02:00

51 lines
No EOL
1.6 KiB
Markdown

# gfx.h
Screen buffers for graphice.
## `void gfxInitDefault(void);`
Initialize LCD framebuffers with default parameters:
gfxInit(GSP_BGR8_OES,GSP_BGR8_OES,false);
Internally calls `gspInit()`.
## `void gfxExit(void);`
Destroy everything gfx-related.
## `void gfxFlushBuffers(void);`
Draw the buffer.
## `void gfxSwapBuffers(void);`
??? idk call it after gfxFlushBuffer().
## `enum gfxScreen_t;`
Represents each screen.
- GFX_TOP: Top screen.
- GFX_BOTTOM: Bottom screen.
## `enum gfx3dSide_t;`
Represent each image for the 3D screen.
GFX_LEFT: Left eye.
GFX_RIGHT: Right eye.
## `void gfxSet3D(bool enable);`
Enable or disable 3D on the top screen.
## `bool gfxIs3D(void);`
Check whether the 3D is enabled on the top screen.
## `u8* gfxGetFramebuffer(gfxScreen_t screen, gfx3dSide_t side, u16* width, u16* height);`
Get all the data which will be display to be able to modify it.
If `gspInit()` was used, the return data is formatted as follow:
- Each byte is a color value.
- The colors are in order: blue, green, red. 3 bytes make a pixel.
- The pixels are from the bottom to the top of the screen. 'width' pixels make a pixel column.
- 'height' colums make the screen.
The size of the returned value is: 3 (colors) * width (rows) * height (colums).
Arguments:
- screen: screen to get the frame buffer from (either GFX_TOP or GFX_BOTTOM).
- side: for the 3D screen GFX_LEFT for the left eye image, GFX_RIGHT for the right. If bottom screen or if not 3D, use GFX_LEFT.
- width: height of the screen (yep)
- height: width of the screen (yep yep yep doesn't make any sense)
# TO SEE:
## `bool gspPresentBuffer(???);`
"Presents a buffer to the specified screen."