conformal:: resizing the window works now

This commit is contained in:
Zeno Rogue 2018-04-21 12:14:25 +02:00
parent 8c776a29e9
commit 90cc9e1b49
3 changed files with 18 additions and 8 deletions

View File

@ -210,6 +210,12 @@ namespace spiral {
SDL_Event event;
while(SDL_PollEvent(&event)) switch (event.type) {
case SDL_VIDEORESIZE: {
resize_screen_to(event.resize.w, event.resize.h);
precompute();
break;
}
case SDL_QUIT: case SDL_MOUSEBUTTONDOWN:
goto breakloop;

View File

@ -448,6 +448,15 @@ void mainloopiter() { printf("(compiled without SDL -- no action)\n"); quitmainl
int cframelimit = 1000;
void resize_screen_to(int x, int y) {
vid.xres = x;
vid.yres = y;
vid.killreduction = 0;
extern bool setfsize;
setfsize = true;
setvideomode();
}
void mainloopiter() {
DEBB(DF_GRAPH, (debugfile,"main loop\n"));
@ -564,14 +573,8 @@ void mainloopiter() {
}
}
if(ev.type == SDL_VIDEORESIZE) {
vid.xres = ev.resize.w;
vid.yres = ev.resize.h;
vid.killreduction = 0;
extern bool setfsize;
setfsize = true;
setvideomode();
}
if(ev.type == SDL_VIDEORESIZE)
resize_screen_to(ev.resize.w, ev.resize.h);
if(ev.type == SDL_VIDEOEXPOSE) {
drawscreen();

View File

@ -3260,3 +3260,4 @@ bool horo_ok();
ld master_to_c7_angle();
extern int mutantphase;
void resize_screen_to(int x, int y);