PDA

View Full Version : problem in deleting the group of lists



pnpvivek
11-06-2009, 09:57 PM
i want to deleting the group of Lists and create the group of Lists dynamically.I tried using this code.
but some times it didn't delete properly/
following is the code.

int nListSize = 5 ;
unsigned char nListIndex = 1 ;
m_List = glGenLists(nListSize);
glListBase(0);

// Common list used for all type of figure.
m_ListCircle = m_List ;
m_ListSQuare = m_List + nListIndex++ ;
m_ListArc = m_List + nListIndex++ ;
m_ListRectangle = m_List + nListIndex++ ;
m_ListPolygon = m_List + nListIndex++ ;



glNewList(m_ListCircle , GL_COMPILE);
DrwaCircle();
glEndList();
glNewList(m_ListSQuare , GL_COMPILE);
DrwaSQuare();
glEndList();
glNewList(m_ListArc , GL_COMPILE);
DrwaArc();
glEndList();
glNewList(m_ListRectangle , GL_COMPILE);
DrwaPolygon();
glEndList();
glNewList(m_ListPolygon , GL_COMPILE);
DrwaRectangle();
glEndList();

Now i want to delete the particular list in that group.

glDeleteLists(m_ListCircle , 1);

glNewList(m_ListCircle ,GL_COMPILE) ;
DrwaCircle() ;
glEndList() ;

But it didn't delete properly
Tell the solution
thanks in advance.