Created
December 19, 2023 23:06
-
-
Save tonitch/e22efcfa8b18ab3e67203e08f8a33b20 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SDL2/SDL.h> | |
#define SIZE 10 | |
#define WIDTH SIZE * 16 | |
#define HEIGHT SIZE * 9 | |
int main(void) | |
{ | |
SDL_Init(SDL_INIT_VIDEO); | |
SDL_Window* win = SDL_CreateWindow("note", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, WIDTH, HEIGHT, 0); | |
SDL_Renderer* ren = SDL_CreateRenderer(win, -1, SDL_RENDERER_PRESENTVSYNC); | |
SDL_Event e; | |
SDL_bool should_exit = SDL_FALSE; | |
SDL_SetRenderDrawColor(ren, 0x18, 0x18, 0x18, SDL_ALPHA_OPAQUE); | |
while(!should_exit){ | |
while(SDL_PollEvent(&e)) | |
if(e.type == SDL_QUIT) | |
should_exit = SDL_TRUE; | |
SDL_RenderClear(ren); | |
} | |
SDL_DestroyRenderer(ren); | |
SDL_DestroyWindow(win); | |
SDL_Quit(); | |
return 0; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment