Skip to main content
GameDev.net gamedev.net
🔒 Locked

Display list problems

Started by essial Jan 29, 2008 at 9:48 AM 0 replies 400+ views
Original Post
essial
essial
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?
essial
essial
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.