- int c;
- int numchar = strlen ( string ) ;
- SFG_Font* font = fghFontByID( fontID );
- float raster_position[4] ;
-
- glGetFloatv ( GL_CURRENT_RASTER_POSITION, raster_position ) ;
- glPushClientAttrib( GL_CLIENT_PIXEL_STORE_BIT );
- glPixelStorei( GL_UNPACK_SWAP_BYTES, GL_FALSE );
- glPixelStorei( GL_UNPACK_LSB_FIRST, GL_FALSE );
- glPixelStorei( GL_UNPACK_ROW_LENGTH, 0 );
- glPixelStorei( GL_UNPACK_SKIP_ROWS, 0 );
- glPixelStorei( GL_UNPACK_SKIP_PIXELS, 0 );
- glPixelStorei( GL_UNPACK_ALIGNMENT, 1 );
-
- /*
- * Step through the string, drawing each character.
- * A newline will simply translate the next character's insertion
- * point back to the start of the line and down one line.
- */
- for( c = 0; c < numchar; c++ )
- {
- if ( string[c] == '\n' )
- {
- raster_position[1] -= (float)font->Height ;
- glRasterPos4fv ( raster_position ) ;
- }
- else /* Not an EOL, draw the bitmap character */
- {
- const GLubyte* face = font->Characters[ string[ c ] - 1 ] ;
-
- glBitmap(
- face[ 0 ], font->Height, /* The bitmap's width and height */
- font->xorig, font->yorig, /* The origin in the font glyph */
- (float)(face[ 0 ]), 0.0, /* The raster advance -- inc. x,y */
- (face + 1) /* The packed bitmap data... */
- ) ;
- }
- }
- glPopClientAttrib();
+ int c;
+ int numchar = strlen ( string ) ;
+ SFG_Font* font = fghFontByID( fontID );
+ float raster_position[4];
+
+ glGetFloatv ( GL_CURRENT_RASTER_POSITION, raster_position ) ;
+ glPushClientAttrib( GL_CLIENT_PIXEL_STORE_BIT );
+ glPixelStorei( GL_UNPACK_SWAP_BYTES, GL_FALSE );
+ glPixelStorei( GL_UNPACK_LSB_FIRST, GL_FALSE );
+ glPixelStorei( GL_UNPACK_ROW_LENGTH, 0 );
+ glPixelStorei( GL_UNPACK_SKIP_ROWS, 0 );
+ glPixelStorei( GL_UNPACK_SKIP_PIXELS, 0 );
+ glPixelStorei( GL_UNPACK_ALIGNMENT, 1 );
+
+ /*
+ * Step through the string, drawing each character.
+ * A newline will simply translate the next character's insertion
+ * point back to the start of the line and down one line.
+ */
+ for( c = 0; c < numchar; c++ )
+ if ( string[c] == '\n' )
+ {
+ raster_position[1] -= (float)font->Height ;
+ glRasterPos4fv ( raster_position ) ;
+ }
+ else /* Not an EOL, draw the bitmap character */
+ {
+ const GLubyte* face = font->Characters[ string[ c ] - 1 ];
+
+ glBitmap(
+ face[ 0 ], font->Height, /* Bitmap's width and height */
+ font->xorig, font->yorig, /* The origin in the font glyph */
+ ( float )( face[ 0 ] ), 0.0, /* The raster advance; inc. x,y */
+ ( face + 1 ) /* The packed bitmap data... */
+ );
+ }
+ glPopClientAttrib( );