Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


glut window

This topic is 6115 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
It''s true taht with glut you can create a glwindow in few lines:

glutInitWindowPosition(0,0); //position of the left bottom corner
glutInitWindowSize(1024,768); // size of the window
glutCreateWindow("Title");// Window Title

Drawing commands can be in other funtion, but this function must be called in the DisplayFunction.


display_func{ // the display function(or DrawGlScene).

I hope I have answer your question and that you have understood me (my english is not very good)...

Share this post

Link to post
Share on other sites

// your code here


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.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!