Added basic error reporting to shared code.

This commit is contained in:
Camilla Berglund
2010-09-09 21:34:42 +02:00
parent 2c091571d8
commit 922cd1011a
7 changed files with 222 additions and 16 deletions
+9
View File
@@ -42,7 +42,10 @@
GLFWAPI int glfwGetJoystickParam(int joy, int param)
{
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED);
return 0;
}
return _glfwPlatformGetJoystickParam(joy, param);
}
@@ -57,7 +60,10 @@ GLFWAPI int glfwGetJoystickPos(int joy, float* pos, int numaxes)
int i;
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED);
return 0;
}
// Clear positions
for (i = 0; i < numaxes; i++)
@@ -78,7 +84,10 @@ GLFWAPI int glfwGetJoystickButtons(int joy,
int i;
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED);
return 0;
}
// Clear button states
for (i = 0; i < numbuttons; i++)