Added macros for library initialization check.

This commit is contained in:
Camilla Berglund
2013-02-20 00:28:08 +01:00
parent ca0617be2c
commit 719b60dd2b
16 changed files with 88 additions and 434 deletions
+3 -17
View File
@@ -42,11 +42,7 @@ GLFWAPI void glfwSetGamma(GLFWmonitor* handle, float gamma)
int i, size = GLFW_GAMMA_RAMP_SIZE;
GLFWgammaramp ramp;
if (!_glfwInitialized)
{
_glfwInputError(GLFW_NOT_INITIALIZED, NULL);
return;
}
_GLFW_REQUIRE_INIT();
if (gamma <= 0.f)
{
@@ -81,13 +77,7 @@ GLFWAPI void glfwSetGamma(GLFWmonitor* handle, float gamma)
GLFWAPI void glfwGetGammaRamp(GLFWmonitor* handle, GLFWgammaramp* ramp)
{
_GLFWmonitor* monitor = (_GLFWmonitor*) handle;
if (!_glfwInitialized)
{
_glfwInputError(GLFW_NOT_INITIALIZED, NULL);
return;
}
_GLFW_REQUIRE_INIT();
_glfwPlatformGetGammaRamp(monitor, ramp);
}
@@ -95,11 +85,7 @@ GLFWAPI void glfwSetGammaRamp(GLFWmonitor* handle, const GLFWgammaramp* ramp)
{
_GLFWmonitor* monitor = (_GLFWmonitor*) handle;
if (!_glfwInitialized)
{
_glfwInputError(GLFW_NOT_INITIALIZED, NULL);
return;
}
_GLFW_REQUIRE_INIT();
if (!monitor->rampChanged)
{