feat: basic window opening
This commit is contained in:
26
src/main.cpp
Normal file
26
src/main.cpp
Normal 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user