mirror of https://github.com/axmolengine/axmol.git
Optimize param use.
This commit is contained in:
parent
a624babd09
commit
99432aa171
|
@ -681,13 +681,14 @@ void GLViewImpl::setFullscreen(int monitorIndex, int w, int h, int refreshRate)
|
|||
void GLViewImpl::setFullscreen(GLFWmonitor *monitor, int w, int h, int refreshRate) {
|
||||
_monitor = monitor;
|
||||
|
||||
if (w == -1 || h == -1 || refreshRate == -1)
|
||||
{
|
||||
const GLFWvidmode* videoMode = glfwGetVideoMode(_monitor);
|
||||
|
||||
if (w == -1)
|
||||
w = videoMode->width;
|
||||
if (h == -1)
|
||||
h = videoMode->height;
|
||||
if (refreshRate == -1)
|
||||
refreshRate = videoMode->refreshRate;
|
||||
}
|
||||
|
||||
glfwSetWindowMonitor(_mainWindow, _monitor, 0, 0, w, h, refreshRate);
|
||||
|
||||
|
|
|
@ -94,9 +94,9 @@ public:
|
|||
/// Sets monitor full screen with w*h(refresh rate)
|
||||
/// </summary>
|
||||
/// <param name="monitorIndex">the 0 based index of monitor</param>
|
||||
/// <param name="w">the width of hardware resolution in full screen</param>
|
||||
/// <param name="h">the height of hardware resolution in full screen</param>
|
||||
/// <param name="refreshRate">the display refresh rate, usually 60</param>
|
||||
/// <param name="w">the width of hardware resolution in full screen, -1 use default value</param>
|
||||
/// <param name="h">the height of hardware resolution in full screen, -1 use default value</param>
|
||||
/// <param name="refreshRate">the display refresh rate, usually 60, -1 use default value</param>
|
||||
void setFullscreen(int monitorIndex, int w, int h, int refreshRate);
|
||||
|
||||
/* for internal use */
|
||||
|
|
Loading…
Reference in New Issue