Skip to content

Commit 5872594

Browse files
committed
Fixed color bug on Windows
1 parent 0735d80 commit 5872594

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ cmake_install.cmake
1111
space-war
1212
settings.ini
1313
save.bin
14+
/out/build/x64-Release
15+
/CMakeSettings.json

src/init.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,13 @@ static struct window *init_window(int width, int height)
3131
window->w = width;
3232
window->h = height;
3333

34-
window->renderer = SDL_CreateRenderer(window->window, -1, SDL_RENDERER_PRESENTVSYNC);
34+
window->renderer = SDL_CreateRenderer(window->window, -1,
35+
#ifndef _WIN32
36+
SDL_RENDERER_SOFTWARE
37+
#else
38+
SDL_RENDERER_PRESENTVSYNC
39+
#endif
40+
);
3541

3642
if (!window->renderer)
3743
error("Could not create renderer", SDL_GetError(), NULL);

src/save.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include "init.h"
44
#include "save.h"
55
#include "utils.h"
6+
#include <stdio.h>
67
#include <SDL2/SDL.h>
78

89

0 commit comments

Comments
 (0)