mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-19 07:20:25 +00:00
a commandline option to disable vsync
This commit is contained in:
parent
0412ea7b7c
commit
3b19ae2bbd
@ -1063,10 +1063,16 @@ void saveHighQualityShot(const char *fname, const char *caption, int fade) {
|
|||||||
|
|
||||||
bool setfsize = true;
|
bool setfsize = true;
|
||||||
|
|
||||||
|
bool vsync_off;
|
||||||
|
|
||||||
void do_setfsize() {
|
void do_setfsize() {
|
||||||
vid.fsize = min(vid.yres * fontscale/ 3200, vid.xres * fontscale/ 4800), setfsize = false;
|
vid.fsize = min(vid.yres * fontscale/ 3200, vid.xres * fontscale/ 4800), setfsize = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void disable_vsync() {
|
||||||
|
SDL_GL_SetAttribute( SDL_GL_SWAP_CONTROL, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
#if CAP_SDL
|
#if CAP_SDL
|
||||||
void setvideomode() {
|
void setvideomode() {
|
||||||
|
|
||||||
@ -1085,6 +1091,7 @@ void setvideomode() {
|
|||||||
if(vid.usingGL) {
|
if(vid.usingGL) {
|
||||||
flags = SDL_OPENGL | SDL_HWSURFACE | SDL_GL_DOUBLEBUFFER;
|
flags = SDL_OPENGL | SDL_HWSURFACE | SDL_GL_DOUBLEBUFFER;
|
||||||
SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 1);
|
SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 1);
|
||||||
|
if(vsync_off) disable_vsync();
|
||||||
#if !ISWEB
|
#if !ISWEB
|
||||||
if(vid.antialias & AA_MULTI) {
|
if(vid.antialias & AA_MULTI) {
|
||||||
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);
|
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);
|
||||||
|
@ -74,6 +74,10 @@ int arg::readCommon() {
|
|||||||
else if(argis("-font")) { PHASE(1); shift(); fontpath = args(); }
|
else if(argis("-font")) { PHASE(1); shift(); fontpath = args(); }
|
||||||
else if(argis("-picload")) { PHASE(3); shift(); mapeditor::loadPicFile(args()); }
|
else if(argis("-picload")) { PHASE(3); shift(); mapeditor::loadPicFile(args()); }
|
||||||
#endif
|
#endif
|
||||||
|
else if(argis("-vsync_off")) {
|
||||||
|
vsync_off = true;
|
||||||
|
if(curphase == 3) setvideomode();
|
||||||
|
}
|
||||||
else if(argis("-canvas")) {
|
else if(argis("-canvas")) {
|
||||||
PHASE(2);
|
PHASE(2);
|
||||||
firstland = specialland = laCanvas;
|
firstland = specialland = laCanvas;
|
||||||
|
Loading…
Reference in New Issue
Block a user