12 #define RGBA8(r,g,b,a) (((r)&0xff)|(((g)&0xff)<<8)|(((b)&0xff)<<16)|(((a)&0xff)<<24)) 15 #define RGBA8_MAXALPHA(r,g,b) RGBA8(r,g,b,0xff) 103 extern size_t g_gfx_framebuf_aligned_width;
104 extern size_t g_gfx_framebuf_display_height;
105 extern bool g_gfx_drawflip;
109 if (g_gfx_drawflip) y = g_gfx_framebuf_display_height-1-y;
111 tmp_pos = ((y & 127) / 16) + (x/16*8) + ((y/16/8)*(g_gfx_framebuf_aligned_width/16*8));
112 tmp_pos *= 16*16 * 4;
114 tmp_pos += ((y%16)/8)*512 + ((x%16)/8)*256 + ((y%8)/2)*64 + ((x%8)/4)*32 + (y%2)*16 + (x%4)*4;
void gfxConfigureAutoResolution(bool enable, s32 handheld_width, s32 handheld_height, s32 docked_width, s32 docked_height)
If enabled, gfxConfigureResolution will be used with the input resolution for the current OperationMo...
void gfxConfigureTransform(u32 transform)
Configures transform. See the NATIVE_WINDOW_TRANSFORM_* enums in buffer_producer.h. The default is NATIVE_WINDOW_TRANSFORM_FLIP_V.
GfxMode
GfxMode set by gfxSetMode. The default is GfxMode_LinearDouble. Note that the text-console (see conso...
Definition: gfx.h:18
size_t gfxGetFramebufferSize(void)
Use this to get the actual byte-size of the framebuffer for use with memset/etc.
void gfxSwapBuffers(void)
Swaps the framebuffers (for double-buffering).
void gfxSetMode(GfxMode mode)
Sets the GfxMode.
uint8_t u8
8-bit unsigned integer.
Definition: types.h:21
void gfxInitDefault(void)
Framebuffer pixel-format is RGBA8888, there's no known way to change this.
uint32_t u32
32-bit unsigned integer.
Definition: types.h:23
void gfxConfigureAutoResolutionDefault(bool enable)
Wrapper for gfxConfigureAutoResolution. handheld_resolution=720p, docked_resolution={all-zero for usi...
void gfxConfigureResolution(s32 width, s32 height)
Wrapper for gfxConfigureCrop. Use this to set the resolution, within the bounds of the maximum resolu...
void gfxInitResolutionDefault(void)
Wrapper for gfxInitResolution with resolution=1080p. Use this if you want to support 1080p or >720p i...
int32_t s32
32-bit signed integer.
Definition: types.h:29
Single-buffering with raw tiled (block-linear) framebuffer.
Definition: gfx.h:20
static u32 gfxGetFramebufferDisplayOffset(u32 x, u32 y)
Use this to get the pixel-offset in the framebuffer.
Definition: gfx.h:100
void gfxSetDrawFlip(bool flip)
Controls whether a vertical-flip is done when determining the pixel-offset within the actual framebuf...
void gfxExit(void)
Uninitializes the graphics subsystem.
void gfxInitResolution(u32 width, u32 height)
Sets the resolution to be used when initializing the graphics subsystem.
void gfxGetFramebufferResolution(u32 *width, u32 *height)
Get the framebuffer width/height without crop.
void gfxConfigureCrop(s32 left, s32 top, s32 right, s32 bottom)
Configure framebuffer crop, by default crop is all-zero.
Double-buffering with linear framebuffer, which is transferred to the actual framebuffer by gfxFlushB...
Definition: gfx.h:22
Double-buffering with raw tiled (block-linear) framebuffer.
Definition: gfx.h:21
u8 * gfxGetFramebuffer(u32 *width, u32 *height)
Get the current framebuffer address, with optional output ptrs for the display framebuffer width/heig...
void gfxFlushBuffers(void)
Flushes the framebuffer in the data cache. When GfxMode is GfxMode_LinearDouble, this also transfers ...
void gfxWaitForVsync(void)
Waits for vertical sync.