Added CMake option for glfwInit chdir on OS X.

This commit is contained in:
Camilla Berglund
2013-01-21 16:21:59 +01:00
parent bd2abbca9f
commit 6333a5caaf
3 changed files with 16 additions and 1 deletions
+6
View File
@@ -34,6 +34,8 @@
// Change to our application bundle's resources directory, if present
//========================================================================
#if defined(_GLFW_CD_RESOURCES)
static void changeToResourcesDirectory(void)
{
char resourcesPath[MAXPATHLEN];
@@ -68,6 +70,8 @@ static void changeToResourcesDirectory(void)
chdir(resourcesPath);
}
#endif /* _GLFW_CD_RESOURCES */
//////////////////////////////////////////////////////////////////////////
////// GLFW platform API //////
@@ -90,7 +94,9 @@ int _glfwPlatformInit(void)
return GL_FALSE;
}
#if defined(_GLFW_CD_RESOURCES)
changeToResourcesDirectory();
#endif
// Save the original gamma ramp
_glfw.originalRampSize = CGDisplayGammaTableCapacity(CGMainDisplayID());
+3
View File
@@ -64,6 +64,9 @@
// Define this to 1 if glXGetProcAddressEXT is available
#cmakedefine _GLFW_HAS_GLXGETPROCADDRESSEXT
// Define this to 1 if glfwInit should change the current directory
#cmakedefine _GLFW_CD_RESOURCES
// Define this to 1 if using OpenGL as the client library
#cmakedefine _GLFW_USE_OPENGL
// Define this to 1 if using OpenGL ES 1.1 as the client library