feat: basic window opening

This commit is contained in:
2025-10-30 13:07:31 +01:00
parent d8eeca6cff
commit 8557bd3722

26
src/main.cpp Normal file
View File

@@ -0,0 +1,26 @@
#include <SDL2/SDL.h>
#include <iostream>
int main() {
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
std::cout << "SDL could not initialize! SDL_Error: " << SDL_GetError() << std::endl;
return -1;
}
SDL_Window* window = SDL_CreateWindow("SDL Window",
SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
640, 480, SDL_WINDOW_SHOWN);
if (window == NULL) {
std::cout << "Window could not be created! SDL_Error: " << SDL_GetError() << std::endl;
SDL_Quit();
return -1;
}
SDL_Delay(5000);
SDL_DestroyWindow(window);
SDL_Quit();
return 0;
}