BestSolution-at / efxclipse-drift-samples

Examples demonstrating DriftFX API usage
8 stars 1 forks source link

lwjgl Demo does not run on Java-8 #1

Open tomsontom opened 4 years ago

tomsontom commented 4 years ago
tomschindl@Toms-MacBook-Pro efxclipse-drift-samples % ./gradlew -Ddriftfx.showfps=true run8

> Task :run8
Found Sample Providers: [org.eclipse.fx.drift.samples.cpp.SimpleTriangleSampleProvider@2984440c, org.eclipse.fx.drift.samples.cpp.SimpleColorSampleProvider@20a78194, org.eclipse.fx.drift.samples.lwjgl.WavefrontObjDemoProvider@3d3be374]
[J] [DEBUG] Initialize DriftFX
[J] [DEBUG] Resource Lookup: name: /native/libdriftfx.dylib, context: class org.eclipse.fx.drift.internal.DriftFX => jar:file:/Users/tomschindl/.gradle/caches/modules-2/files-2.1/org.eclipse.fx/org.eclipse.fx.drift/999.0.0-SNAPSHOT/d2f2fc80205a3de6887733e7210c56c49df65cf7/org.eclipse.fx.drift-999.0.0-SNAPSHOT.jar!/native/libdriftfx.dylib
[J] [INFO ] loading driftfx from extracted location (/var/folders/b3/31ytq_gs17v5lkw502rfx0mh0000gn/T/driftfx129900393876331354/libdriftfx.dylib)
[J] [INFO ] DriftFX 999.0.0(git sha: cf26047336b3802ac1a7587f0b92b1484eda91b7) initializing
[J] [DEBUG] [J] NativeSurface updateSurface(SurfaceData[520,000 x 260,000] (renderScale: 2,000 x 2,000, userScale: 1,000 x 1,000))
Context is 140417183760096
CAPS: false
ARB_shader_objects = true, ARB_vertex_shader = true, ARB_fragment_shader = true
java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer;
        at org.eclipse.fx.drift.samples.lwjgl.IOUtil.resizeBuffer(IOUtil.java:23)
        at org.eclipse.fx.drift.samples.lwjgl.IOUtil.ioResourceToByteBuffer(IOUtil.java:62)
        at org.eclipse.fx.drift.samples.lwjgl.ObjDemo$1.invoke(ObjDemo.java:287)
        at org.lwjgl.assimp.AIFileOpenProcI.callback(AIFileOpenProcI.java:33)
        at org.lwjgl.system.JNI.invokePPP(Native Method)
        at org.lwjgl.assimp.Assimp.naiImportFileEx(Assimp.java:2505)
        at org.lwjgl.assimp.Assimp.aiImportFileEx(Assimp.java:2552)
        at org.eclipse.fx.drift.samples.lwjgl.ObjDemo.loadModel(ObjDemo.java:327)
        at org.eclipse.fx.drift.samples.lwjgl.ObjDemo.doInit(ObjDemo.java:274)
        at org.eclipse.fx.drift.samples.lwjgl.ObjDemo.run(ObjDemo.java:494)
        at java.lang.Thread.run(Thread.java:748)

BUILD SUCCESSFUL in 36s
10 actionable tasks: 1 executed, 9 up-to-date
tomschindl@Toms-MacBook-Pro efxclipse-drift-samples % 
redrezo commented 4 years ago

seems that we somehow build the code against the java 11 runtime library - the compiled class file thinks that ByteBuffer has its own flip method - but java 8 runtime has no flip within ByteBuffer, it is inherited..