ref: 97d9fcc7049ee277cfc452fb9ceb4c75c9dbe96c
parent: b3b348f49cf038bac8b92c06f67539a2132642dd
parent: 65053fe34bd36b0b6b5965c78b0c456f134ab9a5
author: Jonne Kokkonen <jonne.kokkonen@gmail.com>
date: Wed Apr 19 17:33:42 EDT 2023
Merge pull request #101 from RyanDam/render_canvas Able to render m8 background color to SDL canvas
--- a/render.c
+++ b/render.c
@@ -15,10 +15,11 @@
SDL_Window *win;
SDL_Renderer *rend;
SDL_Texture *maintexture;
-SDL_Color background_color = (SDL_Color){0, 0, 0, 0};+SDL_Color background_color = (SDL_Color){.r = 0x00, .g = 0x00, .b = 0x00, .a = 0x00};static uint32_t ticks_fps;
static int fps;
+
uint8_t fullscreen = 0;
static uint8_t dirty = 0;
@@ -52,7 +53,9 @@
SDL_SetRenderTarget(rend, maintexture);
- SDL_SetRenderDrawColor(rend, 0x00, 0x00, 0x00, 0x00);
+ SDL_SetRenderDrawColor(rend, background_color.r, background_color.g,
+ background_color.b, background_color.a);
+
SDL_RenderClear(rend);
// Initialize a texture for the font and read the inline font bitmap
@@ -228,7 +231,10 @@
dirty = 0;
//ticks = SDL_GetTicks();
SDL_SetRenderTarget(rend, NULL);
- SDL_SetRenderDrawColor(rend, 0, 0, 0, 0);
+
+ SDL_SetRenderDrawColor(rend, background_color.r, background_color.g,
+ background_color.b, background_color.a);
+
SDL_RenderClear(rend);
SDL_RenderCopy(rend, maintexture, NULL, NULL);
SDL_RenderPresent(rend);
--- a/render.h
+++ b/render.h
@@ -22,4 +22,4 @@
void screensaver_draw();
void screensaver_destroy();
-#endif
\ No newline at end of file
+#endif
--
⑨