Sign in to follow this  

interface with glui

Recommended Posts

hi guys i have a problem with the following code (using DevC++)
gui.cpp: In function `int main(int, char**)':
gui.cpp:58: error: `text' undeclared (first use this function)
gui.cpp:58: error: (Each undeclared identifier is reported only once for each function it appears in.)

make.exe: *** [gui.o] Error 1

Execution terminated

this is my files
#include <GL/glui.h>
#include <GL/glut.h>

/** These are the live variables passed into GLUI ***/
void myGlutInit();
void myGlutKeyboard(unsigned char Key, int x, int y);
//void myGlutMenu( int value )
void myGlutIdle( void );
void myGlutMouse(int button, int button_state, int x, int y );
void myGlutMotion(int x, int y );
void myGlutReshape( int x, int y );
void myGlutDisplay( void );
//void control_cb( int ID )
GLUI_Panel      *obj_panel;
GLUI_EditText   *edittext;
int   main_window;

int main(int argc, char* argv[])
  /*   Initialize GLUT and create window  */

main_window = glutCreateWindow( "GLUI test app" );
glutKeyboardFunc( myGlutKeyboard );
glutDisplayFunc( myGlutDisplay );
glutReshapeFunc( myGlutReshape );
glutMotionFunc( myGlutMotion );
glutMouseFunc( myGlutMouse );

/** Now create a GLUI user interface window and add controls **/
GLUI *glui = GLUI_Master.create_glui( "GLUI", 0 );

GLUI_Panel *obj_panel = glui->add_panel ( "Object Type" );
/////////text box
GLUI_EditText *edittext = glui->add_edittext( "Text:", GLUI_EDITTEXT_TEXT,text);

/** Tell GLUI window which other window to recognize as the main gfx window **/

glui->set_main_gfx_window( main_window );
/* We register the idle callback with GLUI, not with GLUT */
 GLUI_Master.set_glutIdleFunc( myGlutIdle );

  /**** Regular GLUT main loop ****/  


Share this post

Link to post
Share on other sites
The error message tells you precisely what is wrong and where the problem is...

If you can't work it out I suggest you forget 3D programming and go back and learn how to use your tools/programming language correctly...

Share this post

Link to post
Share on other sites
sorry about that i was not clear enough i have tried to declare the text a number of ways but i have not succeded in the source code i tried
GLUI_EditText *edittext; it did not work
i also replaced the 0 in this line
GLUI_EditText *edittext = glui->add_edittext( "Text:", GLUI_EDITTEXT_TEXT,0);
with int text and text but to no avail.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this