|
|
@ -2247,11 +2247,11 @@ static bool InitGraphicsDevice(int width, int height) |
|
|
|
//glfwWindowHint(GLFW_AUX_BUFFERS, 0); // Number of auxiliar buffers |
|
|
|
|
|
|
|
// Check some Window creation flags |
|
|
|
if (configFlags & FLAG_WINDOW_RESIZABLE) glfwWindowHint(GLFW_RESIZABLE, GL_TRUE); // Resizable window |
|
|
|
else glfwWindowHint(GLFW_RESIZABLE, GL_FALSE); // Avoid window being resizable |
|
|
|
if (configFlags & FLAG_WINDOW_RESIZABLE) glfwWindowHint(GLFW_RESIZABLE, GLFW_TRUE); // Resizable window |
|
|
|
else glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE); // Avoid window being resizable |
|
|
|
|
|
|
|
if (configFlags & FLAG_WINDOW_UNDECORATED) glfwWindowHint(GLFW_DECORATED, GL_FALSE); // Border and buttons on Window |
|
|
|
else glfwWindowHint(GLFW_DECORATED, GL_TRUE); // Decorated window |
|
|
|
if (configFlags & FLAG_WINDOW_UNDECORATED) glfwWindowHint(GLFW_DECORATED, GLFW_FALSE); // Border and buttons on Window |
|
|
|
else glfwWindowHint(GLFW_DECORATED, GLFW_TRUE); // Decorated window |
|
|
|
// FLAG_WINDOW_TRANSPARENT not supported on HTML5 and not included in any released GLFW version yet |
|
|
|
#if defined(GLFW_TRANSPARENT_FRAMEBUFFER) |
|
|
|
if (configFlags & FLAG_WINDOW_TRANSPARENT) glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_TRUE); // Transparent framebuffer |
|
|
@ -2267,21 +2267,28 @@ static bool InitGraphicsDevice(int width, int height) |
|
|
|
// Check selection OpenGL version |
|
|
|
if (rlGetVersion() == OPENGL_21) |
|
|
|
{ |
|
|
|
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2); // Choose OpenGL major version (just hint) |
|
|
|
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1); // Choose OpenGL minor version (just hint) |
|
|
|
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2); // Choose OpenGL major version (just hint) |
|
|
|
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1); // Choose OpenGL minor version (just hint) |
|
|
|
} |
|
|
|
else if (rlGetVersion() == OPENGL_33) |
|
|
|
{ |
|
|
|
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); // Choose OpenGL major version (just hint) |
|
|
|
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); // Choose OpenGL minor version (just hint) |
|
|
|
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); // Choose OpenGL major version (just hint) |
|
|
|
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); // Choose OpenGL minor version (just hint) |
|
|
|
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // Profiles Hint: Only 3.3 and above! |
|
|
|
// Values: GLFW_OPENGL_CORE_PROFILE, GLFW_OPENGL_ANY_PROFILE, GLFW_OPENGL_COMPAT_PROFILE |
|
|
|
#if defined(__APPLE__) |
|
|
|
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // OSX Requires fordward compatibility |
|
|
|
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GLFW_TRUE); // OSX Requires fordward compatibility |
|
|
|
#else |
|
|
|
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_FALSE); // Fordward Compatibility Hint: Only 3.3 and above! |
|
|
|
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GLFW_FALSE); // Fordward Compatibility Hint: Only 3.3 and above! |
|
|
|
#endif |
|
|
|
//glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GL_TRUE); // Request OpenGL DEBUG context |
|
|
|
//glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GLFW_TRUE); // Request OpenGL DEBUG context |
|
|
|
} |
|
|
|
else if (rlGetVersion() == OPENGL_ES_20) // Request OpenGL ES 2.0 context |
|
|
|
{ |
|
|
|
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2); |
|
|
|
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0); |
|
|
|
glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API); |
|
|
|
glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_NATIVE_CONTEXT_API); // Alternative: GLFW_EGL_CONTEXT_API (ANGLE) |
|
|
|
} |
|
|
|
|
|
|
|
if (fullscreen) |
|
|
@ -3145,7 +3152,7 @@ static void KeyCallback(GLFWwindow *window, int key, int scancode, int action, i |
|
|
|
{ |
|
|
|
if (key == exitKey && action == GLFW_PRESS) |
|
|
|
{ |
|
|
|
glfwSetWindowShouldClose(window, GL_TRUE); |
|
|
|
glfwSetWindowShouldClose(window, GLFW_TRUE); |
|
|
|
|
|
|
|
// NOTE: Before closing window, while loop must be left! |
|
|
|
} |
|
|
|