feat: use sdl3
This commit is contained in:
25
src/main.cpp
25
src/main.cpp
@@ -1,26 +1,17 @@
|
|||||||
#include <SDL2/SDL.h>
|
#include <SDL3/SDL.h>
|
||||||
#include <iostream>
|
#include <cstdio>
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
|
if (!SDL_Init(SDL_INIT_VIDEO)){
|
||||||
std::cout << "SDL could not initialize! SDL_Error: " << SDL_GetError() << std::endl;
|
std::printf("SDL_INIT() failed");
|
||||||
return -1;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_Window* window = SDL_CreateWindow("SDL Window",
|
SDL_Window *window;
|
||||||
SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
|
window = SDL_CreateWindow("Physics Sim", 720, 540, SDL_WINDOW_RESIZABLE);
|
||||||
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_Delay(5000);
|
||||||
SDL_DestroyWindow(window);
|
|
||||||
SDL_Quit();
|
SDL_Quit();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user