From 9ea8ee05db9d794df65261ddf80910d24b4912b8 Mon Sep 17 00:00:00 2001 From: Alejandro Laguna Date: Fri, 31 Oct 2025 12:02:07 +0100 Subject: [PATCH] feat: use sdl3 --- src/main.cpp | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 32ef547..0bd512a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,26 +1,17 @@ -#include -#include +#include +#include +#include int main() { - if (SDL_Init(SDL_INIT_VIDEO) < 0) { - std::cout << "SDL could not initialize! SDL_Error: " << SDL_GetError() << std::endl; - return -1; + if (!SDL_Init(SDL_INIT_VIDEO)){ + std::printf("SDL_INIT() failed"); + return EXIT_FAILURE; } - 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_Window *window; + window = SDL_CreateWindow("Physics Sim", 720, 540, SDL_WINDOW_RESIZABLE); SDL_Delay(5000); - SDL_DestroyWindow(window); SDL_Quit(); - return 0; } -