Well, it used to work just fine on Windows. But that's just a clue that I found somewhere, pieced together with a somehow missing driver (?) when 'SDL_GetCurrentVideoDriver()' is called and borked Kubuntu install of mine.
>>106595574
No errors. Here's the code, adapted from the one you posted:
#include
#include
const int SCREEN_WIDTH = 800;
const int SCREEN_HEIGHT = 600;
int main(int argc, char* args[])
{
SDL_Window *ptr_window = nullptr;
//SDL_Surface *ptr_screenSurface = nullptr;
SDL_Renderer *ptr_renderer = nullptr;
if ((SDL_Init(SDL_INIT_VIDEO))<0)
{
printf("- SDL could not be initialized! SDL_Error: %s\n", SDL_GetError());
SDL_DestroyWindow(ptr_window);
SDL_DestroyRenderer(ptr_renderer);
SDL_Quit();
return -1;
} else
{
if (SDL_CreateWindowAndRenderer(SCREEN_WIDTH, SCREEN_HEIGHT, 0, &ptr_window, &ptr_renderer) == -1)
{
printf("- SDL could not create window and renderer combination! SDL_Error: %s\n", SDL_GetError());
SDL_DestroyWindow(ptr_window);
SDL_DestroyRenderer(ptr_renderer);
SDL_Quit();
return -1;
}
else
{
printf("- This is merely a test. All systems appear to have initialized correctly. Quitting now...\n\n");
SDL_DestroyWindow(ptr_window);
SDL_DestroyRenderer(ptr_renderer);
SDL_Quit();
return 0;
}
}
}
Terminal output:
>- This is merely a test. All systems appear to have initialized correctly. Quitting now...
>[1] + Done "/usr/bin/gdb" --interpreter=mi --tty=${DbgTerm} 0<"/tmp/Microsoft-MIEngine-In-wbqdgfyt.yh5" 1>"/tmp/Microsoft-MIEngine-Out-15u1klyt.rsn"
I'm using Vscode, by the way.