shithub: cstory

Download patch

ref: 4d322be866669d45e89870a5c0813ea6f5378e3c
parent: 8acdcface4d841539c04d022dc5b77e28819c7ae
author: Clownacy <Clownacy@users.noreply.github.com>
date: Sat Apr 4 16:24:34 EDT 2020

Change render backend namespace to RenderBackend_

--- a/src/Backends/GLFW3/Platform.cpp
+++ b/src/Backends/GLFW3/Platform.cpp
@@ -141,7 +141,7 @@
 {
 	(void)window;
 
-	Backend_HandleWindowResize(width, height);
+	RenderBackend_HandleWindowResize(width, height);
 }
 
 static void DragAndDropCallback(GLFWwindow *window, int count, const char **paths)
--- a/src/Backends/Rendering.h
+++ b/src/Backends/Rendering.h
@@ -2,25 +2,25 @@
 
 #include "../WindowsWrapper.h"
 
-typedef struct Backend_Surface Backend_Surface;
-typedef struct Backend_Glyph Backend_Glyph;
+typedef struct RenderBackend_Surface RenderBackend_Surface;
+typedef struct RenderBackend_Glyph RenderBackend_Glyph;
 
-Backend_Surface* Backend_Init(const char *window_title, int screen_width, int screen_height, BOOL fullscreen);
-void Backend_Deinit(void);
-void Backend_DrawScreen(void);
-void Backend_ClearScreen(void);
-Backend_Surface* Backend_CreateSurface(unsigned int width, unsigned int height);
-void Backend_FreeSurface(Backend_Surface *surface);
-BOOL Backend_IsSurfaceLost(Backend_Surface *surface);
-void Backend_RestoreSurface(Backend_Surface *surface);
-unsigned char* Backend_LockSurface(Backend_Surface *surface, unsigned int *pitch, unsigned int width, unsigned int height);
-void Backend_UnlockSurface(Backend_Surface *surface, unsigned int width, unsigned int height);
-void Backend_Blit(Backend_Surface *source_surface, const RECT *rect, Backend_Surface *destination_surface, long x, long y, BOOL colour_key);
-void Backend_ColourFill(Backend_Surface *surface, const RECT *rect, unsigned char red, unsigned char green, unsigned char blue);
-Backend_Glyph* Backend_LoadGlyph(const unsigned char *pixels, unsigned int width, unsigned int height, int pitch);
-void Backend_UnloadGlyph(Backend_Glyph *glyph);
-void Backend_PrepareToDrawGlyphs(Backend_Surface *destination_surface, const unsigned char *colour_channels);
-void Backend_DrawGlyph(Backend_Glyph *glyph, long x, long y);
-void Backend_FlushGlyphs(void);
-void Backend_HandleRenderTargetLoss(void);
-void Backend_HandleWindowResize(unsigned int width, unsigned int height);
+RenderBackend_Surface* RenderBackend_Init(const char *window_title, int screen_width, int screen_height, BOOL fullscreen);
+void RenderBackend_Deinit(void);
+void RenderBackend_DrawScreen(void);
+void RenderBackend_ClearScreen(void);
+RenderBackend_Surface* RenderBackend_CreateSurface(unsigned int width, unsigned int height);
+void RenderBackend_FreeSurface(RenderBackend_Surface *surface);
+BOOL RenderBackend_IsSurfaceLost(RenderBackend_Surface *surface);
+void RenderBackend_RestoreSurface(RenderBackend_Surface *surface);
+unsigned char* RenderBackend_LockSurface(RenderBackend_Surface *surface, unsigned int *pitch, unsigned int width, unsigned int height);
+void RenderBackend_UnlockSurface(RenderBackend_Surface *surface, unsigned int width, unsigned int height);
+void RenderBackend_Blit(RenderBackend_Surface *source_surface, const RECT *rect, RenderBackend_Surface *destination_surface, long x, long y, BOOL colour_key);
+void RenderBackend_ColourFill(RenderBackend_Surface *surface, const RECT *rect, unsigned char red, unsigned char green, unsigned char blue);
+RenderBackend_Glyph* RenderBackend_LoadGlyph(const unsigned char *pixels, unsigned int width, unsigned int height, int pitch);
+void RenderBackend_UnloadGlyph(RenderBackend_Glyph *glyph);
+void RenderBackend_PrepareToDrawGlyphs(RenderBackend_Surface *destination_surface, const unsigned char *colour_channels);
+void RenderBackend_DrawGlyph(RenderBackend_Glyph *glyph, long x, long y);
+void RenderBackend_FlushGlyphs(void);
+void RenderBackend_HandleRenderTargetLoss(void);
+void RenderBackend_HandleWindowResize(unsigned int width, unsigned int height);
--- a/src/Backends/Rendering/OpenGL3.cpp
+++ b/src/Backends/Rendering/OpenGL3.cpp
@@ -36,21 +36,21 @@
 	MODE_DRAW_GLYPH
 } RenderMode;
 
-typedef struct Backend_Surface
+typedef struct RenderBackend_Surface
 {
 	GLuint texture_id;
 	unsigned int width;
 	unsigned int height;
 	unsigned char *pixels;
-} Backend_Surface;
+} RenderBackend_Surface;
 
