Consolidate all resources to the IntelliJ resources folder.

This commit is contained in:
Sebastian Cabrera 2023-05-31 20:52:34 -04:00
parent ea6b9266d9
commit 701165c012
4 changed files with 3 additions and 3 deletions

View file

@ -153,9 +153,9 @@ public class ObjectLoader {
IntBuffer h = stack.mallocInt(1);
IntBuffer c = stack.mallocInt(1);
buffer = STBImage.stbi_load(fileName, w, h, c, 4);
buffer = STBImage.stbi_load(ObjectLoader.class.getResource(fileName).getFile(), w, h, c, 4);
if (buffer == null)
throw new Exception("Image File " + fileName + " not loaded " + STBImage.stbi_failure_reason());
throw new Exception("Image File: '" + fileName + "' not loaded, error: " + STBImage.stbi_failure_reason());
width = w.get();
height = h.get();

View file

@ -33,7 +33,7 @@ public class TestGame implements ILogic {
renderer.init();
Model model = loader.loadOBJModel("/models/cube.obj");
model.setTexture(new Texture(loader.loadTexture("res/textures/grassblock.jpg")));
model.setTexture(new Texture(loader.loadTexture("/textures/grassblock.jpg")));
entity = new Entity(model, new Vector3f(0, 0, -5), new Vector3f(0, 0, 0), 1);
}

View file

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 4.1 MiB

After

Width:  |  Height:  |  Size: 4.1 MiB

Before After
Before After