Example #1
0
void    GLUI_StaticText::set_text( const char *text )
{
  int orig;

  /**** Erase old text first *****/
  glMatrixMode( GL_MODELVIEW );
  glPushMatrix();
  translate_to_origin();
  erase_text();
  glPopMatrix();

  set_name( (char *) text );

  if ( NOT can_draw() )
    return;

  orig = set_to_glut_window();
  /**** Redraw the text in the window ****/
  glMatrixMode( GL_MODELVIEW );
  glPushMatrix();
  translate_to_origin();
  draw_text();
  glPopMatrix();

  restore_window( orig );
}
Example #2
0
void    GLUI_StaticText::set_text( char *text )
{
  int orig, state;

  orig = set_to_glut_window();
  state = glui->set_front_draw_buffer();

  /**** Erase old text first *****/
  glMatrixMode( GL_MODELVIEW );
  glPushMatrix();
  translate_to_origin();
  erase_text();
  glPopMatrix();

  set_name( text );

  if ( NOT can_draw() )
    return;

  /**** Redraw the text in the window ****/
  glMatrixMode( GL_MODELVIEW );
  glPushMatrix();
  translate_to_origin();
  draw_text();
  glPopMatrix();

  glui->restore_draw_buffer(state);
  restore_window( orig );
}
Example #3
0
void    GLUI_StaticText::draw_text( void )
{
  if ( NOT can_draw() )
    return;

  erase_text();
  draw_name( 0, 9 );
}