From: Tomas Mudrunka Date: Thu, 16 Jul 2020 14:29:06 +0000 (+0200) Subject: resizable window X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=cb8003e63ff12aa8416c907395ee5a64db7704dc;p=mirrors%2FPrograms.git resizable window --- diff --git a/c/SDL2_putpixel_click/main.c b/c/SDL2_putpixel_click/main.c index a1955ed..72adf70 100644 --- a/c/SDL2_putpixel_click/main.c +++ b/c/SDL2_putpixel_click/main.c @@ -15,8 +15,11 @@ int main(void) { int i; SDL_Init(SDL_INIT_VIDEO); - SDL_CreateWindowAndRenderer(WINDOW_WIDTH, WINDOW_WIDTH, 0, &window, &renderer); + SDL_CreateWindowAndRenderer(WINDOW_WIDTH, WINDOW_WIDTH, SDL_WINDOW_RESIZABLE, &window, &renderer); //SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP); + //SDL_RenderSetScale(renderer, 2.0, 2.0); + SDL_SetWindowTitle(window, "Simple SDL paint"); + SDL_SetRenderDrawColor(renderer, 0, 0, 0, 0); SDL_RenderClear(renderer); @@ -35,6 +38,8 @@ int main(void) { event.type = 0; if(SDL_PollEvent(&event)) { switch(event.type){ + case SDL_WINDOWEVENT: + break; case SDL_QUIT: running = 0; break;