mirror of
https://github.com/glfw/glfw.git
synced 2026-09-21 00:30:57 +00:00
Added CMake option for glfwInit chdir on OS X.
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user