-typedef struct Backend_Glyph
+typedef struct RenderBackend_Glyph
 {
 	unsigned char *pixels;
 	unsigned int width;
 	unsigned int height;
 	unsigned int pitch;
-} Backend_Glyph;
+} RenderBackend_Glyph;
 
 typedef struct Coordinate2D
 {
@@ -91,10 +91,10 @@
 static GLuint last_source_texture;
 static GLuint last_destination_texture;
 
-static Backend_Surface framebuffer;
+static RenderBackend_Surface framebuffer;
 
 static unsigned char glyph_colour_channels[3];
-static Backend_Surface *glyph_destination_surface;
+static RenderBackend_Surface *glyph_destination_surface;
 
 static spritebatch_t glyph_batcher;
 
@@ -420,7 +420,7 @@
 
 	for (int i = 0; i < count; ++i)
 	{
-		Backend_Glyph *glyph = (Backend_Glyph*)sprites[i].image_id;
+		RenderBackend_Glyph *glyph = (RenderBackend_Glyph*)sprites[i].image_id;
 
 		const GLfloat texture_left = sprites[i].minx;
 		const GLfloat texture_right = texture_left + ((GLfloat)glyph->width / (GLfloat)texture_w);	// Account for width not matching pitch
@@ -467,7 +467,7 @@
 {
 	(void)udata;
 
-	Backend_Glyph *glyph = (Backend_Glyph*)image_id;
+	RenderBackend_Glyph *glyph = (RenderBackend_Glyph*)image_id;
 
 	memcpy(buffer, glyph->pixels, bytes_to_fill);
 }
@@ -517,7 +517,7 @@
 // Render-backend initialisation
 // ====================
 
-Backend_Surface* Backend_Init(const char *window_title, int screen_width, int screen_height, BOOL fullscreen)
+RenderBackend_Surface* RenderBackend_Init(const char *window_title, int screen_width, int screen_height, BOOL fullscreen)
 {
 	actual_screen_width = screen_width;
 	actual_screen_height = screen_height;
@@ -624,7 +624,7 @@
 	return NULL;
 }
 
-void Backend_Deinit(void)
+void RenderBackend_Deinit(void)
 {
 	free(local_vertex_buffer);
 
@@ -644,7 +644,7 @@
 	WindowBackend_OpenGL_DestroyWindow();
 }
 
-void Backend_DrawScreen(void)
+void RenderBackend_DrawScreen(void)
 {
 	spritebatch_tick(&glyph_batcher);
 
@@ -737,9 +737,9 @@
 // Surface management
 // ====================
 
-Backend_Surface* Backend_CreateSurface(unsigned int width, unsigned int height)
+RenderBackend_Surface* RenderBackend_CreateSurface(unsigned int width, unsigned int height)
 {
-	Backend_Surface *surface = (Backend_Surface*)malloc(sizeof(Backend_Surface));
+	RenderBackend_Surface *surface = (RenderBackend_Surface*)malloc(sizeof(RenderBackend_Surface));
 
 	if (surface == NULL)
 		return NULL;
@@ -767,7 +767,7 @@
 	return surface;
 }
 
-void Backend_FreeSurface(Backend_Surface *surface)
+void RenderBackend_FreeSurface(RenderBackend_Surface *surface)
 {
 	if (surface == NULL)
 		return;
@@ -780,7 +780,7 @@
 	free(surface);
 }
 
-BOOL Backend_IsSurfaceLost(Backend_Surface *surface)
+BOOL RenderBackend_IsSurfaceLost(RenderBackend_Surface *surface)
 {
 	(void)surface;
 
@@ -787,12 +787,12 @@
 	return FALSE;
 }
 
-void Backend_RestoreSurface(Backend_Surface *surface)
+void RenderBackend_RestoreSurface(RenderBackend_Surface *surface)
 {
 	(void)surface;
 }
 
-unsigned char* Backend_LockSurface(Backend_Surface *surface, unsigned int *pitch, unsigned int width, unsigned int height)
+unsigned char* RenderBackend_LockSurface(RenderBackend_Surface *surface, unsigned int *pitch, unsigned int width, unsigned int height)
 {
 	if (surface == NULL)
 		return NULL;
@@ -802,7 +802,7 @@
 	return surface->pixels;
 }
 
-void Backend_UnlockSurface(Backend_Surface *surface, unsigned int width, unsigned int height)
+void RenderBackend_UnlockSurface(RenderBackend_Surface *surface, unsigned int width, unsigned int height)
 {
 	if (surface == NULL)
 		return;
@@ -822,7 +822,7 @@
 // Drawing
 // ====================
 
-void Backend_Blit(Backend_Surface *source_surface, const RECT *rect, Backend_Surface *destination_surface, long x, long y, BOOL colour_key)
+void RenderBackend_Blit(RenderBackend_Surface *source_surface, const RECT *rect, RenderBackend_Surface *destination_surface, long x, long y, BOOL colour_key)
 {
 	if (source_surface == NULL || destination_surface == NULL)
 		return;
@@ -898,7 +898,7 @@
 	vertex_buffer_slot->vertices[1][2].vertex_coordinate.y = vertex_bottom;
 }
 
-void Backend_ColourFill(Backend_Surface *surface, const RECT *rect, unsigned char red, unsigned char green, unsigned char blue)
+void RenderBackend_ColourFill(RenderBackend_Surface *surface, const RECT *rect, unsigned char red, unsigned char green, unsigned char blue)
 {
 	static unsigned char last_red;
 	static unsigned char last_green;
@@ -963,9 +963,9 @@
 // Glyph management
 // ====================
 
-Backend_Glyph* Backend_LoadGlyph(const unsigned char *pixels, unsigned int width, unsigned int height, int pitch)
+RenderBackend_Glyph* RenderBackend_LoadGlyph(const unsigned char *pixels, unsigned int width, unsigned int height, int pitch)
 {
-	Backend_Glyph *glyph = (Backend_Glyph*)malloc(sizeof(Backend_Glyph));
+	RenderBackend_Glyph *glyph = (RenderBackend_Glyph*)malloc(sizeof(RenderBackend_Glyph));
 
 	if (glyph != NULL)
 	{
@@ -994,7 +994,7 @@
 	return NULL;
 }
 
-void Backend_UnloadGlyph(Backend_Glyph *glyph)
+void RenderBackend_UnloadGlyph(RenderBackend_Glyph *glyph)
 {
 	if (glyph == NULL)
 		return;
@@ -1003,7 +1003,7 @@
 	free(glyph);
 }
 
-void Backend_PrepareToDrawGlyphs(Backend_Surface *destination_surface, const unsigned char *colour_channels)
+void RenderBackend_PrepareToDrawGlyphs(RenderBackend_Surface *destination_surface, const unsigned char *colour_channels)
 {
 	glyph_destination_surface = destination_surface;
 
@@ -1010,12 +1010,12 @@
 	memcpy(glyph_colour_channels, colour_channels, sizeof(glyph_colour_channels));
 }
 
-void Backend_DrawGlyph(Backend_Glyph *glyph, long x, long y)
+void RenderBackend_DrawGlyph(RenderBackend_Glyph *glyph, long x, long y)
 {
 	spritebatch_push(&glyph_batcher, (SPRITEBATCH_U64)glyph, glyph->pitch, glyph->height, x, y, 1.0f, 1.0f, 0.0f, 0.0f, 0);
 }
 
-void Backend_FlushGlyphs(void)
+void RenderBackend_FlushGlyphs(void)
 {
 	spritebatch_defrag(&glyph_batcher);
 	spritebatch_flush(&glyph_batcher);
@@ -1025,12 +1025,12 @@
 // Misc.
 // ====================
 
-void Backend_HandleRenderTargetLoss(void)
+void RenderBackend_HandleRenderTargetLoss(void)
 {
 	// No problem for us
 }
 
-void Backend_HandleWindowResize(unsigned int width, unsigned int height)
+void RenderBackend_HandleWindowResize(unsigned int width, unsigned int height)
 {
 	actual_screen_width = width;
 	actual_screen_height = height;
--- a/src/Backends/Rendering/SDLSurface.cpp
+++ b/src/Backends/Rendering/SDLSurface.cpp
@@ -11,19 +11,19 @@
 #include "../Platform.h"
 #include "../SDL2/Platform.h"
 
-typedef struct Backend_Surface
+typedef struct RenderBackend_Surface
 {
 	SDL_Surface *sdlsurface;
-} Backend_Surface;
+} RenderBackend_Surface;
 
-typedef struct Backend_Glyph
+typedef struct RenderBackend_Glyph
 {
 	SDL_Surface *sdlsurface;
-} Backend_Glyph;
+} RenderBackend_Glyph;
 
 static SDL_Surface *window_sdlsurface;
 
-static Backend_Surface framebuffer;
+static RenderBackend_Surface framebuffer;
 
 static unsigned char glyph_colour_channels[3];
 static SDL_Surface *glyph_destination_sdlsurface;
@@ -42,7 +42,7 @@
 		sdl_rect->h = 0;
 }
 
-Backend_Surface* Backend_Init(const char *window_title, int screen_width, int screen_height, BOOL fullscreen)
+Backend_Surface* RenderBackend_Init(const char *window_title, int screen_width, int screen_height, BOOL fullscreen)
 {
 	window = SDL_CreateWindow(window_title, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, screen_width, screen_height, 0);
 
@@ -76,21 +76,21 @@
 	return NULL;
 }
 
-void Backend_Deinit(void)
+void RenderBackend_Deinit(void)
 {
 	SDL_FreeSurface(framebuffer.sdlsurface);
 	SDL_DestroyWindow(window);
 }
 
-void Backend_DrawScreen(void)
+void RenderBackend_DrawScreen(void)
 {
 	SDL_BlitSurface(framebuffer.sdlsurface, NULL, window_sdlsurface, NULL);
 	SDL_UpdateWindowSurface(window);
 }
 
-Backend_Surface* Backend_CreateSurface(unsigned int width, unsigned int height)
+Backend_Surface* RenderBackend_CreateSurface(unsigned int width, unsigned int height)
 {
-	Backend_Surface *surface = (Backend_Surface*)malloc(sizeof(Backend_Surface));
+	RenderBackend_Surface *surface = (RenderBackend_Surface*)malloc(sizeof(RenderBackend_Surface));
 
 	if (surface == NULL)
 		return NULL;
@@ -106,7 +106,7 @@
 	return surface;
 }
 
-void Backend_FreeSurface(Backend_Surface *surface)
+void RenderBackend_FreeSurface(RenderBackend_Surface *surface)
 {
 	if (surface == NULL)
 		return;
@@ -115,7 +115,7 @@
 	free(surface);
 }
 
-BOOL Backend_IsSurfaceLost(Backend_Surface *surface)
+BOOL RenderBackend_IsSurfaceLost(RenderBackend_Surface *surface)
 {
 	(void)surface;
 
@@ -122,12 +122,12 @@
 	return FALSE;
 }
 
-void Backend_RestoreSurface(Backend_Surface *surface)
+void RenderBackend_RestoreSurface(RenderBackend_Surface *surface)
 {
 	(void)surface;
 }
 
-unsigned char* Backend_LockSurface(Backend_Surface *surface, unsigned int *pitch, unsigned int width, unsigned int height)
+unsigned char* RenderBackend_LockSurface(RenderBackend_Surface *surface, unsigned int *pitch, unsigned int width, unsigned int height)
 {
 	(void)width;
 	(void)height;
@@ -139,7 +139,7 @@
 	return (unsigned char*)surface->sdlsurface->pixels;
 }
 
-void Backend_UnlockSurface(Backend_Surface *surface, unsigned int width, unsigned int height)
+void RenderBackend_UnlockSurface(RenderBackend_Surface *surface, unsigned int width, unsigned int height)
 {
 	(void)surface;
 	(void)width;
@@ -146,7 +146,7 @@
 	(void)height;
 }
 
-void Backend_Blit(Backend_Surface *source_surface, const RECT *rect, Backend_Surface *destination_surface, long x, long y, BOOL colour_key)
+void RenderBackend_Blit(RenderBackend_Surface *source_surface, const RECT *rect, RenderBackend_Surface *destination_surface, long x, long y, BOOL colour_key)
 {
 	if (source_surface == NULL || destination_surface == NULL)
 		return;
@@ -165,7 +165,7 @@
 	SDL_BlitSurface(source_surface->sdlsurface, &source_rect, destination_surface->sdlsurface, &destination_rect);
 }
 
-void Backend_ColourFill(Backend_Surface *surface, const RECT *rect, unsigned char red, unsigned char green, unsigned char blue)
+void RenderBackend_ColourFill(RenderBackend_Surface *surface, const RECT *rect, unsigned char red, unsigned char green, unsigned char blue)
 {
 	if (surface == NULL)
 		return;
@@ -176,9 +176,9 @@
 	SDL_FillRect(surface->sdlsurface, &destination_rect, SDL_MapRGB(surface->sdlsurface->format, red, green, blue));
 }
 
-Backend_Glyph* Backend_LoadGlyph(const unsigned char *pixels, unsigned int width, unsigned int height, int pitch)
+Backend_Glyph* RenderBackend_LoadGlyph(const unsigned char *pixels, unsigned int width, unsigned int height, int pitch)
 {
-	Backend_Glyph *glyph = (Backend_Glyph*)malloc(sizeof(Backend_Glyph));
+	RenderBackend_Glyph *glyph = (RenderBackend_Glyph*)malloc(sizeof(RenderBackend_Glyph));
 
 	if (glyph == NULL)
 		return NULL;
@@ -208,7 +208,7 @@
 	return glyph;
 }
 
-void Backend_UnloadGlyph(Backend_Glyph *glyph)
+void RenderBackend_UnloadGlyph(RenderBackend_Glyph *glyph)
 {
 	if (glyph == NULL)
 		return;
@@ -217,7 +217,7 @@
 	free(glyph);
 }
 
-void Backend_PrepareToDrawGlyphs(Backend_Surface *destination_surface, const unsigned char *colour_channels)
+void RenderBackend_PrepareToDrawGlyphs(RenderBackend_Surface *destination_surface, const unsigned char *colour_channels)
 {
 	if (destination_surface == NULL)
 		return;
@@ -227,7 +227,7 @@
 	memcpy(glyph_colour_channels, colour_channels, sizeof(glyph_colour_channels));
 }
 
-void Backend_DrawGlyph(Backend_Glyph *glyph, long x, long y)
+void RenderBackend_DrawGlyph(RenderBackend_Glyph *glyph, long x, long y)
 {
 	if (glyph == NULL)
 		return;
@@ -243,17 +243,17 @@
 	SDL_BlitSurface(glyph->sdlsurface, NULL, glyph_destination_sdlsurface, &rect);
 }
 
-void Backend_FlushGlyphs(void)
+void RenderBackend_FlushGlyphs(void)
 {
 	
 }
 
-void Backend_HandleRenderTargetLoss(void)
+void RenderBackend_HandleRenderTargetLoss(void)
 {
 	// No problem for us
 }
 
-void Backend_HandleWindowResize(unsigned int width, unsigned int height)
+void RenderBackend_HandleWindowResize(unsigned int width, unsigned int height)
 {
 	(void)width;
 	(void)height;
--- a/src/Backends/Rendering/SDLTexture.cpp
+++ b/src/Backends/Rendering/SDLTexture.cpp
@@ -19,7 +19,7 @@
 #include "../../MapName.h"
 #include "../../TextScr.h"
 
-typedef struct Backend_Surface
+typedef struct RenderBackend_Surface
 {
 	SDL_Texture *texture;
 	unsigned char *pixels;
@@ -27,22 +27,22 @@
 	unsigned int height;
 	BOOL lost;
 
-	struct Backend_Surface *next;
-	struct Backend_Surface *prev;
-} Backend_Surface;
+	struct RenderBackend_Surface *next;
+	struct RenderBackend_Surface *prev;
+} RenderBackend_Surface;
 
-typedef struct Backend_Glyph
+typedef struct RenderBackend_Glyph
 {
 	unsigned char *pixels;
 	unsigned int width;
 	unsigned int height;
-} Backend_Glyph;
+} RenderBackend_Glyph;
 
 static SDL_Renderer *renderer;
 
-static Backend_Surface framebuffer;
+static RenderBackend_Surface framebuffer;
 
-static Backend_Surface *surface_list_head;
+static RenderBackend_Surface *surface_list_head;
 
 static unsigned char glyph_colour_channels[3];
 
@@ -76,7 +76,7 @@
 
 	for (int i = 0; i < count; ++i)
 	{
-		Backend_Glyph *glyph = (Backend_Glyph*)sprites[i].image_id;
+		RenderBackend_Glyph *glyph = (RenderBackend_Glyph*)sprites[i].image_id;
 
 		SDL_Rect source_rect = {(int)(texture_w * sprites[i].minx), (int)(texture_h * sprites[i].maxy), (int)glyph->width, (int)glyph->height};
 		SDL_Rect destination_rect = {(int)sprites[i].x, (int)sprites[i].y, (int)glyph->width, (int)glyph->height};
@@ -90,7 +90,7 @@
 {
 	(void)udata;
 
-	Backend_Glyph *glyph = (Backend_Glyph*)image_id;
+	RenderBackend_Glyph *glyph = (RenderBackend_Glyph*)image_id;
 
 	memcpy(buffer, glyph->pixels, bytes_to_fill);
 }
@@ -115,7 +115,7 @@
 	SDL_DestroyTexture((SDL_Texture*)texture_id);
 }
 
-Backend_Surface* Backend_Init(const char *window_title, int screen_width, int screen_height, BOOL fullscreen)
+Backend_Surface* RenderBackend_Init(const char *window_title, int screen_width, int screen_height, BOOL fullscreen)
 {
 	puts("Available SDL2 render drivers:");
 
@@ -192,7 +192,7 @@
 	return NULL;
 }
 
-void Backend_Deinit(void)
+void RenderBackend_Deinit(void)
 {
 	spritebatch_term(&glyph_batcher);
 	SDL_DestroyTexture(framebuffer.texture);
@@ -200,7 +200,7 @@
 	SDL_DestroyWindow(window);
 }
 
-void Backend_DrawScreen(void)
+void RenderBackend_DrawScreen(void)
 {
 	spritebatch_tick(&glyph_batcher);
 
@@ -209,9 +209,9 @@
 	SDL_RenderPresent(renderer);
 }
 
-Backend_Surface* Backend_CreateSurface(unsigned int width, unsigned int height)
+Backend_Surface* RenderBackend_CreateSurface(unsigned int width, unsigned int height)
 {
-	Backend_Surface *surface = (Backend_Surface*)malloc(sizeof(Backend_Surface));
+	RenderBackend_Surface *surface = (RenderBackend_Surface*)malloc(sizeof(RenderBackend_Surface));
 
 	if (surface == NULL)
 		return NULL;
@@ -239,7 +239,7 @@
 	return surface;
 }
 
-void Backend_FreeSurface(Backend_Surface *surface)
+void RenderBackend_FreeSurface(RenderBackend_Surface *surface)
 {
 	if (surface == NULL)
 		return;
@@ -254,17 +254,17 @@
 	free(surface);
 }
 
-BOOL Backend_IsSurfaceLost(Backend_Surface *surface)
+BOOL RenderBackend_IsSurfaceLost(RenderBackend_Surface *surface)
 {
 	return surface->lost;
 }
 
-void Backend_RestoreSurface(Backend_Surface *surface)
+void RenderBackend_RestoreSurface(RenderBackend_Surface *surface)
 {
 	surface->lost = FALSE;
 }
 
-unsigned char* Backend_LockSurface(Backend_Surface *surface, unsigned int *pitch, unsigned int width, unsigned int height)
+unsigned char* RenderBackend_LockSurface(RenderBackend_Surface *surface, unsigned int *pitch, unsigned int width, unsigned int height)
 {
 	if (surface == NULL)
 		return NULL;
@@ -276,7 +276,7 @@
 	return surface->pixels;
 }
 
-void Backend_UnlockSurface(Backend_Surface *surface, unsigned int width, unsigned int height)
+void RenderBackend_UnlockSurface(RenderBackend_Surface *surface, unsigned int width, unsigned int height)
 {
 	if (surface == NULL)
 		return;
@@ -312,7 +312,7 @@
 	free(buffer);
 }
 
-void Backend_Blit(Backend_Surface *source_surface, const RECT *rect, Backend_Surface *destination_surface, long x, long y, BOOL colour_key)
+void RenderBackend_Blit(RenderBackend_Surface *source_surface, const RECT *rect, RenderBackend_Surface *destination_surface, long x, long y, BOOL colour_key)
 {
 	if (source_surface == NULL || destination_surface == NULL)
 		return;
@@ -328,7 +328,7 @@
 	SDL_RenderCopy(renderer, source_surface->texture, &source_rect, &destination_rect);
 }
 
-void Backend_ColourFill(Backend_Surface *surface, const RECT *rect, unsigned char red, unsigned char green, unsigned char blue)
+void RenderBackend_ColourFill(RenderBackend_Surface *surface, const RECT *rect, unsigned char red, unsigned char green, unsigned char blue)
 {
 	if (surface == NULL)
 		return;
@@ -349,9 +349,9 @@
 	SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_BLEND);
 }
 
-Backend_Glyph* Backend_LoadGlyph(const unsigned char *pixels, unsigned int width, unsigned int height, int pitch)
+Backend_Glyph* RenderBackend_LoadGlyph(const unsigned char *pixels, unsigned int width, unsigned int height, int pitch)
 {
-	Backend_Glyph *glyph = (Backend_Glyph*)malloc(sizeof(Backend_Glyph));
+	RenderBackend_Glyph *glyph = (RenderBackend_Glyph*)malloc(sizeof(RenderBackend_Glyph));
 
 	if (glyph == NULL)
 		return NULL;
@@ -385,7 +385,7 @@
 	return glyph;
 }
 
-void Backend_UnloadGlyph(Backend_Glyph *glyph)
+void RenderBackend_UnloadGlyph(RenderBackend_Glyph *glyph)
 {
 	if (glyph == NULL)
 		return;
@@ -394,7 +394,7 @@
 	free(glyph);
 }
 
-void Backend_PrepareToDrawGlyphs(Backend_Surface *destination_surface, const unsigned char *colour_channels)
+void RenderBackend_PrepareToDrawGlyphs(RenderBackend_Surface *destination_surface, const unsigned char *colour_channels)
 {
 	if (destination_surface == NULL)
 		return;
@@ -404,24 +404,24 @@
 	memcpy(glyph_colour_channels, colour_channels, sizeof(glyph_colour_channels));
 }
 
-void Backend_DrawGlyph(Backend_Glyph *glyph, long x, long y)
+void RenderBackend_DrawGlyph(RenderBackend_Glyph *glyph, long x, long y)
 {
 	spritebatch_push(&glyph_batcher, (SPRITEBATCH_U64)glyph, glyph->width, glyph->height, x, y, 1.0f, 1.0f, 0.0f, 0.0f, 0);
 }
 
-void Backend_FlushGlyphs(void)
+void RenderBackend_FlushGlyphs(void)
 {
 	spritebatch_defrag(&glyph_batcher);
 	spritebatch_flush(&glyph_batcher);
 }
 
-void Backend_HandleRenderTargetLoss(void)
+void RenderBackend_HandleRenderTargetLoss(void)
 {
-	for (Backend_Surface *surface = surface_list_head; surface != NULL; surface = surface->next)
+	for (RenderBackend_Surface *surface = surface_list_head; surface != NULL; surface = surface->next)
 		surface->lost = TRUE;
 }
 
-void Backend_HandleWindowResize(unsigned int width, unsigned int height)
+void RenderBackend_HandleWindowResize(unsigned int width, unsigned int height)
 {
 	(void)width;
 	(void)height;
--- a/src/Backends/Rendering/Software.cpp
+++ b/src/Backends/Rendering/Software.cpp
@@ -14,29 +14,29 @@
 #define MIN(a, b) ((a) < (b) ? (a) : (b))
 #define MAX(a, b) ((a) > (b) ? (a) : (b))
 
-typedef struct Backend_Surface
+typedef struct RenderBackend_Surface
 {
 	unsigned char *pixels;
 	unsigned int width;
 	unsigned int height;
 	unsigned int pitch;
-} Backend_Surface;
+} RenderBackend_Surface;
 
-typedef struct Backend_Glyph
+typedef struct RenderBackend_Glyph
 {
 	unsigned char *pixels;
 	unsigned int width;
 	unsigned int height;
-} Backend_Glyph;
+} RenderBackend_Glyph;
 
 static SDL_Surface *window_sdlsurface;
 static SDL_Surface *framebuffer_sdlsurface;
-static Backend_Surface framebuffer;
+static RenderBackend_Surface framebuffer;
 
 static unsigned char glyph_colour_channels[3];
-static Backend_Surface *glyph_destination_surface;
+static RenderBackend_Surface *glyph_destination_surface;
 
-Backend_Surface* Backend_Init(const char *window_title, int screen_width, int screen_height, BOOL fullscreen)
+Backend_Surface* RenderBackend_Init(const char *window_title, int screen_width, int screen_height, BOOL fullscreen)
 {
 	window = SDL_CreateWindow(window_title, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, screen_width, screen_height, 0);
 
@@ -75,21 +75,21 @@
 	return NULL;
 }
 
-void Backend_Deinit(void)
+void RenderBackend_Deinit(void)
 {
 	SDL_FreeSurface(framebuffer_sdlsurface);
 	SDL_DestroyWindow(window);
 }
 
-void Backend_DrawScreen(void)
+void RenderBackend_DrawScreen(void)
 {
 	SDL_BlitSurface(framebuffer_sdlsurface, NULL, window_sdlsurface, NULL);
 	SDL_UpdateWindowSurface(window);
 }
 
-Backend_Surface* Backend_CreateSurface(unsigned int width, unsigned int height)
+Backend_Surface* RenderBackend_CreateSurface(unsigned int width, unsigned int height)
 {
-	Backend_Surface *surface = (Backend_Surface*)malloc(sizeof(Backend_Surface));
+	RenderBackend_Surface *surface = (RenderBackend_Surface*)malloc(sizeof(RenderBackend_Surface));
 
 	if (surface == NULL)
 		return NULL;
@@ -109,7 +109,7 @@
 	return surface;
 }
 
-void Backend_FreeSurface(Backend_Surface *surface)
+void RenderBackend_FreeSurface(RenderBackend_Surface *surface)
 {
 	if (surface == NULL)
 		return;
@@ -118,7 +118,7 @@
 	free(surface);
 }
 
-BOOL Backend_IsSurfaceLost(Backend_Surface *surface)
+BOOL RenderBackend_IsSurfaceLost(RenderBackend_Surface *surface)
 {
 	(void)surface;
 
@@ -125,12 +125,12 @@
 	return FALSE;
 }
 
-void Backend_RestoreSurface(Backend_Surface *surface)
+void RenderBackend_RestoreSurface(RenderBackend_Surface *surface)
 {
 	(void)surface;
 }
 
-unsigned char* Backend_LockSurface(Backend_Surface *surface, unsigned int *pitch, unsigned int width, unsigned int height)
+unsigned char* RenderBackend_LockSurface(RenderBackend_Surface *surface, unsigned int *pitch, unsigned int width, unsigned int height)
 {
 	(void)width;
 	(void)height;
@@ -142,7 +142,7 @@
 	return surface->pixels;
 }
 
-void Backend_UnlockSurface(Backend_Surface *surface, unsigned int width, unsigned int height)
+void RenderBackend_UnlockSurface(RenderBackend_Surface *surface, unsigned int width, unsigned int height)
 {
 	(void)surface;
 	(void)width;
@@ -149,7 +149,7 @@
 	(void)height;
 }
 
-void Backend_Blit(Backend_Surface *source_surface, const RECT *rect, Backend_Surface *destination_surface, long x, long y, BOOL colour_key)
+void RenderBackend_Blit(RenderBackend_Surface *source_surface, const RECT *rect, RenderBackend_Surface *destination_surface, long x, long y, BOOL colour_key)
 {
 	if (source_surface == NULL || destination_surface == NULL)
 		return;
@@ -232,7 +232,7 @@
 	}
 }
 
-void Backend_ColourFill(Backend_Surface *surface, const RECT *rect, unsigned char red, unsigned char green, unsigned char blue)
+void RenderBackend_ColourFill(RenderBackend_Surface *surface, const RECT *rect, unsigned char red, unsigned char green, unsigned char blue)
 {
 	if (surface == NULL)
 		return;
@@ -290,9 +290,9 @@
 	}
 }
 
