Hi guys !
The code below compiles correct but it crashes on the Linux verion of my program.
Is it OK to generate the texture ‘within’ the displaylist compilation ?
Or is it better to do this OUTSIDE the display list compile and just bind the texture ?
Thx,
Uther
if ( glIsList(listid) == GL_TRUE )
glDeleteLists( listid, 1 );
listid = glGenLists(1);
glNewList( listid, GL_COMPILE_AND_EXECUTE );
/ // Now create a duplicate image with the new dimension
Itf_BasicImage<color> *l_pTempGLTex = createGlTexmap(getTexture(), newCols, newRows, scale);
glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST );
// Generate texture
glGenTextures(1,&iTextureId[0]);
glBindTexture(GL_TEXTURE_2D, iTextureId[0]);
// Set texture parameters…
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
// Create OpenGL texture
glTexImage2D(GL_TEXTURE_2D, 0, 3,
newCols, newRows,
0, GL_RGB, GL_UNSIGNED_BYTE,
(char *)((((Itf_BasicImage<color> *)l_pTempGLTex)->getPixels()).begin()) );
//**
//** Draw code here
glEndList();