0
created and compiled a program in SDL, I do not know the reason, but it always returns a transparent screen, when the expected is a white screen.
I’m using the following code:
#include <SDL.h>
int main(int argc, char *argv[])
{
SDL_Window *window;
SDL_Surface *screenSurface;
SDL_Init(SDL_INIT_VIDEO);
window = SDL_CreateWindow("Tutorial", 100, 50, 320, 480, SDL_WINDOW_SHOWN);
screenSurface = SDL_GetWindowSurface(window);
SDL_Delay(5000);
SDL_FreeSurface(screenSurface);
SDL_DestroyWindow(window);
SDL_Quit();
return 0;
}
And I’m compiling with this command on the cmd:
g++ "C:\Users\DANI\Documents\Learn\SDL\Test.cpp" -o Test.exe -I "C:\MinGW\include\SDL2" -mwindows -lmingw32 -lSDL2main -lSDL2