Hello,
I have been working thru the NeHe tuts and converting them over to Java as a learning tool. However, I have run into a problem. Certain classes are not recognized. Basically anything to do with texture or light. Here is an example error from NetBeans 3.6:
gameTool/mapMaker.java [232:1] cannot resolve symbol
symbol : method glMaterialfv (int,int,float[])
location: class org.lwjgl.opengl.GL11
GL11.glMaterialfv(GL11.GL_FRONT, GL11.GL_SPECULAR, mat_specular);
^
or
gameTool/mapMaker.java [234:1] cannot resolve symbol
symbol : method glLightfv (int,int,float[])
location: class org.lwjgl.opengl.GL11
GL11.glLightfv(GL11.GL_LIGHT0, GL11.GL_POSITION, light_position);
^
Any suggestions? I'm a little frustrated. Thanks.
Ben
In LWJGL we use
glLight(GL11.GL_LIGHT0, GL11.GL_POSITION, light_position);
where light_position is a direct FloatBuffer
Cas :)
Cas,
Thanks for the help. Based on your post, I extended your comment regarding glLight over to glMaterial. Everything seems to build ok now.
Is this a common occurance, where the "fv" suffix found in OpenGL is treated in the above manner; ie, "glLightfv" -> glLight with a FloatBuffer?
Thanks again for your help. Much appreciated.
Ben
Yes - we have replaced all int[] / float[] / byte[] parameters and the *v suffix with the appropriate overloaded method instead. So that's the general pattern.
Note also that we specifically take account of the buffer's current position and limit. For functions that used to take a pointer and another argument, n or count, for example, we now actually use limit()-position() automatically to calculate this. And so on.
Cas :)