-Backend_Glyph* Backend_LoadGlyph(const unsigned char *pixels, unsigned int width, unsigned int height, int pitch)
+Backend_Glyph* RenderBackend_LoadGlyph(const unsigned char *pixels, unsigned int width, unsigned int height, int pitch)
 {
-	Backend_Glyph *glyph = (Backend_Glyph*)malloc(sizeof(Backend_Glyph));
+	RenderBackend_Glyph *glyph = (RenderBackend_Glyph*)malloc(sizeof(RenderBackend_Glyph));
 
 	if (glyph == NULL)
 		return NULL;
@@ -314,7 +314,7 @@
 	return glyph;
 }
 
-void Backend_UnloadGlyph(Backend_Glyph *glyph)
+void RenderBackend_UnloadGlyph(RenderBackend_Glyph *glyph)
 {
 	if (glyph == NULL)
 		return;
@@ -323,7 +323,7 @@
 	free(glyph);
 }
 
-void Backend_PrepareToDrawGlyphs(Backend_Surface *destination_surface, const unsigned char *colour_channels)
+void RenderBackend_PrepareToDrawGlyphs(RenderBackend_Surface *destination_surface, const unsigned char *colour_channels)
 {
 	if (destination_surface == NULL)
 		return;
@@ -333,7 +333,7 @@
 	memcpy(glyph_colour_channels, colour_channels, sizeof(glyph_colour_channels));
 }
 
