mirror of
https://github.com/love2d/love.git
synced 2026-08-20 04:30:09 +02:00
Store and restore caption and mouse visibility when using setMode (bug #142)
This commit is contained in:
@@ -117,6 +117,11 @@ namespace opengl
|
|||||||
//do we have scissor, if so, store the box
|
//do we have scissor, if so, store the box
|
||||||
if (s.scissor)
|
if (s.scissor)
|
||||||
glGetIntegerv(GL_SCISSOR_BOX, s.scissorBox);
|
glGetIntegerv(GL_SCISSOR_BOX, s.scissorBox);
|
||||||
|
|
||||||
|
char *cap = 0;
|
||||||
|
SDL_WM_GetCaption(&cap, 0);
|
||||||
|
s.caption = cap;
|
||||||
|
s.mouseVisible = (SDL_ShowCursor(SDL_QUERY) == SDL_ENABLE) ? true : false;
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,6 +141,9 @@ namespace opengl
|
|||||||
setScissor(s.scissorBox[0], s.scissorBox[1], s.scissorBox[2], s.scissorBox[3]);
|
setScissor(s.scissorBox[0], s.scissorBox[1], s.scissorBox[2], s.scissorBox[3]);
|
||||||
else
|
else
|
||||||
setScissor();
|
setScissor();
|
||||||
|
|
||||||
|
setCaption(s.caption.c_str());
|
||||||
|
SDL_ShowCursor(s.mouseVisible ? SDL_ENABLE : SDL_DISABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Graphics::setMode(int width, int height, bool fullscreen, bool vsync, int fsaa)
|
bool Graphics::setMode(int width, int height, bool fullscreen, bool vsync, int fsaa)
|
||||||
|
|||||||
@@ -93,6 +93,10 @@ namespace opengl
|
|||||||
bool scissor;
|
bool scissor;
|
||||||
GLint scissorBox[4];
|
GLint scissorBox[4];
|
||||||
|
|
||||||
|
// Window info.
|
||||||
|
std::string caption;
|
||||||
|
bool mouseVisible;
|
||||||
|
|
||||||
// Default values.
|
// Default values.
|
||||||
DisplayState()
|
DisplayState()
|
||||||
{
|
{
|
||||||
@@ -112,6 +116,8 @@ namespace opengl
|
|||||||
pointSize = 1.0f;
|
pointSize = 1.0f;
|
||||||
pointStyle = Graphics::POINT_SMOOTH;
|
pointStyle = Graphics::POINT_SMOOTH;
|
||||||
scissor = false;
|
scissor = false;
|
||||||
|
caption = "";
|
||||||
|
mouseVisible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user