mirror of https://github.com/axmolengine/axmol.git
Adapte multi monitors
This commit is contained in:
parent
f396ba9983
commit
6fd4d6e4ab
|
@ -649,13 +649,11 @@ void GLViewImpl::setFullscreen()
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLViewImpl::setFullscreen(int w, int h, int refreshRate) {
|
void GLViewImpl::setFullscreen(int w, int h, int refreshRate) {
|
||||||
if (this->isFullscreen())
|
auto monitor = glfwGetPrimaryMonitor();
|
||||||
return;
|
if (nullptr == monitor || monitor == _monitor) {
|
||||||
_monitor = glfwGetPrimaryMonitor();
|
|
||||||
if (nullptr == _monitor) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this->setFullscreen(_monitor, w, h, refreshRate);
|
this->setFullscreen(monitor, w, h, refreshRate);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLViewImpl::setFullscreen(int monitorIndex)
|
void GLViewImpl::setFullscreen(int monitorIndex)
|
||||||
|
@ -664,15 +662,13 @@ void GLViewImpl::setFullscreen(int monitorIndex)
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLViewImpl::setFullscreen(int monitorIndex, int w, int h, int refreshRate) {
|
void GLViewImpl::setFullscreen(int monitorIndex, int w, int h, int refreshRate) {
|
||||||
if (this->isFullscreen())
|
|
||||||
return;
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
GLFWmonitor** monitors = glfwGetMonitors(&count);
|
GLFWmonitor** monitors = glfwGetMonitors(&count);
|
||||||
if (monitorIndex < 0 || monitorIndex >= count) {
|
if (monitorIndex < 0 || monitorIndex >= count) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
GLFWmonitor* monitor = monitors[monitorIndex];
|
GLFWmonitor* monitor = monitors[monitorIndex];
|
||||||
if (nullptr == monitor) {
|
if (nullptr == monitor || _monitor == monitor) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this->setFullscreen(monitor, w, h, refreshRate);
|
this->setFullscreen(monitor, w, h, refreshRate);
|
||||||
|
|
Loading…
Reference in New Issue