Skip to content

Commit

Permalink
solve issue #2011 (app crashes when using OpenGL version 3.0 and 3.1 …
Browse files Browse the repository at this point in the history
…with LWJGL 3) (#2009)

* fix system crush issue when set desktop AppSetting.setRenderer below 3.2

* Revert "fix system crush issue when set desktop AppSetting.setRenderer below 3.2"

This reverts commit 11b7c9e.

* fix system crush issue when set desktop AppSetting.setRenderer below 3.2. This fix is reedited by instruction of ali_rs

---------

Co-authored-by: ray <[email protected]>
  • Loading branch information
2 people authored and stephengold committed Jun 7, 2023
1 parent 7c86d1e commit 0b26dc2
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,16 @@ public abstract class LwjglWindow extends LwjglContext implements Runnable {

static {
RENDER_CONFIGS.put(AppSettings.LWJGL_OPENGL30, () -> {
// Based on GLFW docs for OpenGL version below 3.2,
// GLFW_OPENGL_ANY_PROFILE must be used.
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_ANY_PROFILE);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
});
RENDER_CONFIGS.put(AppSettings.LWJGL_OPENGL31, () -> {
// Based on GLFW docs for OpenGL version below 3.2,
// GLFW_OPENGL_ANY_PROFILE must be used.
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_ANY_PROFILE);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1);
});
Expand Down

0 comments on commit 0b26dc2

Please sign in to comment.