Update sdl.c

This commit is contained in:
Jason Bou-Samra
2024-09-28 09:51:23 +10:00
committed by GitHub
parent fdd906330c
commit 10dc1ee809
+9
View File
@@ -12,6 +12,12 @@ SDL_RWops* rwops_new;
SDL_Surface* image; SDL_Surface* image;
SDL_Texture * texture; SDL_Texture * texture;
Uint32 format;
const char *format2;
int access;
int widt;
int heig;
///////////////////////// WINDOW PARMS ///////////////////////// ///////////////////////// WINDOW PARMS /////////////////////////
#define WIDTH 1280 // pixels #define WIDTH 1280 // pixels
#define HEIGHT 800 // pixels #define HEIGHT 800 // pixels
@@ -53,6 +59,9 @@ int init_gfx(void) {
texture = SDL_CreateTextureFromSurface(sr, image); texture = SDL_CreateTextureFromSurface(sr, image);
SDL_FreeSurface( image ); SDL_FreeSurface( image );
image = NULL; image = NULL;
SDL_QueryTexture(texture, &format, &access, &widt, &heig);
format2 = SDL_GetPixelFormatName(format);
printf("format: %s, access: %i, width: %i, height: %i,", format2, access, widt, heig);
return 0; return 0;
} }