Skip to content

Commit

Permalink
Fixed OpenGL text drawing...
Browse files Browse the repository at this point in the history
git-svn-id: file:///fltk/svn/fltk/trunk@124 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
michaelrsweet committed Dec 2, 1998
1 parent 5c85287 commit be689f9
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/gl_draw.cxx
@@ -1,5 +1,5 @@
//
// "$Id: gl_draw.cxx,v 1.5 1998/12/02 15:51:38 mike Exp $"
// "$Id: gl_draw.cxx,v 1.6 1998/12/02 21:15:19 mike Exp $"
//
// OpenGL drawing support routines for the Fast Light Tool Kit (FLTK).
//
Expand Down Expand Up @@ -50,18 +50,21 @@ void gl_draw(const char* str, int n) {
int base = fl_fontsize->metr.tmFirstChar;
int size = fl_fontsize->metr.tmLastChar-base+1;
HFONT oldFid = (HFONT)SelectObject(fl_gc, fl_fontsize->fid);
fl_fontsize->listbase = glGenLists(size)-base;
fl_fontsize->listbase = glGenLists(256);
wglUseFontBitmaps(fl_gc, base, size, fl_fontsize->listbase+base);
SelectObject(fl_gc, oldFid);
#else
int base = fl_xfont->min_char_or_byte2;
int size = fl_xfont->max_char_or_byte2-base+1;
fl_fontsize->listbase = glGenLists(size)-base;
fl_fontsize->listbase = glGenLists(256);
glXUseXFont(fl_xfont->fid, base, size, fl_fontsize->listbase+base);
#endif
}
glListBase(fl_fontsize->listbase);
glCallLists(n, GL_UNSIGNED_BYTE, str);

glPushAttrib(GL_LIST_BIT);
glListBase(fl_fontsize->listbase);
glCallLists(n, GL_UNSIGNED_BYTE, str);
glPopAttrib();
}

void gl_draw(const char* str, int n, int x, int y) {
Expand Down Expand Up @@ -139,5 +142,5 @@ void gl_draw_image(const uchar* b, int x, int y, int w, int h, int d, int ld) {
#endif

//
// End of "$Id: gl_draw.cxx,v 1.5 1998/12/02 15:51:38 mike Exp $".
// End of "$Id: gl_draw.cxx,v 1.6 1998/12/02 21:15:19 mike Exp $".
//

0 comments on commit be689f9

Please sign in to comment.