Foros - Stratos

Programadores => Programación gráfica => Mensaje iniciado por: xeex en 04 de Octubre de 2007, 12:35:29 AM

Título: como se libera un displaylist
Publicado por: xeex en 04 de Octubre de 2007, 12:35:29 AM
hola.
primero creo un displaylist de esta forma:


void BuildLists()
{
    lista1 =glGenLists(2);    
    glNewList(lista1,GL_COMPILE);              
    dibujar_algo();    
     glEndList();
 
    lista2=lista1+1;
    glNewList(lista2,GL_COMPILE);    
    dibujo_otra_cosa();
    glEndList();    
}


supongamos que quiero borrar la lista 2(para liberar esa memoria)
¿como lo hago?
acaso le pongo free, solo eso??


gracias y saludos
Título: como se libera un displaylist
Publicado por: r2d2rigo en 05 de Octubre de 2007, 12:14:44 AM
Te copypasteo del OpenGL Blue Book (bajatelo junto con el Red Book, estan en HTML y son bastante utiles):

Citar
glDeleteLists
NAME

glDeleteLists - delete a contiguous group of display lists
C SPECIFICATION

void glDeleteLists( GLuint list, GLsizei range )
PARAMETERS

list

   Specifies the integer name of the first display list to delete.

range

   Specifies the number of display lists to delete.

DESCRIPTION

glDeleteLists causes a contiguous group of display lists to be deleted. list is the name of the first display list to be deleted, and range is the number of display lists to delete. All display lists d with list ≤ d ≤ list + range - 1 are deleted.

All storage locations allocated to the specified display lists are freed, and the names are available for reuse at a later time. Names within the range that do not have an associated display list are ignored. If range is zero, nothing happens.
ERRORS

GL_INVALID_VALUE is generated if range is negative.

GL_INVALID_OPERATION is generated if glDeleteLists is called between a call to glBegin and the corresponding call to glEnd.
Título: como se libera un displaylist
Publicado por: xeex en 06 de Octubre de 2007, 06:03:39 PM
gracias...  justo iva a empezar, no sabia que era asi... creia que era  ptra cosa

GRACIAS