Labdabeta 182 Posting Pro in Training Featured Poster

I have the following code to draw a scene to opengl, but nothing shows up, just a blank screen!

void glCameraDraw(const LABglCameraHANDLE h, LABglWindowHANDLE LABglGlobals)
{
    if (!h->isProjected)//check to see if h's projection is loaded
    {
        glMatrixMode(GL_PROJECTION);
        glLoadIdentity();
        //LABglGlobals->LABglDimensions are the screen dimensions
        gluPerspective(h->fov,(float)LABglGlobals->LABglDimensions.right/
                              (float)LABglGlobals->LABglDimensions.bottom,
                       h->front,h->back);
        h->isProjected=true;
    }
    //set the viewport
    glViewport(0,0,LABglGlobals->LABglDimensions.right,LABglGlobals->LABglDimensions.bottom);
    glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
    glMatrixMode(GL_MODELVIEW);
    //move and rotate as per the rules in my camera
    glTranslatef(-h->loc.x,-h->loc.y,-h->loc.z);
    glRotatef(h->rot.pitch,1,0,0);
    glRotatef(h->rot.yaw,  0,1,0);
    glRotatef(h->rot.roll, 0,0,1);
    //loop through the models in the window (they are stored as array of pointer to pointer 
    for (int i=0; i<LABglGlobals->LABglNumModels; ++i)
    {
        if (*(LABglGlobals->LABglModels[i]))//check that this particular model exists
        {
            glLoadIdentity();
            //bind this model's texture
            glBindTexture(GL_TEXTURE_2D,(*(LABglGlobals->LABglModels[i]))->texture->glTexture);
            //set the color
            glColor4b(((*(LABglGlobals->LABglModels[i]))->blend&0xFF000000)>>24,
                      ((*(LABglGlobals->LABglModels[i]))->blend&0x00FF0000)>>16,
                      ((*(LABglGlobals->LABglModels[i]))->blend&0x0000FF00)>>8,
                      ((*(LABglGlobals->LABglModels[i]))->blend&0x000000FF));
            glCallList((*(LABglGlobals->LABglModels[i]))->displayList);//call the precomiled display list
        }
    }
    SwapBuffers(LABglGlobals->LABglhDC);
}          

I cannot see what is wrong with that code? Any ideas.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.