mirror of
https://github.com/gwm17/glfw.git
synced 2024-11-22 18:28:52 -05:00
Added glfwIsWindow.
This commit is contained in:
parent
39fd7a5ac1
commit
29a0ca47f9
|
@ -606,7 +606,7 @@ int main( void )
|
|||
glfwPollEvents();
|
||||
|
||||
/* Check if we are still running */
|
||||
running = !glfwGetKey( window, GLFW_KEY_ESC );
|
||||
running = glfwIsWindow(window) && !glfwGetKey( window, GLFW_KEY_ESC );
|
||||
}
|
||||
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 void glfwOpenWindowHint(int target, int hint);
|
||||
GLFWAPI void glfwMakeWindowCurrent(GLFWwindow window);
|
||||
GLFWAPI int glfwIsWindow(GLFWwindow window);
|
||||
GLFWAPI void glfwCloseWindow(GLFWwindow window);
|
||||
GLFWAPI void glfwSetWindowTitle(GLFWwindow, const char* title);
|
||||
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)
|
||||
{
|
||||
if (_glfwLibrary.currentWindow == window)
|
||||
if (!_glfwInitialized || _glfwLibrary.currentWindow == window)
|
||||
return;
|
||||
|
||||
_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
|
||||
//========================================================================
|
||||
|
|
Loading…
Reference in New Issue
Block a user