









































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










































glut is platform independent. glut can:
create window
get keyboard input and
run an event handler or
message loop of application
#include <GL/glut.h>
int main()
{
glutCreateWindow( "first graphics window" );
}
window's display state is not actually acted upon until glutMainLoop is entered.
This means until glutMainLoop is called, rendering to a created window is ineffective.
The int value returned is a unique identifier for the window.
identifiers starts from one, identifier can be used for calling glutSetWindow.
glutInitDisplayMode
glutInitDisplayMode sets the initial display mode.
void glutInitDisplayMode ( unsigned int mode);
Display mode, normally the bitwise OR -ing of GLUT display mode bit masks.
GLUT_RGB An alias for GLUT_RGBA.
GLUT_INDEX Bit mask to select a color index mode window. This overrides GLUT_RGBA.
GLUT_SINGLE Bit mask to select a single buffered window. This is the default.
GLUT_DOUBLE Bit mask to select a double buffered window. This overrides GLUT_SINGLE if it is also specified.
GLUT_DEPTH Bit mask to select a window with a depth buffer.
GLUT_STENCIL Bit mask to select a window with a stencil buffer.
GLUT_MULTISAMPLE Bit mask to select a window with multisampling support. If multisampling is not available, a non- multisampling window will automatically be chosen.