glutInit

initialize the GLUT library.

Signature

glutInit( int( argcp ) , char( argv ) )-> void
glutInit( pargc , argv )
Initialise the GLUT library

Parameters

VariablesDescription
argcp
A pointer to the program's unmodified argc variable from main. Upon return, the value pointed to by argcp will be updated, because glutInit extracts any command line options intended for the GLUT library.
argv
The program's unmodified argv variable from main. Like argcp , the data for argv will be updated because glutInit extracts any command line options understood by the GLUT library.

Description

glutInit will initialize the GLUT library and negotiate a session with the window system. During this process, glutInit may cause the termination of the GLUT program with an error message to the user if GLUT cannot be properly initialized. Examples of this situation include the failure to connect to the window system, the lack of window system support for OpenGL, and invalid command line options.
glutInit also processes command line options, but the specific options parse are window system dependent.

X Implementation Notes

The X Window System specific options parsed by glutInit are as follows:
-display DISPLAY
Specify the X server to connect to. If not specified, the value of the DISPLAY environment variable is used.
-geometry WxH+X+Y
Determines where window's should be created on the screen. The emphasis following -geometry should be formatted as a standard X geometry specification. The effect of using this option is to change the GLUT initial size and initial position the same as if glutInitWindowSize or glutInitWindowPosition were called directly.
-iconic
Requests all top-level windows be created in an iconic state.
-indirect
Force the use of indirect OpenGL rendering contexts.
-direct
Force the use of direct OpenGL rendering contexts (not all GLX implementations support direct rendering contexts). A fatal error is generated if direct rendering is not supported by the OpenGL implementation. If neither -indirect or -direct are used to force a particular behavior, GLUT will attempt to use direct rendering if possible and otherwise fallback to indirect rendering.
-gldebug
After processing callbacks and/or events, check if there are any OpenGL errors by calling glGetError . If an error is reported, print out a warning by looking up the error code with gluErrorString . Using this option is helpful in detecting OpenGL run-time errors.
-sync
Enable synchronous X protocol transactions. This option makes it easier to track down potential X protocol errors.

See Also

glutCreateWindow glutInitWindowPosition glutInitWindowSize glutMainLoop

Sample Code References

The following code samples have been found which appear to reference the functions described here. Take care that the code may be old, broken or not even use PyOpenGL.

glutInit
OpenGLContext OpenGLContext/glutvrmlcontext.py Lines: 17, 19
OpenGLContext OpenGLContext/glutcontext.py Lines: 36, 167, 171, 173
OpenGLContext OpenGLContext/context.py Lines: 229
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson11.py Lines: 142
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson18.py Lines: 254
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson6.py Lines: 180
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson41.py Lines: 312
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson16.py Lines: 163
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson23.py Lines: 223
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson5.py Lines: 192
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson4.py Lines: 144
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson26.py Lines: 209
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson12.py Lines: 143
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson3.py Lines: 121
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson13.py Lines: 174
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson1.py Lines: 94
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson19.py Lines: 235
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson42.py Lines: 383
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson2.py Lines: 116
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson6-multi.py Lines: 218
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson45.py Lines: 464
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson48/NeHeGL.py Lines: 119
OpenGL-Demo PyOpenGL-Demo/proesch/nurbs/nurbs.py Lines: 199
OpenGL-Demo PyOpenGL-Demo/da/dots.py Lines: 97
OpenGL-Demo PyOpenGL-Demo/GLE/maintest.py Lines: 34
OpenGL-Demo PyOpenGL-Demo/GLUT/gears.py Lines: 263
OpenGL-Demo PyOpenGL-Demo/GLUT/shader_test.py Lines: 106
OpenGL-Demo PyOpenGL-Demo/GLUT/glutplane.py Lines: 213
OpenGL-Demo PyOpenGL-Demo/GLUT/molehill.py Lines: 59
OpenGL-Demo PyOpenGL-Demo/GLUT/tom/conesave.py Lines: 50
OpenGL-Demo PyOpenGL-Demo/GLUT/tom/checker.py Lines: 108
OpenGL-Demo PyOpenGL-Demo/GLUT/tom/lorentz.py Lines: 116
OpenGL-Demo PyOpenGL-Demo/GLUT/tom/arraytest.py Lines: 95
OpenGL-Demo PyOpenGL-Demo/GLUT/tom/text.py Lines: 109
OpenGL-Demo PyOpenGL-Demo/GLUT/tom/cone.py Lines: 110
OpenGL-Demo PyOpenGL-Demo/redbook/hello.py Lines: 94
OpenGL-Demo PyOpenGL-Demo/redbook/scene.py Lines: 133
OpenGL-Demo PyOpenGL-Demo/redbook/drawf.py Lines: 105
OpenGL-Demo PyOpenGL-Demo/redbook/lines.py Lines: 133
OpenGL-Demo PyOpenGL-Demo/redbook/movelight.py Lines: 131
OpenGL-Demo PyOpenGL-Demo/redbook/smooth.py Lines: 99
OpenGL-Demo PyOpenGL-Demo/redbook/fog.py Lines: 148
OpenGL-Demo PyOpenGL-Demo/redbook/double.py Lines: 105
OpenGL-Demo PyOpenGL-Demo/redbook/teapots.py Lines: 199
OpenGL-Demo PyOpenGL-Demo/redbook/cube.py Lines: 90
OpenGL-Demo PyOpenGL-Demo/tom/pick.py Lines: 52
OpenGL-Demo PyOpenGL-Demo/tom/conechecker.py Lines: 58
OpenGL-Demo PyOpenGL-Demo/tom/conesave.py Lines: 13
OpenGL-Demo PyOpenGL-Demo/tom/checker.py Lines: 34
OpenGL-Demo PyOpenGL-Demo/tom/fog.py Lines: 36
OpenGL-Demo PyOpenGL-Demo/tom/cone.py Lines: 8
OpenGL-Demo py2exe-example/shader_test.py Lines: 108
{Artistic License} PymmLib pymmlib/applications/glutviewer.py Lines: 392
{Artistic License} PymmLib pymmlib/applications/tlsviewer.py Lines: 2856
{LGPL} PyUI2 renderers/openglGlut.py Lines: 46
{LGPL} PyUI2 system/glutdevice.py Lines: 41
{LGPL} PyMT pymt/ui/window/win_glut.py Lines: 15, 29
{LGPL or GPL or MPL} Kamaelia Sketches/CL/Topology3D/Utils/TopologyViewer3D.py Lines: 164
{GPL3} OpenGL-Programmable 05-shader.py Lines: 307
{GPL3} OpenGL-Programmable 07-attrib.py Lines: 326
{GPL3} OpenGL-Programmable 03-array.py Lines: 227
{GPL3} OpenGL-Programmable 09-gles2.py Lines: 369
{GPL3} OpenGL-Programmable 06-perpixel.py Lines: 315
{GPL3} OpenGL-Programmable 10-gl3.2core.py Lines: 379
{GPL3} OpenGL-Programmable 02-displaylist.py Lines: 225
{GPL3} OpenGL-Programmable 04-vbo.py Lines: 246
{GPL3} OpenGL-Programmable 01-direct.py Lines: 216
{GPL3} OpenGL-Programmable 08-pbo.py Lines: 348