-void Backend_DrawGlyph(Backend_Glyph *glyph, long x, long y)
+void RenderBackend_DrawGlyph(RenderBackend_Glyph *glyph, long x, long y)
 {
 	if (glyph == NULL)
 		return;
@@ -357,17 +357,17 @@
 	}
 }
 
-void Backend_FlushGlyphs(void)
+void RenderBackend_FlushGlyphs(void)
 {
 	
 }
 
-void Backend_HandleRenderTargetLoss(void)
+void RenderBackend_HandleRenderTargetLoss(void)
 {
 	// No problem for us
 }
 
-void Backend_HandleWindowResize(unsigned int width, unsigned int height)
+void RenderBackend_HandleWindowResize(unsigned int width, unsigned int height)
 {
 	(void)width;
 	(void)height;
--- a/src/Backends/SDL2/Platform.cpp
+++ b/src/Backends/SDL2/Platform.cpp
@@ -222,7 +222,7 @@
 
 					case SDL_WINDOWEVENT_RESIZED:
 					case SDL_WINDOWEVENT_SIZE_CHANGED:
-						Backend_HandleWindowResize(event.window.data1, event.window.data2);
+						RenderBackend_HandleWindowResize(event.window.data1, event.window.data2);
 						break;
 				}
 
@@ -233,7 +233,7 @@
 				return FALSE;
 
 			case SDL_RENDER_TARGETS_RESET:
