ref: e90b90369272b66bd6e52c6c4049dc6b6e4cebad
parent: b6c9467151cbfeb6ac13c06c1d4c1acb31820a69
author: Clownacy <Clownacy@users.noreply.github.com>
date: Thu Sep 10 11:50:06 EDT 2020
Change some variables to size_t Really need to change the whole backend API to use size_t
--- a/src/Backends/Rendering/Software.cpp
+++ b/src/Backends/Rendering/Software.cpp
@@ -14,9 +14,9 @@
typedef struct RenderBackend_Surface
{
unsigned char *pixels;
- unsigned int width;
- unsigned int height;
- unsigned int pitch;
+ size_t width;
+ size_t height;
+ size_t pitch;
} RenderBackend_Surface;
typedef struct RenderBackend_GlyphAtlas
@@ -34,11 +34,9 @@
{
if (WindowBackend_Software_CreateWindow(window_title, screen_width, screen_height, fullscreen))
{
- size_t pitch;
- framebuffer.pixels = WindowBackend_Software_LockFramebuffer(&pitch);
+ framebuffer.pixels = WindowBackend_Software_LockFramebuffer(&framebuffer.pitch);
framebuffer.width = screen_width;
framebuffer.height = screen_height;
- framebuffer.pitch = pitch;
return &framebuffer;
}
@@ -61,9 +59,7 @@
WindowBackend_Software_Display();
- size_t pitch;
- framebuffer.pixels = WindowBackend_Software_LockFramebuffer(&pitch);
- framebuffer.pitch = pitch;
+ framebuffer.pixels = WindowBackend_Software_LockFramebuffer(&framebuffer.pitch);
}
RenderBackend_Surface* RenderBackend_CreateSurface(unsigned int width, unsigned int height, bool render_target)