So here, I'm just going to start a topic regarding questions I have, but are not worth another topic. Just scroll through until you find an unsolved one you can solve, or, if you got here from a search, see if you can find a solution that fits your needs.
Index:
Question #1: Solved
Question/Problem #2: Unsolved
Question #1 [Solved]Hi, I'm new to LWJGL and still new to Java (but Eclipse's setup makes it very easy to program, and I know other Java-like languages) and I have some questions regarding the project setup. I'm making an skeleton game that I will copy and use for other games in the, basicly a game engine. I need some help on how to setup my project. This is how its setup:
Root
>>src
>>engine
>>engine files
>>game
>>base game files
I've got everything working, but I don't know where to put resources like images, sounds, etc. I also need to know where to put XML property files. And then, how to access them. If I do a link from a java file in 'engine' that says 'res/img/foo.png' it will look in 'engine/res/img/foo.png' but thats weird place to put it. So, how would I do a link from the projects root?
Question/Problem #2Well, I can't get OpenGL to work. Do I need to initilize it? This is what I'm doing:
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0, mode.getWidth(), 0, mode.getHeight());
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glViewport(0, 0, mode.getWidth(), mode.getHeight());
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
There are no errors, but it crashes during runtime (I think). It says this:
Exception in thread "main" java.lang.NullPointerException
at org.lwjgl.opengl.GL11.glMatrixMode(GL11.java:2052)
at engine.engine_window.setupOpenGL(engine_window.java:41)
at Game.GameApplet.main(GameApplet.java:150)
Do I need some other stuff to make it work properly?
Thanks