1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| #include <stdlib.h> #include <stdbool.h> #include <SDL2/SDL.h>
#define WINDOW_WIDTH 800; #define WINDOW_HEIGHT 600;
int main(int args, char** argv) { SDL_Window* window = SDL_CreateWindow("Hello", SDL_WINDOW_UNDEFINED, SDL_WINDOW_UNDEFINED, WINDOW_WIDTH,WINDOW_HEIGHT,SDL_WINDOW_SHOWN); SDL_Render* rend = SDL_CreateRender(window, -1, SDL_RENDER_ACCELERATED);
bool quit = false; SDL_Event event; while(!quit){ while(SDL_PollEvent(&event)){ if(event.type == SDL_QUIT) { quit = true; } } SDL_Delay(10); } SDL_DestroyWindow(window); return 0; }
|