Added confusion for code completion systems like VC++.

This commit is contained in:
Camilla Berglund
2011-02-09 12:37:42 +01:00
parent f02dbd30be
commit a66a4cd1e4
3 changed files with 46 additions and 16 deletions
+15 -5
View File
@@ -39,7 +39,7 @@
// Returns the state of the specified key for the specified window
//========================================================================
GLFWAPI int glfwGetKey(GLFWwindow window, int key)
GLFWAPI int glfwGetKey(GLFWwindow handle, int key)
{
if (!_glfwInitialized)
{
@@ -47,6 +47,8 @@ GLFWAPI int glfwGetKey(GLFWwindow window, int key)
return GLFW_RELEASE;
}
_GLFWwindow* window = (_GLFWwindow*) handle;
// Is it a valid key?
if (key < 0 || key > GLFW_KEY_LAST)
{
@@ -70,7 +72,7 @@ GLFWAPI int glfwGetKey(GLFWwindow window, int key)
// Returns the state of the specified mouse button for the specified window
//========================================================================
GLFWAPI int glfwGetMouseButton(GLFWwindow window, int button)
GLFWAPI int glfwGetMouseButton(GLFWwindow handle, int button)
{
if (!_glfwInitialized)
{
@@ -78,6 +80,8 @@ GLFWAPI int glfwGetMouseButton(GLFWwindow window, int button)
return GLFW_RELEASE;
}
_GLFWwindow* window = (_GLFWwindow*) handle;
// Is it a valid mouse button?
if (button < 0 || button > GLFW_MOUSE_BUTTON_LAST)
{
@@ -100,7 +104,7 @@ GLFWAPI int glfwGetMouseButton(GLFWwindow window, int button)
// Returns the last reported cursor position for the specified window
//========================================================================
GLFWAPI void glfwGetMousePos(GLFWwindow window, int* xpos, int* ypos)
GLFWAPI void glfwGetMousePos(GLFWwindow handle, int* xpos, int* ypos)
{
if (!_glfwInitialized)
{
@@ -108,6 +112,8 @@ GLFWAPI void glfwGetMousePos(GLFWwindow window, int* xpos, int* ypos)
return;
}
_GLFWwindow* window = (_GLFWwindow*) handle;
// Return mouse position
if (xpos != NULL)
*xpos = window->mousePosX;
@@ -122,7 +128,7 @@ GLFWAPI void glfwGetMousePos(GLFWwindow window, int* xpos, int* ypos)
// the specified window
//========================================================================
GLFWAPI void glfwSetMousePos(GLFWwindow window, int xpos, int ypos)
GLFWAPI void glfwSetMousePos(GLFWwindow handle, int xpos, int ypos)
{
if (!_glfwInitialized)
{
@@ -130,6 +136,8 @@ GLFWAPI void glfwSetMousePos(GLFWwindow window, int xpos, int ypos)
return;
}
_GLFWwindow* window = (_GLFWwindow*) handle;
// Don't do anything if the mouse position did not change
if (xpos == window->mousePosX && ypos == window->mousePosY)
return;
@@ -151,7 +159,7 @@ GLFWAPI void glfwSetMousePos(GLFWwindow window, int xpos, int ypos)
// Returns the scroll offset for the specified window
//========================================================================
GLFWAPI void glfwGetScrollOffset(GLFWwindow window, int* x, int* y)
GLFWAPI void glfwGetScrollOffset(GLFWwindow handle, int* x, int* y)
{
if (!_glfwInitialized)
{
@@ -159,6 +167,8 @@ GLFWAPI void glfwGetScrollOffset(GLFWwindow window, int* x, int* y)
return;
}
_GLFWwindow* window = (_GLFWwindow*) handle;
if (x)
*x = window->scrollX;