
February 12th, 2007, 12:47 AM
|
|
Contributing User
|
|
Join Date: Mar 2004
Posts: 92
  
Time spent in forums: 6 h 47 m 7 sec
Reputation Power: 6
|
|
|
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.0f, 0.0f, 0.0f, 0.5f);
::glClearDepth(1.0f);
::glDepthFunc(GL_LEQUAL);
::glEnable(GL_DEPTH_TEST);
::glEnable(GL_TEXTURE_2D);
::glShadeModel(GL_SMOOTH);
::glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
::glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
And I'm making the following calls before actually drawing the elements (by invoking glDrawElements):
PHP Code:
glEnable(GL_LIGHT0);
glLightfv(GL_LIGHT0, GL_DIFFUSE, samplelight);
// Set the current object transformation
glLoadIdentity();
::glBindTexture(GL_TEXTURE_2D, m_pTexture->TextureID);
glTranslatef(m_fX, m_fY, m_fZ - 200);
glRotatef(m_fAZ, 1.0f, 0.0f, 0.0f);
glRotatef(m_fAY, 0.0f, 1.0f, 0.0f);
glRotatef(m_fAZ, 0.0f, 0.0f, 1.0f);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(2, GL_FLOAT, 0, m_TexCoordData);
glEnableClientState(GL_NORMAL_ARRAY);
glNormalPointer(GL_FLOAT, 0, m_NormalData);
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, 0, m_VertexData);
GLfloat glfModelSpecular[4];
// This causes the polygon's ambient & diffuse colors to be derived from the glColor() value.
glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, shininess);
/* Set the specular shading color. */
glfModelSpecular[0] = r_specularColor;
glfModelSpecular[1] = g_specularColor;
glfModelSpecular[2] = b_specularColor;
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, glfModelSpecular);
glColor3f(r_diffuseColor, g_diffuseColor, b_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!
|