EditorSDL
This commit is contained in:
45
editor/main.cpp~
Normal file
45
editor/main.cpp~
Normal file
@@ -0,0 +1,45 @@
|
||||
// #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;
|
||||
}
|
||||
Reference in New Issue
Block a user