-				Backend_HandleRenderTargetLoss();
+				RenderBackend_HandleRenderTargetLoss();
 				break;
 
 		}
--- a/src/Draw.cpp
+++ b/src/Draw.cpp
@@ -32,9 +32,9 @@
 int magnification;
 BOOL fullscreen;
 
-static Backend_Surface *framebuffer;
+static RenderBackend_Surface *framebuffer;
 
-static Backend_Surface *surf[SURFACE_ID_MAX];
+static RenderBackend_Surface *surf[SURFACE_ID_MAX];
 
 static FontObject *font;
 
@@ -72,7 +72,7 @@
 	else
 		timePrev += 20;
 
-	Backend_DrawScreen();
+	RenderBackend_DrawScreen();
 
 	if (RestoreSurfaces())
 	{
@@ -106,7 +106,7 @@
 			break;
 	}
 
-	framebuffer = Backend_Init(title, width, height, fullscreen);
+	framebuffer = RenderBackend_Init(title, width, height, fullscreen);
 
 	if (framebuffer == NULL)
 		return FALSE;
@@ -123,7 +123,7 @@
 	{
 		if (surf[i] != NULL)
 		{
-			Backend_FreeSurface(surf[i]);
+			RenderBackend_FreeSurface(surf[i]);
 			surf[i] = NULL;
 		}
 	}
