Still Learning: glLight

Started by Siafu, June 07, 2004, 05:35:22

Previous topic - Next topic

Siafu

OK, please bear with me on this. I'm still learning.

This is how I setup my floatbuffer:

   float[] lightPostion          = {1.00f, 1.00f, 1.00f, 1.00f};
   FloatBuffer light_position = FloatBuffer.wrap(lightPostion);

This the call to glLight:

   GL11.glLight(GL11.GL_LIGHT1, GL11.GL_POSITION, light_position);

It builds fine (netbeans 3.6 WinXP Pro); however, I get this at runtime:

An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x69536209
Function=[Unknown.]
Library=C:\WINDOWS\System32\nvoglnt.dll

NOTE: We are unable to locate the function name symbol for the error
     just occurred. Please refer to release documentation for possible
     reason and solutions.

Current Java thread:
       at org.lwjgl.opengl.GL11.nglLightfv(Native Method)
       at org.lwjgl.opengl.GL11.glLight(Unknown Source)
       at gameTool.mapMaker.init(mapMaker.java:250)

..[cut screen dump of kernals etc.]..

So, have I fouled up the setup and usage of  "light_position" or is this a windows bomb of OpenGL?

Thanks for any help.

Ben

Matzon

You need to create a DIRECT float buffer. BufferUtils is your friend:
http://www.lwjgl.org/javadoc/org/lwjgl/BufferUtils.html