glutBitmapCharacter does not work alone

Bug #630881 reported by ISA
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
freeglut (Ubuntu)
New
Undecided
Unassigned

Bug Description

The following little program illustrates the problem:

#include <GL/glut.h>

void draw() {
  glClearColor(0, 0, 0, 1);
  glClear(GL_COLOR_BUFFER_BIT);

  // Every matrix is identitiy at this point...

  glColor3f(1, 1, 1);
  glRasterPos2f(0, 0.1);
  glutBitmapCharacter(GLUT_BITMAP_8_BY_13, '1');

/* glBegin(GL_LINES);
   glVertex2f(0, 0);
   glVertex2f(1, 0);
  glEnd();*/

  glFlush();
}

int main(int args, char** argv) {
  glutInit(&args, argv);

  glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE);

  glutCreateWindow("Main Win");

  glutDisplayFunc(&draw);

  glutMainLoop();

  return 0;
}

Compiled with:
gcc demo.c -o demo -lGL -lGLU -lglut

If executed it should show "1" but it does not. Only if uncommenting the drawing instructions for the following line it works. Generally, the function glutbitmapoCharacter seems only to work if something is drawn after calling the character draw function. glutStrokeCharacter seems to be affected by the same type of problem, however I did not check that as thouroughly.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.