Skip to content

Commit

Permalink
fix system crush issue when set desktop AppSetting.setRenderer below 3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
aspenyoung committed May 15, 2023
1 parent 145d043 commit 11b7c9e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,16 @@ public void invoke(int error, long description) {

final String renderer = settings.getRenderer();

glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GLFW_TRUE);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
//Appsettings GL version below 3.2
if ((!RENDER_CONFIGS. containsKey (renderer))|| //OPENGL20
renderer.equals (AppSettings.LWJGL_OPENGL30)||renderer.equals (AppSettings.LWJGL_OPENGL31)
) {
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GLFW_TRUE);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_ANY_PROFILE);
}else {
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GLFW_TRUE);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
}

RENDER_CONFIGS.computeIfAbsent(renderer, s -> () -> {
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GLFW_FALSE);
Expand Down

0 comments on commit 11b7c9e

Please sign in to comment.