mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-02-22 14:00:13 +00:00
conformal:: resizing the window works now
This commit is contained in:
parent
8c776a29e9
commit
90cc9e1b49
@ -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;
|
||||
|
||||
|
19
control.cpp
19
control.cpp
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user