PDA

View Full Version : Bitmaps inside Display Lists



ToddAtWSU
01-24-2007, 11:02 AM
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!

ToddAtWSU
01-24-2007, 12:48 PM
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.

RigidBody
01-25-2007, 05:01 AM
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.

ToddAtWSU
01-25-2007, 11:08 AM
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.