Skip to content

Commit 165969f

Browse files
committed
Squashed commit of the following:
commit b3c946c Author: Ryan McDonough <peanut64646@gmail.com> Date: Sun Jan 18 21:18:38 2026 -0500 Change int to long in LwjglPlatform.java commit d311b8d Author: Ryan McDonough <peanut64646@gmail.com> Date: Sun Jan 18 21:13:44 2026 -0500 Replace switch with if statements commit 4b30bee Author: Ryan McDonough <peanut64646@gmail.com> Date: Sun Jan 18 20:57:09 2026 -0500 Change int to long for LWJGL 3.4.0 compatibility commit 128d179 Author: Ryan McDonough <peanut64646@gmail.com> Date: Sun Jan 18 20:48:12 2026 -0500 Remove OpenVR References from BulletDebugAppState.java commit ba331a8 Author: Ryan McDonough <peanut64646@gmail.com> Date: Sun Jan 18 20:13:06 2026 -0500 Delete jme3-vr directory commit a0c5063 Author: Ryan McDonough <peanut64646@gmail.com> Date: Sun Jan 18 15:38:45 2026 -0500 Remove OpenVr commit b61d9e6 Author: Ryan McDonough <peanut64646@gmail.com> Date: Sun Jan 18 14:56:37 2026 -0500 LWJGL 3.4.0 and Remove OpenVR @stephengold notified me that LWJGL 3.4 has been released and has also done some testing in their non jME projects with this new version already. (big thanks for keeping a tab on this area) I still have most of my own jME projects running lwjgl2 ('ve been procrastinating upgrading to LWJGL3 for quite a while now, long overdue), so I will finally do so in my own projects so I can help test as well. OpenVR is also no longer supported in LWJGL 3.4.0 so it appears it needed removed, but (unless I'm mistaken) this should not be an issue since the Tamarin VR library is using the newer openXR, and openVR is considered outdated and deprecated. Any jME apps still relying on openVR can still use v3.9 or earlier without issue (@richardTingle correct me if I'm incorrect on any of this) commit 77fdf95 Author: Wyatt Gillette <jefferydeaver2010@gmail.com> Date: Sat Jan 17 11:22:46 2026 +0100 Remove GL_FRAMEBUFFER_SRGB_CAPABLE_EXT check to fix error 1280 (invalid enum) in some platforms (jMonkeyEngine#2461) commit 0a84a08 Author: Riccardo Balbo <riccardo0blb@gmail.com> Date: Sat Jan 17 11:21:04 2026 +0100 make tempvars closeable (jMonkeyEngine#2580)
1 parent 3401e1b commit 165969f

238 files changed

Lines changed: 31 additions & 25052 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

gradle/libs.versions.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[versions]
44

55
checkstyle = "9.3"
6-
lwjgl3 = "3.3.6"
6+
lwjgl3 = "3.4.0"
77
nifty = "1.4.3"
88

99
[libraries]
@@ -32,8 +32,6 @@ lwjgl3-jemalloc = { module = "org.lwjgl:lwjgl-jemalloc", version.ref = "lwjgl3"
3232
lwjgl3-openal = { module = "org.lwjgl:lwjgl-openal", version.ref = "lwjgl3" }
3333
lwjgl3-opencl = { module = "org.lwjgl:lwjgl-opencl", version.ref = "lwjgl3" }
3434
lwjgl3-opengl = { module = "org.lwjgl:lwjgl-opengl", version.ref = "lwjgl3" }
35-
lwjgl3-openvr = { module = "org.lwjgl:lwjgl-openvr", version.ref = "lwjgl3" }
36-
lwjgl3-ovr = { module = "org.lwjgl:lwjgl-ovr", version.ref = "lwjgl3" }
3735

3836
mokito-core = "org.mockito:mockito-core:3.12.4"
3937

jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009-2024 jMonkeyEngine
2+
* Copyright (c) 2009-2026 jMonkeyEngine
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without
@@ -3492,19 +3492,11 @@ public void setMainFrameBufferSrgb(boolean enableSrgb) {
34923492
setFrameBuffer(null);
34933493

34943494
if (enableSrgb) {
3495-
if (
3496-
// Workaround: getBoolean(GLExt.GL_FRAMEBUFFER_SRGB_CAPABLE_EXT) causes error 1280 (invalid enum) on macos
3497-
JmeSystem.getPlatform().getOs() != Platform.Os.MacOS
3498-
&& !getBoolean(GLExt.GL_FRAMEBUFFER_SRGB_CAPABLE_EXT)
3499-
) {
3500-
logger.warning("Driver claims that default framebuffer " + "is not sRGB capable. Enabling anyway.");
3501-
}
3502-
35033495
gl.glEnable(GLExt.GL_FRAMEBUFFER_SRGB_EXT);
3504-
3505-
logger.log(Level.FINER, "SRGB FrameBuffer enabled (Gamma Correction)");
3496+
logger.log(Level.FINER, "sRGB FrameBuffer enabled (Gamma Correction)");
35063497
} else {
35073498
gl.glDisable(GLExt.GL_FRAMEBUFFER_SRGB_EXT);
3499+
logger.log(Level.FINER, "sRGB FrameBuffer disabled (Gamma Correction)");
35083500
}
35093501
}
35103502

jme3-core/src/main/java/com/jme3/util/TempVars.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import com.jme3.collision.bih.BIHNode.BIHStackData;
3737
import com.jme3.math.*;
3838
import com.jme3.scene.Spatial;
39+
import java.io.Closeable;
3940
import java.nio.FloatBuffer;
4041
import java.nio.IntBuffer;
4142
import java.util.ArrayList;
@@ -47,7 +48,7 @@
4748
* This returns an available instance of the TempVar class ensuring this
4849
* particular instance is never used elsewhere in the meantime.
4950
*/
50-
public class TempVars {
51+
public class TempVars implements Closeable{
5152

5253
/**
5354
* Allow X instances of TempVars in a single thread.
@@ -226,4 +227,9 @@ public void release() {
226227
public final CollisionResults collisionResults = new CollisionResults();
227228
public final float[] bihSwapTmp = new float[9];
228229
public final ArrayList<BIHStackData> bihStack = new ArrayList<>();
230+
231+
@Override
232+
public void close(){
233+
release();
234+
}
229235
}

jme3-jbullet/src/main/java/com/jme3/bullet/debug/BulletDebugAppState.java

Lines changed: 8 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
package com.jme3.bullet.debug;
3333

3434
import com.jme3.app.Application;
35-
import com.jme3.app.VRAppState;
3635
import com.jme3.app.state.AbstractAppState;
3736
import com.jme3.app.state.AppStateManager;
3837
import com.jme3.asset.AssetManager;
@@ -173,17 +172,11 @@ public void initialize(AppStateManager stateManager, Application app) {
173172
setupMaterials(app);
174173
physicsDebugRootNode.setCullHint(Spatial.CullHint.Never);
175174

176-
if (isVr()) {
177-
/* This is a less good solution than the non-vr version (as the debug shapes can be obscured by the regular
178-
* geometry), however it is the best possible as VR does not currently support multiple viewports per eye */
179-
VRAppState vrAppState = stateManager.getState(VRAppState.ID, VRAppState.class);
180-
vrAppState.getLeftViewPort().attachScene(physicsDebugRootNode);
181-
vrAppState.getRightViewPort().attachScene(physicsDebugRootNode);
182-
} else {
183-
viewPort = rm.createMainView("Physics Debug Overlay", app.getCamera());
184-
viewPort.setClearFlags(false, true, false);
185-
viewPort.attachScene(physicsDebugRootNode);
186-
}
175+
176+
viewPort = rm.createMainView("Physics Debug Overlay", app.getCamera());
177+
viewPort.setClearFlags(false, true, false);
178+
viewPort.attachScene(physicsDebugRootNode);
179+
187180
}
188181

189182
/**
@@ -193,15 +186,8 @@ public void initialize(AppStateManager stateManager, Application app) {
193186
* is invoked.
194187
*/
195188
@Override
196-
public void cleanup() {
197-
if (isVr()) {
198-
VRAppState vrAppState = app.getStateManager().getState(VRAppState.ID, VRAppState.class);
199-
vrAppState.getLeftViewPort().detachScene(physicsDebugRootNode);
200-
vrAppState.getRightViewPort().detachScene(physicsDebugRootNode);
201-
} else {
202-
rm.removeMainView(viewPort);
203-
}
204-
189+
public void cleanup() {
190+
rm.removeMainView(viewPort);
205191
super.cleanup();
206192
}
207193

@@ -436,17 +422,4 @@ public static interface DebugAppStateFilter {
436422
*/
437423
public boolean displayObject(Object obj);
438424
}
439-
440-
private boolean isVr() {
441-
if (isVr == null) {
442-
try {
443-
VRAppState vrAppState = app.getStateManager().getState(VRAppState.ID, VRAppState.class);
444-
isVr = vrAppState != null && !vrAppState.DISABLE_VR;
445-
} catch (NoClassDefFoundError e) {
446-
//Vr isn't even on the classpath
447-
isVr = false;
448-
}
449-
}
450-
return isVr;
451-
}
452-
}
425+
}

jme3-lwjgl3/src/main/java/com/jme3/opencl/lwjgl/LwjglDevice.java

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,19 @@ public long getDevice() {
6161
public LwjglPlatform getPlatform() {
6262
return platform;
6363
}
64-
64+
6565
@Override
6666
public DeviceType getDeviceType() {
67-
int type = Info.clGetDeviceInfoInt(device, CL10.CL_DEVICE_TYPE);
68-
switch (type) {
69-
case CL10.CL_DEVICE_TYPE_ACCELERATOR: return DeviceType.ACCELEARTOR;
70-
case CL10.CL_DEVICE_TYPE_CPU: return DeviceType.CPU;
71-
case CL10.CL_DEVICE_TYPE_GPU: return DeviceType.GPU;
72-
default: return DeviceType.DEFAULT;
67+
long type = Info.clGetDeviceInfoInt(device, CL10.CL_DEVICE_TYPE);
68+
69+
if ((type & CL10.CL_DEVICE_TYPE_GPU) != 0) {
70+
return DeviceType.GPU;
71+
} else if ((type & CL10.CL_DEVICE_TYPE_CPU) != 0) {
72+
return DeviceType.CPU;
73+
} else if ((type & CL10.CL_DEVICE_TYPE_ACCELERATOR) != 0) {
74+
return DeviceType.ACCELEARTOR;
75+
} else {
76+
return DeviceType.DEFAULT;
7377
}
7478
}
7579

jme3-lwjgl3/src/main/java/com/jme3/opencl/lwjgl/LwjglPlatform.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public List<LwjglDevice> getDevices() {
7878
* @param deviceType the device type
7979
* @return the available devices
8080
*/
81-
private long[] getDevices(int deviceType) {
81+
private long[] getDevices(long deviceType) {
8282
int[] count = new int[1];
8383
int errcode = CL10.clGetDeviceIDs(platform, deviceType, null, count);
8484
if (errcode == CL10.CL_DEVICE_NOT_FOUND) {

jme3-vr/build.gradle

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)