@@ -130,7 +130,7 @@
 
 	framebuffer = NULL;
 
-	Backend_Deinit();
+	RenderBackend_Deinit();
 
 	memset(surface_metadata, 0, sizeof(surface_metadata));
 }
@@ -140,7 +140,7 @@
 	// Release the surface we want to release
 	if (surf[s] != NULL)
 	{
-		Backend_FreeSurface(surf[s]);
+		RenderBackend_FreeSurface(surf[s]);
 		surf[s] = NULL;
 	}
 
@@ -151,7 +151,7 @@
 {
 	// IF YOU WANT TO ADD HD SPRITES, THIS IS THE CODE YOU SHOULD EDIT
 	unsigned int pitch;
-	unsigned char *pixels = Backend_LockSurface(surf[surf_no], &pitch, width * magnification, height * magnification);
+	unsigned char *pixels = RenderBackend_LockSurface(surf[surf_no], &pitch, width * magnification, height * magnification);
 
 	if (magnification == 1)
 	{
@@ -192,7 +192,7 @@
 		}
 	}
 
-	Backend_UnlockSurface(surf[surf_no], width * magnification, height * magnification);
+	RenderBackend_UnlockSurface(surf[surf_no], width * magnification, height * magnification);
 
 	return TRUE;
 }
@@ -218,7 +218,7 @@
 	if (image_buffer == NULL)
 		return FALSE;
 
