changes in 0.8 from 0.7

looks like a few things changed from 0.7 to 0.8… i can no longer run this code… whcih means my stuff slows down a lot. is there an equivilant in 0.8?


GLCaps.determineAvailableExtensions();
if (GLCaps.WGL_EXT_swap_control) {
    GL.wglSwapIntervalEXT(0);
}

also realized that org.lwjgl.vector.Vector3f.normalize() was changed to org.lwjgl.vector.Vector3f.normalise() but that was an easy fix :slight_smile:

anyone know of other things? the rest of my stuff still seems to be working…

thanks

only other thing I noticed was determinAvailableExtensions() is now private.

We now have a totally x-plat way of doing vsync:

Window.setVSyncEnabled(boolean);
and then check Window.isVSyncEnabled() to make sure it worked.

determineAvailableExtensions() is no longer public because it’s called for you automatically, hence there is no need for you to see it :slight_smile:

Cas :slight_smile:

[quote]Window.setVSyncEnabled(boolean);
and then check Window.isVSyncEnabled() to make sure it worked.
[/quote]
that worked great! thanks

Heads up, the Nehe demos havent been updated to include this change as of yet.

Also I just noticed a bug in the Nehe07 demo.

The variable z is defined and changed with the pg_up and pg_down keys, but it is not used as it should be.

The following line should just be changed to add z

GL.glTranslatef(0.0f,0.0f,-5.0);
should be
GL.glTranslatef(0.0f,0.0f,z);

I figure I’m on a roll here I may as well submit another. Lighting in the Nehe demo’s is broken.

Thanks to cas’ reply on the puppygames forum, I was able to correct it:


    // Setup The Ambient Light
//    GL.glLightfv(GL.GL_LIGHT1, GL.GL_AMBIENT, temp.asFloatBuffer().put(LightAmbient));
temp.asFloatBuffer().put(LightAmbient).flip(); 
GL.glLightfv(GL.GL_LIGHT1, GL.GL_AMBIENT, temp.asFloatBuffer());
    
    // Setup The Diffuse Light
//    GL.glLightfv(GL.GL_LIGHT1, GL.GL_DIFFUSE, temp.asFloatBuffer().put(LightDiffuse));
temp.asFloatBuffer().put(LightDiffuse).flip(); 
GL.glLightfv(GL.GL_LIGHT1, GL.GL_DIFFUSE, temp.asFloatBuffer());
    
    // Position The Light
//    GL.glLightfv(GL.GL_LIGHT1, GL.GL_POSITION,temp.asFloatBuffer().put(LightPosition));
temp.asFloatBuffer().put(LightPosition).flip(); 
GL.glLightfv(GL.GL_LIGHT1, GL.GL_POSITION, temp.asFloatBuffer());


Which tutorial, btw? I was thinking it would be Nehe07 that’s related to lighting, but I’m not sure exactly what you mean by “not working” because it seems to work fine on both of the machines I have access to (work and home). I need to read through the Nehe tutorial, but I see a textured cube, pressing L toggles the light. No changes needed except to comment out the getAvailableExtensions and the line afterwards… Adding your changes results in no discernable difference… ???

Really?! That’s weird. On my machine it would go to a full black screen if I turned lights on without the above modification.

Someone else had the problem in the LWJGL forum, and I fixed it by using Cas’ response.

See it here:

http://www.puppygames.net/forums/viewtopic.php?t=322

I wonder why it wasnt doing that with you.

Dunno…
Here’s what I get:
Demo starts, see textured cube on black background.
Press L, everything’s black (lights off).
Press L again, everything back to normal.
Is that the specified behavior?

Just want to make sure I’m not looking for something else… :stuck_out_tongue:

auh! yeah that is the incorrect behavior as far as I know. With lighting off you should still be able to see the textures, just the sides should be very dark. Try using the above fix so you can see the difference.

Ahh… now I see. Yes, commenting out the other lines and using yours, it doesn’t completely black out. As I hadn’t read the actual Tutorial or completely through the source, I just assumed L toggled all the lights on and off. :stuck_out_tongue: