Doxygen Source Code Documentation
glut_bitmap.c File Reference
#include <GL/glut.h>
#include "glutint.h"
#include "glutbitmap.h"
Go to the source code of this file.
Functions | |
void | glutBitmapCharacter (GLUTbitmapFont font, int c) |
Function Documentation
|
Definition at line 13 of file glut_bitmap.c. References BitmapCharPtr, BitmapFontPtr, c, and GLUTbitmapFont. Referenced by SUMA_AxisText(), and SUMA_DrawMesh().
00014 { 00015 BitmapCharPtr ch; 00016 BitmapFontPtr fontinfo = (BitmapFontPtr) font; 00017 GLint swapbytes, lsbfirst, rowlength; 00018 GLint skiprows, skippixels, alignment; 00019 00020 if (c < fontinfo->first || 00021 c >= fontinfo->first + fontinfo->num_chars) 00022 return; 00023 ch = fontinfo->ch[c - fontinfo->first]; 00024 if (ch) { 00025 /* save current modes */ 00026 glGetIntegerv(GL_UNPACK_SWAP_BYTES, &swapbytes); 00027 glGetIntegerv(GL_UNPACK_LSB_FIRST, &lsbfirst); 00028 glGetIntegerv(GL_UNPACK_ROW_LENGTH, &rowlength); 00029 glGetIntegerv(GL_UNPACK_SKIP_ROWS, &skiprows); 00030 glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &skippixels); 00031 glGetIntegerv(GL_UNPACK_ALIGNMENT, &alignment); 00032 /* Little endian machines (DEC Alpha for example) could 00033 benefit from setting GL_UNPACK_LSB_FIRST to GL_TRUE 00034 instead of GL_FALSE, but this would require changing the 00035 generated bitmaps too. */ 00036 glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE); 00037 glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE); 00038 glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); 00039 glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); 00040 glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); 00041 glPixelStorei(GL_UNPACK_ALIGNMENT, 1); 00042 glBitmap(ch->width, ch->height, ch->xorig, ch->yorig, 00043 ch->advance, 0, ch->bitmap); 00044 /* restore saved modes */ 00045 glPixelStorei(GL_UNPACK_SWAP_BYTES, swapbytes); 00046 glPixelStorei(GL_UNPACK_LSB_FIRST, lsbfirst); 00047 glPixelStorei(GL_UNPACK_ROW_LENGTH, rowlength); 00048 glPixelStorei(GL_UNPACK_SKIP_ROWS, skiprows); 00049 glPixelStorei(GL_UNPACK_SKIP_PIXELS, skippixels); 00050 glPixelStorei(GL_UNPACK_ALIGNMENT, alignment); 00051 } 00052 } |