-	surf[surf_no] = Backend_CreateSurface(width * magnification, height * magnification);
+	surf[surf_no] = RenderBackend_CreateSurface(width * magnification, height * magnification);
 
 	if (surf[surf_no] == NULL)
 	{
@@ -228,7 +228,7 @@
 
 	if (!ScaleAndUploadSurface(image_buffer, width, height, surf_no))
 	{
-		Backend_FreeSurface(surf[surf_no]);
+		RenderBackend_FreeSurface(surf[surf_no]);
 		FreeBitmap(image_buffer);
 		return FALSE;
 	}
@@ -280,7 +280,7 @@
 		return FALSE;
 	}
 
-	surf[surf_no] = Backend_CreateSurface(width * magnification, height * magnification);
+	surf[surf_no] = RenderBackend_CreateSurface(width * magnification, height * magnification);
 
 	if (surf[surf_no] == NULL)
 	{
@@ -290,7 +290,7 @@
 
 	if (!ScaleAndUploadSurface(image_buffer, width, height, surf_no))
 	{
-		Backend_FreeSurface(surf[surf_no]);
+		RenderBackend_FreeSurface(surf[surf_no]);
 		FreeBitmap(image_buffer);
 		return FALSE;
 	}
@@ -391,7 +391,7 @@
 	if (surf[surf_no] != NULL)
 		return FALSE;
 
-	surf[surf_no] = Backend_CreateSurface(bxsize * magnification, bysize * magnification);
+	surf[surf_no] = RenderBackend_CreateSurface(bxsize * magnification, bysize * magnification);
 
 	if (surf[surf_no] == NULL)
 		return FALSE;
@@ -418,7 +418,7 @@
 	scaled_rect.right = rect->right * magnification;
 	scaled_rect.bottom = rect->bottom * magnification;
 
-	Backend_Blit(framebuffer, &scaled_rect, surf[surf_no], scaled_rect.left, scaled_rect.top, FALSE);
+	RenderBackend_Blit(framebuffer, &scaled_rect, surf[surf_no], scaled_rect.left, scaled_rect.top, FALSE);
 }
 
 void PutBitmap3(const RECT *rcView, int x, int y, const RECT *rect, SurfaceID surf_no) // Transparency
@@ -450,7 +450,7 @@
 	rcWork.right *= magnification;
 	rcWork.bottom *= magnification;
 
