Window.update() causing crash

Started by smitty1276, June 27, 2004, 06:07:01

Previous topic - Next topic

smitty1276

I just started toying with LWJGL, and I think I like it.

I'm having some problems however... when I run my app it crashes with an "Abnormal program termination" messagebox.  If I comment out the Window.update() call in my render() method, it will work.

Any idea what I might be doing wrong? If this weren't my fault, I assume someone else would have mentioned it.

smitty1276

It may not be Window.update() afterall (or anymore, whichever you prefer).

Check this out...

This is one of my methods...
private void render() {
    System.err.println("Render");//**
    GL11.glClear(GL11.GL_COLOR_BUFFER_BIT |   GL11.GL_DEPTH_BUFFER_BIT);
    GL11.glLoadIdentity();

    GL11.glTranslatef(0.0f, 0.0f, -250.0f);
    GL11.glPushMatrix();
    GL11.glRotatef(rot, 0.0f, 0.0f, 1.0f);
    GL11.glColor3f(0.7f, 0.3f, 0.3f);
    theSphere.draw(25.0f, 15, 15);
    GL11.glPopMatrix();

    rot += 1.0f;
    System.err.println("End render... Rot = " + rot);//**

}


rot is an instance member variable. When I give it no access-specifier (package access), the program crashes with a blank window and the System.err.println ends up printing "End render... Rot = 100.0" EVERY TIME!!!  If I change the increment value to 2.0f, it reports that rot = 200.0.

Basically, it crashes after 100 frames every time, without displaying a thing.

Interestingly, it DOESN'T crash if I comment out the Window.update() line.


Here's where it gets weird...

If I add the public access specifier in front of rot's declaration, the program runs great.  It displays my little rotating sphere, and runs until I tell it to stop... rot's value has been in the thousands with no problems.

What could be causing this?

Matzon

can you post the full source code? - this sounds weird.
What OS ? Graphics card and drivers?

elias

Definitely sounds like some memory corruption problem. Are you using buffers anywhere?

- elias

smitty1276

I think it's resolved... though, I'm not sure exactly why it's resolved.

I'll get back to you if anything like that shows up again.