1
/****************************************************************************
3
GLUI User Interface Toolkit
4
---------------------------
6
glui_statictext.cpp - GLUI_StaticText Control
9
--------------------------------------------------
11
Copyright (c) 1998 Paul Rademacher
13
This program is freely distributable without licensing fees and is
14
provided without guarantee or warrantee expressed or implied. This
15
program is -not- in the public domain.
17
*****************************************************************************/
22
/****************************** GLUI_StaticText::draw() **********/
24
void GLUI_StaticText::draw( int x, int y )
31
orig = set_to_glut_window();
35
restore_window( orig );
39
/****************************** GLUI_StaticText::set_text() **********/
41
void GLUI_StaticText::set_text( char *text )
45
/**** Erase old text first *****/
46
glMatrixMode( GL_MODELVIEW );
48
translate_to_origin();
57
orig = set_to_glut_window();
58
/**** Redraw the text in the window ****/
59
glMatrixMode( GL_MODELVIEW );
61
translate_to_origin();
65
restore_window( orig );
69
/************************************ GLUI_StaticText::update_size() **********/
71
void GLUI_StaticText::update_size( void )
78
text_size = string_width( name );
85
/****************************** GLUI_StaticText::draw_text() **********/
87
void GLUI_StaticText::draw_text( void )
97
/****************************** GLUI_StaticText::erase_text() **********/
99
void GLUI_StaticText::erase_text( void )
101
if ( NOT can_draw() )
105
glDisable( GL_CULL_FACE );
106
glBegin( GL_TRIANGLES );
107
glVertex2i( 0,0 ); glVertex2i( w, 0 ); glVertex2i( w, h );
108
glVertex2i( 0, 0 ); glVertex2i( w, h ); glVertex2i( 0, h );