Skip to content

Commit e6f0c9d

Browse files
authored
Merge pull request #2371 from jMonkeyEngine/sgold/lwjgl336
update LWJGL from v3.3.4 to v3.3.6
2 parents d4f57c0 + 9a3366d commit e6f0c9d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

gradle/libs.versions.toml

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

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

99
[libraries]

jme3-vr/src/main/java/com/jme3/input/vr/osvr/OSVR.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import com.sun.jna.Pointer;
3434
import com.sun.jna.ptr.PointerByReference;
3535
import java.nio.FloatBuffer;
36+
import java.nio.IntBuffer;
3637
import java.util.logging.Logger;
3738

3839
/**
@@ -78,6 +79,7 @@ public class OSVR implements VRAPI {
7879
*/
7980
public static byte[] OpenGLString = { 'O', 'p', 'e', 'n', 'G', 'L', (byte)0 };
8081

82+
private final IntBuffer lastError = IntBuffer.allocate(2);
8183
private final Matrix4f[] eyeMatrix = new Matrix4f[2];
8284

8385
private PointerByReference grabRM;
@@ -180,7 +182,7 @@ public boolean initialize() {
180182
*/
181183
public void grabGLFWContext() {
182184
// get current context
183-
wglGLFW = org.lwjgl.opengl.WGL.wglGetCurrentContext();
185+
wglGLFW = org.lwjgl.opengl.WGL.wglGetCurrentContext(lastError);
184186
glfwContext = org.lwjgl.glfw.GLFW.glfwGetCurrentContext();
185187
}
186188

@@ -189,7 +191,7 @@ public void grabGLFWContext() {
189191
* @return <code>true</code> if the context is successfully shared and <code>false</code> otherwise.
190192
*/
191193
public boolean shareContext() {
192-
if( org.lwjgl.opengl.WGL.wglShareLists(wglRM, wglGLFW)) {
194+
if (org.lwjgl.opengl.WGL.wglShareLists(lastError, wglRM, wglGLFW)) {
193195
System.out.println("Context sharing success!");
194196
return true;
195197
} else {
@@ -216,7 +218,7 @@ public boolean initVRCompositor(boolean allowed) {
216218
openResults.setAutoSynch(false);
217219
retval = OsvrRenderManagerOpenGLLibrary.osvrRenderManagerOpenDisplayOpenGL(renderManager, openResults);
218220
if( retval == 0 ) {
219-
wglRM = org.lwjgl.opengl.WGL.wglGetCurrentContext();
221+
wglRM = org.lwjgl.opengl.WGL.wglGetCurrentContext(lastError);
220222
renderManagerContext = org.lwjgl.glfw.GLFW.glfwGetCurrentContext();
221223
shareContext();
222224
OsvrClientKitLibrary.osvrClientUpdate(context);
@@ -298,7 +300,6 @@ public void reset() {
298300
// may need to take current position and negate it from future values
299301
}
300302

301-
@Override
302303
public void getRenderSize(Vector2f store) {
303304
if( eyeLeftInfo == null || eyeLeftInfo.viewport.width == 0.0 ) {
304305
store.x = 1280f; store.y = 720f;
@@ -345,7 +346,6 @@ public Vector3f getPosition() {
345346
return storePos;
346347
}
347348

348-
@Override
349349
public void getPositionAndOrientation(Vector3f storePos, Quaternion storeRot) {
350350
storePos.x = (float)-hmdPose.translation.data[0];
351351
storePos.y = (float)hmdPose.translation.data[1];

0 commit comments

Comments
 (0)