Skip to main content
gamedev.net
🔒 Locked

glut window

Started by hello_there 4 replies 300+ views
Original Post
hello_there
hello_there
i''ve been told that you can open a gl window in 2 lines using glut. is this true? if so how? also do the gl drawing commands have to be in a certain function or can that be anywhere. eg on nehe''s site the drawing commands are in the function int DrawGLScene(GLvoid) do they have to be? hmmm interesting
____________How could hell be worse?
hello_there
hello_there
thank you lots i''ve been wondering how to do this for ages and your english was good.

hmmm interesting
____________How could hell be worse?
Major
Major
Pleased to answer you and pleased to see that my english is not so bad...
Fruny
Fruny
  

void
display()
{
// your code here

}


int
main( int argc, char** argv )
{
glutInit( &argc, argv ); // initializes GLUT


glutCreateWindow( "Title" ); // creates a window with the default parameters;


glutDisplayFunc( display ); // registers the display function;


glutMainLoop(); // gets the ball rolling


}



More is needed to have something useful, but this will create a window... without barfing.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
wolfman8k
wolfman8k
Allow me to recommend an alternative to glut more sutable for games:

http://allegrogl.sourceforge.net

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.