check isFullscreen

This commit is contained in:
halx99 2020-08-02 16:22:41 +08:00
parent dd226789b3
commit 6a133fa1e5
1 changed files with 3 additions and 2 deletions

View File

@ -650,9 +650,8 @@ void GLViewImpl::setFullscreen()
}
void GLViewImpl::setFullscreen(int w, int h, int refreshRate) {
if (this->isFullscreen()) {
if (this->isFullscreen())
return;
}
_monitor = glfwGetPrimaryMonitor();
if (nullptr == _monitor) {
return;
@ -667,6 +666,8 @@ void GLViewImpl::setFullscreen(int monitorIndex)
}
void GLViewImpl::setFullscreen(int monitorIndex, int w, int h, int refreshRate) {
if (this->isFullscreen())
return;
int count = 0;
GLFWmonitor** monitors = glfwGetMonitors(&count);
if (monitorIndex < 0 || monitorIndex >= count) {