#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Posts
    92
    Rep Power
    12

    OpenGL and full screen


    Hi,

    I'm having issues with rendering a texture on an object in full screen mode. No problems occur in windowed mode, however in full screen the texture isn't rendered properly.

    I am initializing GL as so:
    PHP Code:
        ::glClearColor(0.0f0.0f0.0f0.5f);
        ::
    glClearDepth(1.0f);
        ::
    glDepthFunc(GL_LEQUAL);
        ::
    glEnable(GL_DEPTH_TEST);
        ::
    glEnable(GL_TEXTURE_2D);
        ::
    glShadeModel(GL_SMOOTH);
        ::
    glHint(GL_PERSPECTIVE_CORRECTION_HINTGL_NICEST);

        ::
    glTexParameteri(GL_TEXTURE_2DGL_TEXTURE_WRAP_SGL_REPEAT);
        ::
    glTexParameteri(GL_TEXTURE_2DGL_TEXTURE_WRAP_TGL_REPEAT);
        ::
    glTexParameteri(GL_TEXTURE_2DGL_TEXTURE_MAG_FILTERGL_LINEAR);
        ::
    glTexParameteri(GL_TEXTURE_2DGL_TEXTURE_MIN_FILTERGL_LINEAR);
        ::
    glTexEnvf(GL_TEXTURE_ENVGL_TEXTURE_ENV_MODEGL_MODULATE); 
    And I'm making the following calls before actually drawing the elements (by invoking glDrawElements):
    PHP Code:
        glEnable(GL_LIGHT0);
        
    glLightfv(GL_LIGHT0GL_DIFFUSEsamplelight);

        
    // Set the current object transformation
        
    glLoadIdentity();
        ::
    glBindTexture(GL_TEXTURE_2Dm_pTexture->TextureID);
        
    glTranslatef(m_fXm_fYm_fZ 200);
        
    glRotatef(m_fAZ1.0f0.0f0.0f);
        
    glRotatef(m_fAY0.0f1.0f0.0f);
        
    glRotatef(m_fAZ0.0f0.0f1.0f);

        
    glEnableClientState(GL_TEXTURE_COORD_ARRAY);
        
    glTexCoordPointer(2GL_FLOAT0m_TexCoordData);
        
    glEnableClientState(GL_NORMAL_ARRAY);
        
    glNormalPointer(GL_FLOAT0m_NormalData);
        
    glEnableClientState(GL_VERTEX_ARRAY);
        
    glVertexPointer(3GL_FLOAT0m_VertexData);

        
    GLfloat glfModelSpecular[4];

        
    // This causes the polygon's ambient & diffuse colors to be derived from the glColor() value.
        
    glColorMaterial(GL_FRONT_AND_BACKGL_AMBIENT_AND_DIFFUSE);
        
    glMaterialf(GL_FRONT_AND_BACKGL_SHININESSshininess);
        
    /* Set the specular shading color. */
        
    glfModelSpecular[0] = r_specularColor;
        
    glfModelSpecular[1] = g_specularColor;
        
    glfModelSpecular[2] = b_specularColor;
        
    glMaterialfv(GL_FRONT_AND_BACKGL_SPECULARglfModelSpecular);
        
    glColor3f(r_diffuseColorg_diffuseColorb_diffuseColor); 
    What do you think this full-screen glitch might be? Are there any tests you could recommend me to try and identify what's causing this? I've tried googling this up but have had no luck...

    I'd really appreciate some feedback!
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2006
    Posts
    48
    Rep Power
    10
    I haven't worked much with OpenGL at a programatic level, however a lot of video cards (especially ATI) have rendering problems with OpenGL, some of which only occur in a full screen mode.

    That said, it may be useful to detail how exactly it is being rendered incorrectly.

    In the mean time, while awaiting a better answer, you might check out the example/demo programs from OGRE or Irrlicht (two open source 3D engines), both of which allow you to choose between renderers (OpenGL, D3D, Software) so that you might determine if it is a problem with your video card/driver.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Posts
    92
    Rep Power
    12
    Thanks for that. I've meanwhile sorted out what was causing the glitch and now it seems to be working just fine.

IMN logo majestic logo threadwatch logo seochat tools logo