LWJGL
May 19, 2013, 04:00:10 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL is now using GitHub
 
   Home   Help Search Login Register  



Pages: [1]
  Print  
Author Topic: Window.update() causing crash  (Read 1678 times)
smitty1276
Newbie
*
Posts: 6


« on: June 26, 2004, 23:07:01 »

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.
Logged
smitty1276
Newbie
*
Posts: 6


« Reply #1 on: June 26, 2004, 23:32:46 »

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

Check this out...

This is one of my methods...
Code:

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?
Logged
Matzon
Administrator
Demigod
*****
Posts: 2237



« Reply #2 on: June 27, 2004, 02:33:14 »

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

elias
Nerdus Imperius
*****
Posts: 899



WWW
« Reply #3 on: June 27, 2004, 03:24:04 »

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

 - elias
Logged

smitty1276
Newbie
*
Posts: 6


« Reply #4 on: June 27, 2004, 22:03:33 »

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.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!