commit a6fbee2
0uppy
·
2026-07-21 21:32:31 +0000 UTC
parent 2200eaf
cotton v0.2 - fixed colours displaying wierd and SDL_Init being unnecessarily called twice
1 files changed,
+1,
-2
+1,
-2
1@@ -3,7 +3,6 @@
2
3 int cottonwindow_init(CottonWindow *cw, const char *title, int window_w, int window_h, int texture_w, int texture_h)
4 {
5- SDL_Init(SDL_INIT_VIDEO);
6
7 if (SDL_Init(SDL_INIT_VIDEO) != 0)
8 {
9@@ -25,7 +24,7 @@ int cottonwindow_init(CottonWindow *cw, const char *title, int window_w, int win
10 return 0;
11 }
12
13- cw->texture = SDL_CreateTexture(cw->renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_STREAMING, texture_w, texture_h);
14+ cw->texture = SDL_CreateTexture(cw->renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, texture_w, texture_h);
15 if (!cw->texture)
16 {
17 fprintf(stderr, "cotton couldn't apply textures :( : %s\n", SDL_GetError());