> I'm having problems with openGL display lists using gl4java. I'm not sure
> if this is a java/gl4java specific question, or if it applies to openGL in
[quoted text clipped - 5 lines]
> once a display list has been created it may not be changed, but thought I
> could create them anytime.
more from the 'Andy V school' of comp.graphics.api.opengl-ism:
>> I'm having problems with openGL display lists using gl4java. I'm not
>> sure if this is a java/gl4java specific question, or if it applies to
[quoted text clipped - 32 lines]
> Curious. You don't create new OpenGL contexts every time, do you?
> Other than that, someone is deleting the list.
Interesting point... I think I'm getting to the bottom of it now...
I put a call to System.out.println( gld.getGLContext() ); in the
display() method, and the context IS different each time!
I'm new to open GL, so I'm not so well up on contexts, but I had been
resizing the window to get it to refresh, and it seems this creates a new
context - is this the usual behavoir?
So the reson it was working when I made the diplay list in init() is
because init was being called each time too - when the new context was
made!
If I refresh the window by dragging somthing in front of it my display
lists persist correctly.
Is there a way to keep the state if the window is refreshed, or must
everything be loaded in again? I suppose this is why openGL games like
q3a reload the level when you just change the resolution?
Thanks for the help so far!
> Two suggestions:
>
> I wouldn't use GL_COMPILE_AND_EXECUTE -- I'd compile and then call it.
>
> Use glGenLists() instead of LIST_NO.
Tried these, made no difference.

Signature
Jim H jh
@333
.org
Andy V - 21 Nov 2003 00:44 GMT
>>Curious. You don't create new OpenGL contexts every time, do you?
>>Other than that, someone is deleting the list.
[quoted text clipped - 3 lines]
> I put a call to System.out.println( gld.getGLContext() ); in the
> display() method, and the context IS different each time!
I was just grasping at straws -- I didn't really think you were doing that.
> I'm new to open GL, so I'm not so well up on contexts, but I had been
> resizing the window to get it to refresh, and it seems this creates a new
> context - is this the usual behavoir?
Nobody creates a new OpenGL context but you, so you should change your
code to create the OpenGL context in an initialization routine, not the
resize routine.
>>Two suggestions:
>>
[quoted text clipped - 3 lines]
>
> Tried these, made no difference.
These were side suggestions not related to the problem at hand.
--
Andy V
Jim H - 22 Nov 2003 23:40 GMT
> Nobody creates a new OpenGL context but you, so you should change your
> code to create the OpenGL context in an initialization routine, not
> the resize routine.
Except, it seems, when using GL4Java! It creates a new one whenever the
GLDrawable is resized. I've got it sorted now, thanks for the help!

Signature
Jim H jh
@333
.org