context sharing question

Post: #1
Hi there,

I'm fairly new to OpenGL (as well as Cocoa/Objective-C), and I've been working my way through the NeHe tutorials... not using their provided cocoa code so much (the fullscreen toggle is broken) as working from onesadcookie's gameshell (which has helped a lot, much thanks).

Now I've reached tutorial 18, which uses quadrics, and I have a few questions concerning sharing the quadric objects between my windowed and fullscreen contexts (both are instances of NSOpenGLContext).

in my drawFrame method, I create the quadrics (at GLUquadricObj *quadratic) if it's the first frame (so it's only called once):

- (void) drawFrame
if ( _firstFrame ) {
    gluQuadricNormals(quadratic, GLU_SMOOTH);
    gluQuadricTexture(quadratic, GL_TRUE); NEW )
    _firstFrame = NO;
// some drawing functions below, example:


This works fine for my initial window context.

However, when I switch to the fullscreen context, which shares with the window context, it won't draw the quadrics. It will, however, draw a cube with the proper texture (so it seems to be sharing properly). Switching back to the window context again draws the quadrics.

My questions are: why wont opengl draw the quadric in the fullscreen context? Do I have to recreate the quadrics every time I switch contexts?

Quote this message in a reply
Post Reply