46 lines
846 B
C++
46 lines
846 B
C++
// #define SDL_MAIN_HANDLED
|
|
#include "SDL3/SDL_rect.h"
|
|
#include <stdio.h>
|
|
|
|
#include <SDL3/SDL.h>
|
|
#include <SDL3/SDL_main.h>
|
|
|
|
/*Use This Command to Run:
|
|
g++ main.cpp -o main.exe -I./SDL3-3.3.6/x86_64-w64-mingw32/include
|
|
-L./SDL3-3.3.6/x86_64-w64-mingw32/lib -lSDL3
|
|
*/
|
|
|
|
int main(int argc, char** argv){
|
|
if(SDL_Init(SDL_INIT_VIDEO) == 0){
|
|
printf("SDL_Init error: %s\n", SDL_GetError());
|
|
return -1;
|
|
}
|
|
|
|
SDL_Window* window = SDL_CreateWindow(
|
|
"My Window",
|
|
800, 600,
|
|
SDL_WINDOW_RESIZABLE
|
|
);
|
|
|
|
if(!window){
|
|
printf("SDL_CreateWindow Error: %s\n", SDL_GetError());
|
|
return 1;
|
|
}
|
|
|
|
int running = 1;
|
|
while(running){
|
|
SDL_Event e;
|
|
while(SDL_PollEvent(&e)){
|
|
if(e.type == SDL_EVENT_QUIT){
|
|
running = 0;
|
|
}
|
|
}
|
|
SDL_Delay(16);
|
|
}
|
|
|
|
SDL_DestroyWindow(window);
|
|
SDL_Quit();
|
|
|
|
return 0;
|
|
}
|