gfx: Add function to query framebuffer pitch.

This commit is contained in:
Jules Blok 2018-06-19 23:04:04 +02:00 committed by fincs
parent 06e50f74ab
commit 4f331eb9f7
2 changed files with 7 additions and 0 deletions

View File

@ -85,6 +85,9 @@ void gfxGetFramebufferResolution(u32* width, u32* height);
/// Use this to get the actual byte-size of the framebuffer for use with memset/etc.
size_t gfxGetFramebufferSize(void);
/// Use this to get the actual byte-pitch of the framebuffer for use with memset/etc.
u32 gfxGetFramebufferPitch(void);
/// Sets the \ref GfxMode.
void gfxSetMode(GfxMode mode);

View File

@ -530,6 +530,10 @@ size_t gfxGetFramebufferSize(void) {
return g_gfx_singleframebuf_size;
}
u32 gfxGetFramebufferPitch(void) {
return g_gfx_framebuf_aligned_width*4;
}
void gfxSetMode(GfxMode mode) {
g_gfxMode = mode;
}