Jump to content
  • Advertisement
Sign in to follow this  
Sundarlsr

How to create two glListBase()

This topic is 3252 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

Hai friend, I create two GlListbase(0) in my program like this, EX: GLuint m_List1 ; m_List1 = glGenLists(2); glListBase(0); ......... ........ GLuint m_List2 ; m_List2 = glGenLists(2); glListBase(0); ........ ....... shall this affect my list. when i delete the List function created in m_List1. Ex: In Header file : GLuint m_ListCircle GLuint m_List1 ; In .Cpp file : m_List1 = glGenLists(2); glListBase(0); m_ListCircle = m_List1 ; glNewList(m_ListCircle , GL_COMPILE); DrawCircle(); glEndList(); GLuint m_List2 ; m_List2 = glGenLists(2); glListBase(0); ........ ....... After this i called one function in that i delete the List and again created like this, glDeleteLists(m_ListCircle , 1); glNewList(m_ListCircle , GL_COMPILE); DrawCircle(); glEndList(); here only i struck, the value i changed is not updated in the list. did the list is delete properly and create again. plz clarify my doubt. by sundar.

Share this post


Link to post
Share on other sites
Advertisement
In your code:

GLuint m_List1;
m_List1 = glGenLists(2);
glListBase(0);

glGenLists(2) allocates 2 list indices with the numbers m_List1 and m_List1+1. Is there a reason you want to create 2 list indices?

By the way, glListBase(0) has no affect on that allocation.

If you just want to change the display list m_ListCircle, glNewList(m_ListCircle, GL_COMPILE) will automatically delete the old display list. You shouldn't use glDeleteLists() before that call.

The following should work just as well:

GLuint m_ListCircle;
m_ListCircle = glGenLists(1);
glNewList(m_ListCircle,GL_COMPILE);
//... generate the display list
glEndList();

//... later you want to change the circle drawing list
glNewList(m_ListCircle,GL_COMPILE); // automatically deletes the old display list
//... generate a different circle list
glEndList();


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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!