-	Backend_Blit(surf[surf_no], &rcWork, framebuffer, x * magnification, y * magnification, TRUE);
+	RenderBackend_Blit(surf[surf_no], &rcWork, framebuffer, x * magnification, y * magnification, TRUE);
 }
 
 void PutBitmap4(const RECT *rcView, int x, int y, const RECT *rect, SurfaceID surf_no) // No Transparency
@@ -482,7 +482,7 @@
 	rcWork.right *= magnification;
 	rcWork.bottom *= magnification;
 
-	Backend_Blit(surf[surf_no], &rcWork, framebuffer, x * magnification, y * magnification, FALSE);
+	RenderBackend_Blit(surf[surf_no], &rcWork, framebuffer, x * magnification, y * magnification, FALSE);
 }
 
 void Surface2Surface(int x, int y, const RECT *rect, int to, int from)
@@ -494,7 +494,7 @@
 	rcWork.right = rect->right * magnification;
 	rcWork.bottom = rect->bottom * magnification;
 
-	Backend_Blit(surf[from], &rcWork, surf[to], x * magnification, y * magnification, TRUE);
+	RenderBackend_Blit(surf[from], &rcWork, surf[to], x * magnification, y * magnification, TRUE);
 }
 
 unsigned long GetCortBoxColor(unsigned long col)
@@ -515,7 +515,7 @@
 	const unsigned char green = (col >> 8) & 0xFF;
 	const unsigned char blue = (col >> 16) & 0xFF;
 
-	Backend_ColourFill(framebuffer, &dst_rect, red, green, blue);
+	RenderBackend_ColourFill(framebuffer, &dst_rect, red, green, blue);
 }
 
 void CortBox2(const RECT *rect, unsigned long col, SurfaceID surf_no)
@@ -532,7 +532,7 @@
 	const unsigned char green = (col >> 8) & 0xFF;
 	const unsigned char blue = (col >> 16) & 0xFF;
 
-	Backend_ColourFill(surf[surf_no], &dst_rect, red, green, blue);
+	RenderBackend_ColourFill(surf[surf_no], &dst_rect, red, green, blue);
 }
 
 BOOL DummiedOutLogFunction(int unknown)
@@ -560,10 +560,10 @@
 	if (framebuffer == NULL)
 		return surfaces_regenerated;
 
-	if (Backend_IsSurfaceLost(framebuffer))
+	if (RenderBackend_IsSurfaceLost(framebuffer))
 	{
 		++surfaces_regenerated;
-		Backend_RestoreSurface(framebuffer);
+		RenderBackend_RestoreSurface(framebuffer);
 		DummiedOutLogFunction(0x62);
 	}
 
@@ -571,10 +571,10 @@
 	{
 		if (surf[s] != NULL)
 		{
-			if (Backend_IsSurfaceLost(surf[s]))
+			if (RenderBackend_IsSurfaceLost(surf[s]))
 			{
 				++surfaces_regenerated;
-				Backend_RestoreSurface(surf[s]);
+				RenderBackend_RestoreSurface(surf[s]);
 				DummiedOutLogFunction(0x30 + s);
 
 				if (!surface_metadata[s].bSystem)
--- a/src/Font.cpp
+++ b/src/Font.cpp
@@ -32,7 +32,7 @@
 	int x;
 	int y;
 	int x_advance;
-	Backend_Glyph *backend;
+	RenderBackend_Glyph *backend;
 
 	struct CachedGlyph *next;
 } CachedGlyph;
@@ -1014,7 +1014,7 @@
 				break;
 		}
 
-		glyph->backend = Backend_LoadGlyph(bitmap.buffer, bitmap.width, bitmap.rows, bitmap.pitch);
+		glyph->backend = RenderBackend_LoadGlyph(bitmap.buffer, bitmap.width, bitmap.rows, bitmap.pitch);
 
 		FT_Bitmap_Done(font_object->library, &bitmap);
 	}
@@ -1029,7 +1029,7 @@
 	{
 		CachedGlyph *next_glyph = glyph->next;
 
-		Backend_UnloadGlyph(glyph->backend);
+		RenderBackend_UnloadGlyph(glyph->backend);
 		free(glyph);
 
 		glyph = next_glyph;
@@ -1093,13 +1093,13 @@
 	return font_object;
 }
 
-void DrawText(FontObject *font_object, Backend_Surface *surface, int x, int y, unsigned long colour, const char *string)
+void DrawText(FontObject *font_object, RenderBackend_Surface *surface, int x, int y, unsigned long colour, const char *string)
 {
 	if (font_object != NULL)
 	{
 		const unsigned char colour_channels[3] = {(unsigned char)colour, (unsigned char)(colour >> 8), (unsigned char)(colour >> 16)};
 
-		Backend_PrepareToDrawGlyphs(surface, colour_channels);
+		RenderBackend_PrepareToDrawGlyphs(surface, colour_channels);
 
 		unsigned int pen_x = 0;
 
@@ -1124,13 +1124,13 @@
 				const int letter_y = y + glyph->y;
 
 				if (glyph->backend != NULL)
-					Backend_DrawGlyph(glyph->backend, letter_x, letter_y);
+					RenderBackend_DrawGlyph(glyph->backend, letter_x, letter_y);
 
 				pen_x += glyph->x_advance;
 			}
 		}
 
-		Backend_FlushGlyphs();
+		RenderBackend_FlushGlyphs();
 	}
 }
 
--- a/src/Font.h
+++ b/src/Font.h
@@ -8,5 +8,5 @@
 
 FontObject* LoadFontFromData(const unsigned char *data, size_t data_size, unsigned int cell_width, unsigned int cell_height);
 FontObject* LoadFont(const char *font_filename, unsigned int cell_width, unsigned int cell_height);
-void DrawText(FontObject *font_object, Backend_Surface *surface, int x, int y, unsigned long colour, const char *string);
+void DrawText(FontObject *font_object, RenderBackend_Surface *surface, int x, int y, unsigned long colour, const char *string);
 void UnloadFont(FontObject *font_object);