Skip to content

Commit c3c5af1

Browse files
committed
Fix resource loading on Windows
1 parent 61f4317 commit c3c5af1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/org/lwjgl/demo/opengl/assimp/WavefrontObjDemo.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@
77
import org.lwjgl.PointerBuffer;
88
import org.lwjgl.assimp.*;
99
import org.lwjgl.glfw.*;
10-
import org.lwjgl.opengl.ARBShaderObjects;
11-
import org.lwjgl.opengl.ARBVertexShader;
1210
import org.lwjgl.opengl.GL;
1311
import org.lwjgl.opengl.GLCapabilities;
1412
import org.lwjgl.opengl.GLUtil;
1513
import org.lwjgl.system.Callback;
1614

15+
import java.io.File;
1716
import java.io.IOException;
1817
import java.nio.ByteBuffer;
1918
import java.nio.FloatBuffer;
@@ -186,10 +185,11 @@ public void invoke(long window, double xoffset, double yoffset) {
186185
}
187186

188187
void loadModel() {
189-
String file = Thread.currentThread().getContextClassLoader()
188+
String fileName = Thread.currentThread().getContextClassLoader()
190189
.getResource("org/lwjgl/demo/opengl/assimp/magnet.obj").getFile();
190+
File file = new File(fileName);
191191
// Assimp will be able to find the corresponding mtl file if we call aiImportFile this way.
192-
AIScene scene = aiImportFile(file, aiProcess_JoinIdenticalVertices | aiProcess_Triangulate);
192+
AIScene scene = aiImportFile(file.getAbsolutePath(), aiProcess_JoinIdenticalVertices | aiProcess_Triangulate);
193193
if (scene == null) {
194194
throw new IllegalStateException(aiGetErrorString());
195195
}

0 commit comments

Comments
 (0)