feat: use sdl3

This commit is contained in:
2025-10-31 12:02:07 +01:00
parent 8557bd3722
commit 9ea8ee05db

View File

@@ -1,26 +1,17 @@
#include <SDL2/SDL.h>
#include <iostream>
#include <SDL3/SDL.h>
#include <cstdio>
#include <cstdlib>
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;
}