Sign in to follow this  

Problem with Display Lists

Recommended Posts

Botar    122
Hi, In my program, I am building a maze a putting it in a display list. There are paintings on the wall, and whenever I collect one, I remove it from the maze and rebuild the display list. That has been working fine, but now I need to add paintings to the maze during gameplay. When the painting gets added, it rebuilds the display list, only most of the time, the entire maze does not get displayed anymore. One thing that I have noticed is that glIsList does not return as true when I rebuild it. It should and it does when I am removing paintings, but not when adding. Any ideas? Here is the beginning of my function that builds a display list:
void MazeGen::BuildMainDisplayList()
	int numWalls;
	double extend;
	bool isOuterWall;

	if(glIsList(mainID) == GL_TRUE)
		glDeleteLists(mainID, 1);
	mainID = glGenLists(1);
	glNewList(mainID, GL_COMPILE);

And then I go on to draw all of the walls for the maze.

Share this post

Link to post
Share on other sites
anist    100
what you posted looks fine. you may want to try using more than one display list. one for the maze and one for each item that can be removed. keep em in an vector or something.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this