Structural deformable models
glutils.h
Go to the documentation of this file.
1 #ifndef _GLUTILS_H_
2 #define _GLUTILS_H_
3 
4 #define GLUT_DISABLE_ATEXIT_HACK
5 #include <GL/glut.h>
6 
7 inline int sglBitmapString(const char* msg, int x, int y,
8  void* font = (void*)GLUT_BITMAP_8_BY_13)
9 {
10  int width = 0;
11  const char *c = msg;
12  while(*c != 0) {
13  glRasterPos2i(x+width,y);
14  glutBitmapCharacter(font, (int)*c);
15  int w = glutBitmapWidth(font, (int)*c);
16  width += w;
17  c++;
18  }
19  return width;
20 }
21 
22 inline int sglBitmapStringOutlined(const char* msg, int x, int y,
23  void* font = (void*)GLUT_BITMAP_8_BY_13)
24 {
25  glColor3f(0,0,0);
26  sglBitmapString(msg,x-1,y-1);
27  sglBitmapString(msg,x-1,y+1);
28  sglBitmapString(msg,x+1,y-1);
29  sglBitmapString(msg,x+1,y+1);
30  glColor3f(1,1,1);
31  return sglBitmapString(msg, x, y, font);
32 }
33 
34 #endif
int sglBitmapString(const char *msg, int x, int y, void *font=(void *) GLUT_BITMAP_8_BY_13)
Definition: glutils.h:7
int sglBitmapStringOutlined(const char *msg, int x, int y, void *font=(void *) GLUT_BITMAP_8_BY_13)
Definition: glutils.h:22