|
|
|
@ -365,14 +365,14 @@ GLFWAPI GLFWwindow glfwOpenWindow(int width, int height, |
|
|
|
|
|
|
|
|
|
GLFWAPI void glfwMakeWindowCurrent(GLFWwindow handle) |
|
|
|
|
{ |
|
|
|
|
_GLFWwindow* window = (_GLFWwindow*) handle; |
|
|
|
|
|
|
|
|
|
if (!_glfwInitialized) |
|
|
|
|
{ |
|
|
|
|
_glfwSetError(GLFW_NOT_INITIALIZED, NULL); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_GLFWwindow* window = (_GLFWwindow*) handle; |
|
|
|
|
|
|
|
|
|
if (_glfwLibrary.currentWindow == window) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
@ -388,6 +388,7 @@ GLFWAPI void glfwMakeWindowCurrent(GLFWwindow handle) |
|
|
|
|
GLFWAPI int glfwIsWindow(GLFWwindow handle) |
|
|
|
|
{ |
|
|
|
|
_GLFWwindow* entry; |
|
|
|
|
_GLFWwindow* window = (_GLFWwindow*) handle; |
|
|
|
|
|
|
|
|
|
if (!_glfwInitialized) |
|
|
|
|
{ |
|
|
|
@ -395,8 +396,6 @@ GLFWAPI int glfwIsWindow(GLFWwindow handle) |
|
|
|
|
return GL_FALSE; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_GLFWwindow* window = (_GLFWwindow*) handle; |
|
|
|
|
|
|
|
|
|
if (window == NULL) |
|
|
|
|
return GL_FALSE; |
|
|
|
|
|
|
|
|
@ -515,14 +514,14 @@ GLFWAPI void glfwOpenWindowHint(int target, int hint) |
|
|
|
|
|
|
|
|
|
GLFWAPI void glfwCloseWindow(GLFWwindow handle) |
|
|
|
|
{ |
|
|
|
|
_GLFWwindow* window = (_GLFWwindow*) handle; |
|
|
|
|
|
|
|
|
|
if (!_glfwInitialized) |
|
|
|
|
{ |
|
|
|
|
_glfwSetError(GLFW_NOT_INITIALIZED, NULL); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_GLFWwindow* window = (_GLFWwindow*) handle; |
|
|
|
|
|
|
|
|
|
// Allow closing of NULL (to match the behavior of free)
|
|
|
|
|
if (window == NULL) |
|
|
|
|
return; |
|
|
|
@ -561,14 +560,14 @@ GLFWAPI void glfwCloseWindow(GLFWwindow handle) |
|
|
|
|
|
|
|
|
|
GLFWAPI void glfwSetWindowTitle(GLFWwindow handle, const char* title) |
|
|
|
|
{ |
|
|
|
|
_GLFWwindow* window = (_GLFWwindow*) handle; |
|
|
|
|
|
|
|
|
|
if (!_glfwInitialized) |
|
|
|
|
{ |
|
|
|
|
_glfwSetError(GLFW_NOT_INITIALIZED, NULL); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_GLFWwindow* window = (_GLFWwindow*) handle; |
|
|
|
|
|
|
|
|
|
_glfwPlatformSetWindowTitle(window, title); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -579,14 +578,14 @@ GLFWAPI void glfwSetWindowTitle(GLFWwindow handle, const char* title) |
|
|
|
|
|
|
|
|
|
GLFWAPI void glfwGetWindowSize(GLFWwindow handle, int* width, int* height) |
|
|
|
|
{ |
|
|
|
|
_GLFWwindow* window = (_GLFWwindow*) handle; |
|
|
|
|
|
|
|
|
|
if (!_glfwInitialized) |
|
|
|
|
{ |
|
|
|
|
_glfwSetError(GLFW_NOT_INITIALIZED, NULL); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_GLFWwindow* window = (_GLFWwindow*) handle; |
|
|
|
|
|
|
|
|
|
if (width != NULL) |
|
|
|
|
*width = window->width; |
|
|
|
|
|
|
|
|
@ -601,14 +600,14 @@ GLFWAPI void glfwGetWindowSize(GLFWwindow handle, int* width, int* height) |
|
|
|
|
|
|
|
|
|
GLFWAPI void glfwSetWindowSize(GLFWwindow handle, int width, int height) |
|
|
|
|
{ |
|
|
|
|
_GLFWwindow* window = (_GLFWwindow*) handle; |
|
|
|
|
|
|
|
|
|
if (!_glfwInitialized) |
|
|
|
|
{ |
|
|
|
|
_glfwSetError(GLFW_NOT_INITIALIZED, NULL); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_GLFWwindow* window = (_GLFWwindow*) handle; |
|
|
|
|
|
|
|
|
|
if (window->iconified) |
|
|
|
|
{ |
|
|
|
|
// TODO: Figure out if this is an error
|
|
|
|
@ -636,14 +635,14 @@ GLFWAPI void glfwSetWindowSize(GLFWwindow handle, int width, int height) |
|
|
|
|
|
|
|
|
|
GLFWAPI void glfwGetWindowPos(GLFWwindow handle, int* xpos, int* ypos) |
|
|
|
|
{ |
|
|
|
|
_GLFWwindow* window = (_GLFWwindow*) handle; |
|
|
|
|
|
|
|
|
|
if (!_glfwInitialized) |
|
|
|
|
{ |
|
|
|
|
_glfwSetError(GLFW_NOT_INITIALIZED, NULL); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_GLFWwindow* window = (_GLFWwindow*) handle; |
|
|
|
|
|
|
|
|
|
if (xpos != NULL) |
|
|
|
|
*xpos = window->positionX; |
|
|
|
|
|
|
|
|
@ -658,14 +657,14 @@ GLFWAPI void glfwGetWindowPos(GLFWwindow handle, int* xpos, int* ypos) |
|
|
|
|
|
|
|
|
|
GLFWAPI void glfwSetWindowPos(GLFWwindow handle, int xpos, int ypos) |
|
|
|
|
{ |
|
|
|
|
_GLFWwindow* window = (_GLFWwindow*) handle; |
|
|
|
|
|
|
|
|
|
if (!_glfwInitialized) |
|
|
|
|
{ |
|
|
|
|
_glfwSetError(GLFW_NOT_INITIALIZED, NULL); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_GLFWwindow* window = (_GLFWwindow*) handle; |
|
|
|
|
|
|
|
|
|
if (window->mode == GLFW_FULLSCREEN || window->iconified) |
|
|
|
|
{ |
|
|
|
|
// TODO: Figure out if this is an error
|
|
|
|
@ -682,14 +681,14 @@ GLFWAPI void glfwSetWindowPos(GLFWwindow handle, int xpos, int ypos) |
|
|
|
|
|
|
|
|
|
GLFWAPI void glfwIconifyWindow(GLFWwindow handle) |
|
|
|
|
{ |
|
|
|
|
_GLFWwindow* window = (_GLFWwindow*) handle; |
|
|
|
|
|
|
|
|
|
if (!_glfwInitialized) |
|
|
|
|
{ |
|
|
|
|
_glfwSetError(GLFW_NOT_INITIALIZED, NULL); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_GLFWwindow* window = (_GLFWwindow*) handle; |
|
|
|
|
|
|
|
|
|
if (window->iconified) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
@ -703,14 +702,14 @@ GLFWAPI void glfwIconifyWindow(GLFWwindow handle) |
|
|
|
|
|
|
|
|
|
GLFWAPI void glfwRestoreWindow(GLFWwindow handle) |
|
|
|
|
{ |
|
|
|
|
_GLFWwindow* window = (_GLFWwindow*) handle; |
|
|
|
|
|
|
|
|
|
if (!_glfwInitialized) |
|
|
|
|
{ |
|
|
|
|
_glfwSetError(GLFW_NOT_INITIALIZED, NULL); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_GLFWwindow* window = (_GLFWwindow*) handle; |
|
|
|
|
|
|
|
|
|
if (!window->iconified) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
@ -728,14 +727,14 @@ GLFWAPI void glfwRestoreWindow(GLFWwindow handle) |
|
|
|
|
|
|
|
|
|
GLFWAPI int glfwGetWindowParam(GLFWwindow handle, int param) |
|
|
|
|
{ |
|
|
|
|
_GLFWwindow* window = (_GLFWwindow*) handle; |
|
|
|
|
|
|
|
|
|
if (!_glfwInitialized) |
|
|
|
|
{ |
|
|
|
|
_glfwSetError(GLFW_NOT_INITIALIZED, NULL); |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_GLFWwindow* window = (_GLFWwindow*) handle; |
|
|
|
|
|
|
|
|
|
switch (param) |
|
|
|
|
{ |
|
|
|
|
case GLFW_ACTIVE: |
|
|
|
@ -799,14 +798,14 @@ GLFWAPI int glfwGetWindowParam(GLFWwindow handle, int param) |
|
|
|
|
|
|
|
|
|
GLFWAPI void glfwSetWindowUserPointer(GLFWwindow handle, void* pointer) |
|
|
|
|
{ |
|
|
|
|
_GLFWwindow* window = (_GLFWwindow*) handle; |
|
|
|
|
|
|
|
|
|
if (!_glfwInitialized) |
|
|
|
|
{ |
|
|
|
|
_glfwSetError(GLFW_NOT_INITIALIZED, NULL); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_GLFWwindow* window = (_GLFWwindow*) handle; |
|
|
|
|
|
|
|
|
|
window->userPointer = pointer; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -817,14 +816,14 @@ GLFWAPI void glfwSetWindowUserPointer(GLFWwindow handle, void* pointer) |
|
|
|
|
|
|
|
|
|
GLFWAPI void* glfwGetWindowUserPointer(GLFWwindow handle) |
|
|
|
|
{ |
|
|
|
|
_GLFWwindow* window = (_GLFWwindow*) handle; |
|
|
|
|
|
|
|
|
|
if (!_glfwInitialized) |
|
|
|
|
{ |
|
|
|
|
_glfwSetError(GLFW_NOT_INITIALIZED, NULL); |
|
|
|
|
return NULL; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_GLFWwindow* window = (_GLFWwindow*) handle; |
|
|
|
|
|
|
|
|
|
return window->userPointer; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|