mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-02-23 14:30:08 +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;
|
SDL_Event event;
|
||||||
while(SDL_PollEvent(&event)) switch (event.type) {
|
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:
|
case SDL_QUIT: case SDL_MOUSEBUTTONDOWN:
|
||||||
goto breakloop;
|
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;
|
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() {
|
void mainloopiter() {
|
||||||
|
|
||||||
DEBB(DF_GRAPH, (debugfile,"main loop\n"));
|
DEBB(DF_GRAPH, (debugfile,"main loop\n"));
|
||||||
@ -564,14 +573,8 @@ void mainloopiter() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ev.type == SDL_VIDEORESIZE) {
|
if(ev.type == SDL_VIDEORESIZE)
|
||||||
vid.xres = ev.resize.w;
|
resize_screen_to(ev.resize.w, ev.resize.h);
|
||||||
vid.yres = ev.resize.h;
|
|
||||||
vid.killreduction = 0;
|
|
||||||
extern bool setfsize;
|
|
||||||
setfsize = true;
|
|
||||||
setvideomode();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(ev.type == SDL_VIDEOEXPOSE) {
|
if(ev.type == SDL_VIDEOEXPOSE) {
|
||||||
drawscreen();
|
drawscreen();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user