mirror of
https://github.com/glfw/glfw.git
synced 2026-09-18 22:55:46 +00:00
Merge branch 'master' into showwindow
This commit is contained in:
+18
-26
@@ -296,9 +296,6 @@ static int convertMacKeyCode(unsigned int macKeyCode)
|
||||
if (macKeyCode >= 128)
|
||||
return -1;
|
||||
|
||||
// This treats keycodes as *positional*; that is, we'll return 'a'
|
||||
// for the key left of 's', even on an AZERTY keyboard. The charInput
|
||||
// function should still get 'q' though.
|
||||
return table[macKeyCode];
|
||||
}
|
||||
|
||||
@@ -560,7 +557,7 @@ static NSString* findAppName(void)
|
||||
}
|
||||
}
|
||||
|
||||
// If we get here, we're unbundled
|
||||
// If we get here, the application is unbundled
|
||||
ProcessSerialNumber psn = { 0, kCurrentProcess };
|
||||
TransformProcessType(&psn, kProcessTransformToForegroundApplication);
|
||||
|
||||
@@ -570,10 +567,7 @@ static NSString* findAppName(void)
|
||||
|
||||
char** progname = _NSGetProgname();
|
||||
if (progname && *progname)
|
||||
{
|
||||
// TODO: UTF-8?
|
||||
return [NSString stringWithUTF8String:*progname];
|
||||
}
|
||||
|
||||
// Really shouldn't get here
|
||||
return @"GLFW Application";
|
||||
@@ -699,8 +693,7 @@ static GLboolean createWindow(_GLFWwindow* window,
|
||||
|
||||
if (window->NS.object == nil)
|
||||
{
|
||||
_glfwSetError(GLFW_PLATFORM_ERROR,
|
||||
"Cocoa/NSOpenGL: Failed to create window");
|
||||
_glfwSetError(GLFW_PLATFORM_ERROR, "Cocoa: Failed to create window");
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
@@ -742,8 +735,8 @@ static GLboolean createContext(_GLFWwindow* window,
|
||||
(wndconfig->glMajor == 3 && wndconfig->glMinor != 2))
|
||||
{
|
||||
_glfwSetError(GLFW_VERSION_UNAVAILABLE,
|
||||
"Cocoa/NSOpenGL: The targeted version of Mac OS X does "
|
||||
"not support any OpenGL version above 2.1 except 3.2");
|
||||
"NSOpenGL: The targeted version of Mac OS X does not "
|
||||
"support any OpenGL version above 2.1 except 3.2");
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
@@ -752,8 +745,8 @@ static GLboolean createContext(_GLFWwindow* window,
|
||||
if (!wndconfig->glForward)
|
||||
{
|
||||
_glfwSetError(GLFW_VERSION_UNAVAILABLE,
|
||||
"Cocoa/NSOpenGL: The targeted version of Mac OS X "
|
||||
"only supports OpenGL 3.2 contexts if they are "
|
||||
"NSOpenGL: The targeted version of Mac OS X only "
|
||||
"supports OpenGL 3.2 contexts if they are "
|
||||
"forward-compatible");
|
||||
return GL_FALSE;
|
||||
}
|
||||
@@ -761,8 +754,8 @@ static GLboolean createContext(_GLFWwindow* window,
|
||||
if (wndconfig->glProfile != GLFW_OPENGL_CORE_PROFILE)
|
||||
{
|
||||
_glfwSetError(GLFW_VERSION_UNAVAILABLE,
|
||||
"Cocoa/NSOpenGL: The targeted version of Mac OS X "
|
||||
"only supports OpenGL 3.2 contexts if they use the "
|
||||
"NSOpenGL: The targeted version of Mac OS X only "
|
||||
"supports OpenGL 3.2 contexts if they use the "
|
||||
"core profile");
|
||||
return GL_FALSE;
|
||||
}
|
||||
@@ -772,8 +765,8 @@ static GLboolean createContext(_GLFWwindow* window,
|
||||
if (wndconfig->glMajor > 2)
|
||||
{
|
||||
_glfwSetError(GLFW_VERSION_UNAVAILABLE,
|
||||
"Cocoa/NSOpenGL: The targeted version of Mac OS X does "
|
||||
"not support OpenGL version 3.0 or above");
|
||||
"NSOpenGL: The targeted version of Mac OS X does not "
|
||||
"support OpenGL version 3.0 or above");
|
||||
return GL_FALSE;
|
||||
}
|
||||
#endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/
|
||||
@@ -782,8 +775,8 @@ static GLboolean createContext(_GLFWwindow* window,
|
||||
if (wndconfig->glRobustness)
|
||||
{
|
||||
_glfwSetError(GLFW_VERSION_UNAVAILABLE,
|
||||
"Cocoa/NSOpenGL: Mac OS X does not support OpenGL "
|
||||
"robustness strategies");
|
||||
"NSOpenGL: Mac OS X does not support OpenGL robustness "
|
||||
"strategies");
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
@@ -846,7 +839,7 @@ static GLboolean createContext(_GLFWwindow* window,
|
||||
if (window->NSGL.pixelFormat == nil)
|
||||
{
|
||||
_glfwSetError(GLFW_PLATFORM_ERROR,
|
||||
"Cocoa/NSOpenGL: Failed to create OpenGL pixel format");
|
||||
"NSOpenGL: Failed to create OpenGL pixel format");
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
@@ -861,7 +854,7 @@ static GLboolean createContext(_GLFWwindow* window,
|
||||
if (window->NSGL.context == nil)
|
||||
{
|
||||
_glfwSetError(GLFW_PLATFORM_ERROR,
|
||||
"Cocoa/NSOpenGL: Failed to create OpenGL context");
|
||||
"NSOpenGL: Failed to create OpenGL context");
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
@@ -885,16 +878,15 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
||||
if (!initializeAppKit())
|
||||
return GL_FALSE;
|
||||
|
||||
// We can only have one application delegate, but we only allocate it the
|
||||
// first time we create a window to keep all window code in this file
|
||||
// There can only be one application delegate, but we allocate it the
|
||||
// first time a window is created to keep all window code in this file
|
||||
if (_glfwLibrary.NS.delegate == nil)
|
||||
{
|
||||
_glfwLibrary.NS.delegate = [[GLFWApplicationDelegate alloc] init];
|
||||
if (_glfwLibrary.NS.delegate == nil)
|
||||
{
|
||||
_glfwSetError(GLFW_PLATFORM_ERROR,
|
||||
"Cocoa/NSOpenGL: Failed to create application "
|
||||
"delegate");
|
||||
"Cocoa: Failed to create application delegate");
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
@@ -905,7 +897,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
||||
if (window->NS.delegate == nil)
|
||||
{
|
||||
_glfwSetError(GLFW_PLATFORM_ERROR,
|
||||
"Cocoa/NSOpenGL: Failed to create window delegate");
|
||||
"Cocoa: Failed to create window delegate");
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user