Change some variables to size_t
Really need to change the whole backend API to use size_t
This commit is contained in:
parent
b6c9467151
commit
e90b903692
1 changed files with 5 additions and 9 deletions
|
@ -14,9 +14,9 @@
|
||||||
typedef struct RenderBackend_Surface
|
typedef struct RenderBackend_Surface
|
||||||
{
|
{
|
||||||
unsigned char *pixels;
|
unsigned char *pixels;
|
||||||
unsigned int width;
|
size_t width;
|
||||||
unsigned int height;
|
size_t height;
|
||||||
unsigned int pitch;
|
size_t pitch;
|
||||||
} RenderBackend_Surface;
|
} RenderBackend_Surface;
|
||||||
|
|
||||||
typedef struct RenderBackend_GlyphAtlas
|
typedef struct RenderBackend_GlyphAtlas
|
||||||
|
@ -34,11 +34,9 @@ RenderBackend_Surface* RenderBackend_Init(const char *window_title, int screen_w
|
||||||
{
|
{
|
||||||
if (WindowBackend_Software_CreateWindow(window_title, screen_width, screen_height, fullscreen))
|
if (WindowBackend_Software_CreateWindow(window_title, screen_width, screen_height, fullscreen))
|
||||||
{
|
{
|
||||||
size_t pitch;
|
framebuffer.pixels = WindowBackend_Software_LockFramebuffer(&framebuffer.pitch);
|
||||||
framebuffer.pixels = WindowBackend_Software_LockFramebuffer(&pitch);
|
|
||||||
framebuffer.width = screen_width;
|
framebuffer.width = screen_width;
|
||||||
framebuffer.height = screen_height;
|
framebuffer.height = screen_height;
|
||||||
framebuffer.pitch = pitch;
|
|
||||||
|
|
||||||
return &framebuffer;
|
return &framebuffer;
|
||||||
}
|
}
|
||||||
|
@ -61,9 +59,7 @@ void RenderBackend_DrawScreen(void)
|
||||||
|
|
||||||
WindowBackend_Software_Display();
|
WindowBackend_Software_Display();
|
||||||
|
|
||||||
size_t pitch;
|
framebuffer.pixels = WindowBackend_Software_LockFramebuffer(&framebuffer.pitch);
|
||||||
framebuffer.pixels = WindowBackend_Software_LockFramebuffer(&pitch);
|
|
||||||
framebuffer.pitch = pitch;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RenderBackend_Surface* RenderBackend_CreateSurface(unsigned int width, unsigned int height, bool render_target)
|
RenderBackend_Surface* RenderBackend_CreateSurface(unsigned int width, unsigned int height, bool render_target)
|
||||||
|
|
Loading…
Add table
Reference in a new issue