Doxygen Source Code Documentation
glut_bwidth.c File Reference
#include <GL/glut.h>#include "glutint.h"#include "glutbitmap.h"Go to the source code of this file.
| Functions | |
| int | glutBitmapWidth (GLUTbitmapFont font, int c) | 
| int | glutBitmapLength (GLUTbitmapFont font, unsigned char *string) | 
Function Documentation
| 
 | ||||||||||||
| 
 Definition at line 28 of file glut_bwidth.c. References BitmapCharPtr, BitmapFontPtr, c, and GLUTbitmapFont. 
 00029 {
00030   int c, length;
00031   BitmapFontPtr fontinfo = (BitmapFontPtr) font;
00032   BitmapCharPtr ch;
00033 
00034   length = 0;
00035   for (; *string != '\0'; string++) {
00036     c = *string;
00037     if (c < fontinfo->first || c >= fontinfo->first + fontinfo->num_chars) {
00038       ch = fontinfo->ch[c - fontinfo->first];
00039       if (ch)
00040         length += ch->advance;
00041     }
00042   }
00043   return length;
00044 }
 | 
| 
 | ||||||||||||
| 
 Definition at line 13 of file glut_bwidth.c. References BitmapCharPtr, BitmapFontPtr, c, and GLUTbitmapFont. 
 00014 {
00015   BitmapFontPtr fontinfo = (BitmapFontPtr) font;
00016   BitmapCharPtr ch;
00017 
00018   if (c < fontinfo->first || c >= fontinfo->first + fontinfo->num_chars)
00019     return 0;
00020   ch = fontinfo->ch[c - fontinfo->first];
00021   if (ch)
00022     return ch->advance;
00023   else
00024     return 0;
00025 }
 | 
 
                             
                             
                             
                             
                             
                             
                             
                             
                             
                             
                             
                             
 
 
 
 
       
	   
	   
	   
	  