Jump to content
  • Advertisement
Sign in to follow this  
essial

OpenGL Display list problems

This topic is 3799 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

First I allocate the list with glGenLists. Then I build the actual list commands by starting with glNewList(dlMyList, GL_COMPILE), and ending with glEndList(). But for some reason, it doesn't do squat with the display list. All it does is render to the screen anyway, and any subsequent calls to the display list draw nothing. Besides non-opengl code, this is the only gl code that is inside of the list:
	// Specify filtering and edge actions
	glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
	glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
	glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT);
	glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT);
	glLoadIdentity(); 
	glBindTexture(GL_TEXTURE_2D,Image->Texture);
	glPushMatrix();

	glTranslatef(-1+x, 1+y, z);

	float r = ((float)Image->Width / (float)DesignWidth) * (float)2.0f;
	float b = ((float)Image->Height / (float)DesignHeight) * (float)2.0f;
	

	glBegin(GL_QUADS);
	glTexCoord2f(0.0f,0.0f); glVertex3f(0, 0, z);
	glTexCoord2f(0.0f,1.0f); glVertex3f(0, -b, z);
	glTexCoord2f(1.0f,1.0f); glVertex3f(r, -b, z);
	glTexCoord2f(1.0f,0.0f); glVertex3f(r, 0, z);
	glEnd();

	glPopMatrix();
Any idea what could be causing the problem? Do you need any more information?

Share this post


Link to post
Share on other sites
Advertisement
Nevermind, I fixed it. I was trying to create the display list before I was supposed to, causing the list to be invalid (and thus the function ignored). Everything is working fine now.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!