Updated lwjgl3 module to use LWJGL 3.0.0b #35 which is the current stable build.

experimental
Daniel Johansson 9 years ago
parent 2a1addd2da
commit 5e8f5e6a1f
  1. 23
      jme3-desktop/src/main/java/com/jme3/system/NativeLibraryLoader.java
  2. 5
      jme3-lwjgl3/build.gradle
  3. BIN
      jme3-lwjgl3/lib/lwjgl-3.0.0b-35-natives.jar
  4. BIN
      jme3-lwjgl3/lib/lwjgl-3.0.0b-35.jar
  5. 9
      jme3-lwjgl3/src/main/java/com/jme3/audio/lwjgl/LwjglALC.java
  6. 11
      jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglContext.java

@ -144,8 +144,22 @@ public final class NativeLibraryLoader {
registerNativeLibrary("lwjgl3", Platform.Linux64, "native/linux/liblwjgl.so"); registerNativeLibrary("lwjgl3", Platform.Linux64, "native/linux/liblwjgl.so");
registerNativeLibrary("lwjgl3", Platform.MacOSX32, "native/macosx/liblwjgl.dylib"); registerNativeLibrary("lwjgl3", Platform.MacOSX32, "native/macosx/liblwjgl.dylib");
registerNativeLibrary("lwjgl3", Platform.MacOSX64, "native/macosx/liblwjgl.dylib"); registerNativeLibrary("lwjgl3", Platform.MacOSX64, "native/macosx/liblwjgl.dylib");
//registerNativeLibrary("lwjgl3", Platform.Windows32, "native/windows/jemalloc32.dll"); // These are introduced in LWJGL 3.0.0b
//registerNativeLibrary("lwjgl3", Platform.Windows64, "native/windows/jemalloc.dll"); // These are introduced in LWJGL 3.0.0b // GLFW for LWJGL 3.x
registerNativeLibrary("glfw-lwjgl3", Platform.Windows32, "native/windows/glfw32.dll");
registerNativeLibrary("glfw-lwjgl3", Platform.Windows64, "native/windows/glfw.dll");
registerNativeLibrary("glfw-lwjgl3", Platform.Linux32, "native/linux/libglfw32.so");
registerNativeLibrary("glfw-lwjgl3", Platform.Linux64, "native/linux/libglfw.dll");
registerNativeLibrary("glfw-lwjgl3", Platform.MacOSX32, "native/macosx/libglfw.dylib");
registerNativeLibrary("glfw-lwjgl3", Platform.MacOSX64, "native/macosx/libglfw.dylib");
// jemalloc for LWJGL 3.x
registerNativeLibrary("jemalloc-lwjgl3", Platform.Windows32, "native/windows/jemalloc32.dll");
registerNativeLibrary("jemalloc-lwjgl3", Platform.Windows64, "native/windows/jemalloc.dll");
registerNativeLibrary("jemalloc-lwjgl3", Platform.Linux32, "native/linux/libjemalloc32.so");
registerNativeLibrary("jemalloc-lwjgl3", Platform.Linux64, "native/linux/libjemalloc.so");
registerNativeLibrary("jemalloc-lwjgl3", Platform.MacOSX32, "native/macosx/libjemalloc.dylib");
registerNativeLibrary("jemalloc-lwjgl3", Platform.MacOSX64, "native/macosx/libjemalloc.dylib");
// OpenAL for LWJGL 3.x // OpenAL for LWJGL 3.x
// For OSX: Need to add lib prefix when extracting // For OSX: Need to add lib prefix when extracting
@ -540,14 +554,15 @@ public final class NativeLibraryLoader {
} }
} }
String pathInJar = library.getPathInNativesJar(); final String pathInJar = library.getPathInNativesJar();
if (pathInJar == null) { if (pathInJar == null) {
// This platform does not require the native library to be loaded. // This platform does not require the native library to be loaded.
return; return;
} }
String fileNameInJar; final String fileNameInJar;
if (pathInJar.contains("/")) { if (pathInJar.contains("/")) {
fileNameInJar = pathInJar.substring(pathInJar.lastIndexOf("/") + 1); fileNameInJar = pathInJar.substring(pathInJar.lastIndexOf("/") + 1);
} else { } else {

@ -11,8 +11,5 @@ repositories {
dependencies { dependencies {
compile project(':jme3-core') compile project(':jme3-core')
compile project(':jme3-desktop') compile project(':jme3-desktop')
compile 'org.lwjgl:lwjgl:3.0.0a' compile files('lib/lwjgl-3.0.0b-35.jar', 'lib/lwjgl-3.0.0b-35-natives.jar')
compile group: 'org.lwjgl', name: 'lwjgl-platform', version: '3.0.0a', classifier: 'natives-windows'
compile group: 'org.lwjgl', name: 'lwjgl-platform', version: '3.0.0a', classifier: 'natives-linux'
compile group: 'org.lwjgl', name: 'lwjgl-platform', version: '3.0.0a', classifier: 'natives-osx'
} }

@ -34,6 +34,7 @@ package com.jme3.audio.lwjgl;
import com.jme3.audio.openal.ALC; import com.jme3.audio.openal.ALC;
import org.lwjgl.openal.ALC10; import org.lwjgl.openal.ALC10;
import org.lwjgl.openal.ALContext; import org.lwjgl.openal.ALContext;
import org.lwjgl.openal.ALDevice;
import java.nio.IntBuffer; import java.nio.IntBuffer;
@ -42,16 +43,22 @@ import static org.lwjgl.openal.ALC10.alcGetCurrentContext;
public class LwjglALC implements ALC { public class LwjglALC implements ALC {
private ALDevice device;
private ALContext context; private ALContext context;
public void createALC() { public void createALC() {
context = ALContext.create(); device = ALDevice.create();
context = ALContext.create(device);
} }
public void destroyALC() { public void destroyALC() {
if (context != null) { if (context != null) {
context.destroy(); context.destroy();
} }
if (device != null) {
device.destroy();
}
} }
public boolean isCreated() { public boolean isCreated() {

@ -42,11 +42,13 @@ import com.jme3.renderer.lwjgl.LwjglGLExt;
import com.jme3.renderer.lwjgl.LwjglGLFboEXT; import com.jme3.renderer.lwjgl.LwjglGLFboEXT;
import com.jme3.renderer.lwjgl.LwjglGLFboGL3; import com.jme3.renderer.lwjgl.LwjglGLFboGL3;
import com.jme3.renderer.opengl.*; import com.jme3.renderer.opengl.*;
import com.jme3.renderer.opengl.GL;
import com.jme3.system.*; import com.jme3.system.*;
import org.lwjgl.Sys; import org.lwjgl.Sys;
import org.lwjgl.glfw.GLFW; import org.lwjgl.glfw.GLFW;
import org.lwjgl.opengl.*; import org.lwjgl.opengl.ARBDebugOutput;
import org.lwjgl.opengl.ARBFramebufferObject;
import org.lwjgl.opengl.EXTFramebufferMultisample;
import org.lwjgl.opengl.GLCapabilities;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import java.util.logging.Level; import java.util.logging.Level;
@ -111,6 +113,8 @@ public abstract class LwjglContext implements JmeContext {
NativeLibraryLoader.loadNativeLibrary("bulletjme", true); NativeLibraryLoader.loadNativeLibrary("bulletjme", true);
} }
NativeLibraryLoader.loadNativeLibrary("glfw-lwjgl3", true);
NativeLibraryLoader.loadNativeLibrary("jemalloc-lwjgl3", true);
NativeLibraryLoader.loadNativeLibrary("lwjgl3", true); NativeLibraryLoader.loadNativeLibrary("lwjgl3", true);
} }
@ -132,8 +136,7 @@ public abstract class LwjglContext implements JmeContext {
} }
protected void initContextFirstTime() { protected void initContextFirstTime() {
GLContext.createFromCurrent(); final GLCapabilities capabilities = createCapabilities(settings.getRenderer().equals(AppSettings.LWJGL_OPENGL3));
final ContextCapabilities capabilities = createCapabilities(settings.getRenderer().equals(AppSettings.LWJGL_OPENGL3));
if (!capabilities.OpenGL20) { if (!capabilities.OpenGL20) {
throw new RendererException("OpenGL 2.0 or higher is required for jMonkeyEngine"); throw new RendererException("OpenGL 2.0 or higher is required for jMonkeyEngine");

Loading…
Cancel
Save