mirror of
https://github.com/gwm17/glfw.git
synced 2024-11-26 20:28:49 -05:00
Added glfwIsWindow.
This commit is contained in:
parent
39fd7a5ac1
commit
29a0ca47f9
|
@ -606,7 +606,7 @@ int main( void )
|
||||||
glfwPollEvents();
|
glfwPollEvents();
|
||||||
|
|
||||||
/* Check if we are still running */
|
/* Check if we are still running */
|
||||||
running = !glfwGetKey( window, GLFW_KEY_ESC );
|
running = glfwIsWindow(window) && !glfwGetKey( window, GLFW_KEY_ESC );
|
||||||
}
|
}
|
||||||
while( running );
|
while( running );
|
||||||
|
|
||||||
|
|
|
@ -391,6 +391,7 @@ GLFWAPI void glfwGetDesktopMode(GLFWvidmode* mode);
|
||||||
GLFWAPI GLFWwindow glfwOpenWindow(int width, int height, int redbits, int greenbits, int bluebits, int alphabits, int depthbits, int stencilbits, int mode);
|
GLFWAPI GLFWwindow glfwOpenWindow(int width, int height, int redbits, int greenbits, int bluebits, int alphabits, int depthbits, int stencilbits, int mode);
|
||||||
GLFWAPI void glfwOpenWindowHint(int target, int hint);
|
GLFWAPI void glfwOpenWindowHint(int target, int hint);
|
||||||
GLFWAPI void glfwMakeWindowCurrent(GLFWwindow window);
|
GLFWAPI void glfwMakeWindowCurrent(GLFWwindow window);
|
||||||
|
GLFWAPI int glfwIsWindow(GLFWwindow window);
|
||||||
GLFWAPI void glfwCloseWindow(GLFWwindow window);
|
GLFWAPI void glfwCloseWindow(GLFWwindow window);
|
||||||
GLFWAPI void glfwSetWindowTitle(GLFWwindow, const char* title);
|
GLFWAPI void glfwSetWindowTitle(GLFWwindow, const char* title);
|
||||||
GLFWAPI void glfwGetWindowSize(GLFWwindow, int* width, int* height);
|
GLFWAPI void glfwGetWindowSize(GLFWwindow, int* width, int* height);
|
||||||
|
|
15
lib/window.c
15
lib/window.c
|
@ -565,7 +565,7 @@ GLFWAPI GLFWwindow glfwOpenWindow(int width, int height,
|
||||||
|
|
||||||
GLFWAPI void glfwMakeWindowCurrent(GLFWwindow window)
|
GLFWAPI void glfwMakeWindowCurrent(GLFWwindow window)
|
||||||
{
|
{
|
||||||
if (_glfwLibrary.currentWindow == window)
|
if (!_glfwInitialized || _glfwLibrary.currentWindow == window)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_glfwPlatformMakeWindowCurrent(window);
|
_glfwPlatformMakeWindowCurrent(window);
|
||||||
|
@ -573,6 +573,19 @@ GLFWAPI void glfwMakeWindowCurrent(GLFWwindow window)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//========================================================================
|
||||||
|
// Returns GL_TRUE if the specified window handle is an actual window
|
||||||
|
//========================================================================
|
||||||
|
|
||||||
|
GLFWAPI int glfwIsWindow(GLFWwindow window)
|
||||||
|
{
|
||||||
|
if (!_glfwInitialized)
|
||||||
|
return;
|
||||||
|
|
||||||
|
return window == _glfwLibrary.window;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//========================================================================
|
//========================================================================
|
||||||
// Set hints for opening the window
|
// Set hints for opening the window
|
||||||
//========================================================================
|
//========================================================================
|
||||||
|
|
Loading…
Reference in New Issue
Block a user