Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/desktop/backends/glfw2.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,28 @@ bool platformInit(int32_t reqW, int32_t reqH, const char *title, bool headless)
return false;
}

#ifdef GLFW_OPENGL_VERSION_MAJOR
if (gfx == SOFTWARE) {
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 1);
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 0);
} else if (gfx == LEGACY_GL) {
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 1);
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 1);
} else {
#ifdef ENABLE_GLES
glfwOpenWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API);
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3);
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 0);
#else
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3);
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 2);
glfwOpenWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
glfwOpenWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwOpenWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GL_TRUE);
#endif
}
#endif

// Init GLFW
if (!glfwInit()) {
fprintf(stderr, "Failed to initialize GLFW\n");
Expand Down
Loading