I am trying to store a glBitmap( ) inside a display list. I have 63 different bitmaps so I made a global GLuint base and said:
base = glGenLists( 63 );
if( base != 0 )
{
for( int index = 0 ; index < 63 ; index++ )
glNewList( base + index, GL_COMPILE );
glBitmap( ... );
glEndList( );
}
Then inside my drawing code I made a glColor3f( ) call followed by a glRaster3d( ) call followed by a glCallList( base + indexOfImage ) so it would draw the correct bitmap. For some reason I do not get any bitmaps to show up. I cannot figure out what I am doing incorrectly. Thanks for your help!
I am a moron! I found when I did my if statement back inside my code I had said
if( base == 0 )
So I changed it to != 0 and I could see all my bitmaps. Thanks and sorry for the waste of a post.
are you still using the code above? the for-loop should have brackets like this:
for( int index = 0 ; index < 63 ; index++ )
{
glNewList( base + index, GL_COMPILE );
glBitmap( ... );
glEndList( );
}
otherwise it will call glNewList 64 times in a row, then glBitmap and glEndList only once.
Sorry the code was not on the machine I have access to the internet with so I remembered it in my head and just forgot the { }. I do have those inside my real code. Thanks anyways.