Jump to content

View more

Image of the Day

The night is still, but the invasion brings chaos. #screenshotsaturday #hanako #indiegame #gameart #ue4 #samurai https://t.co/cgILXuokoS
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

glut window

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
5 replies to this topic

#1 hello_there   Members   

122
Like
Likes
Like

Posted 16 November 2001 - 03:20 PM

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

#2 Anonymous Poster_Anonymous Poster_*   Guests   

Likes

Posted 16 November 2001 - 11:48 PM

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.

draw_triangle{
glBegin();
glVertex2f(0,0);
glVertex2f(1,0);
glVertex2f(1,1);
}

display_func{ // the display function(or DrawGlScene).
.......
.....
draw_triangle();
....
}

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

#3 hello_there   Members   

122
Like
Likes
Like

Posted 17 November 2001 - 04:19 PM

thank you lots i''ve been wondering how to do this for ages and your english was good.

hmmm interesting

#4 Major   Members   

122
Like
Likes
Like

Posted 17 November 2001 - 11:14 PM

Pleased to answer you and pleased to see that my english is not so bad...

#5 Fruny   Moderators   

1658
Like
Likes
Like

Posted 17 November 2001 - 11:20 PM

  

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.

#6 wolfman8k   Members   

140
Like
Likes
Like

Posted 18 November 2001 - 07:12 AM

Allow me to recommend an alternative to glut more sutable for games:

http://allegrogl.sourceforge.net




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.