<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd">
<html
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:mml="http://www.w3.org/1998/Math/MathML"
><head><title>glutInit</title><link rel="stylesheet" href="style.css" type="text/css"/><meta name="generator" content="DocBook XSL Stylesheets V1.59.1"/><link rel="home" href="index.xml" title="PyOpenGL 2.0.1.07 Man Pages"/><link rel="up" href="reference-GLUT.xml" title="GLUT"/><link rel="previous" href="glutIgnoreKeyRepeat.3GLUT.xml" title="glutIgnoreKeyRepeat"/><link rel="next" href="glutInitDisplayMode.3GLUT.xml" title="glutInitDisplayMode"/></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">glutInit</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="glutIgnoreKeyRepeat.3GLUT.xml">Prev</a> </td><th width="60%" align="center">GLUT</th><td width="20%" align="right"> <a accesskey="n" href="glutInitDisplayMode.3GLUT.xml">Next</a></td></tr></table><hr/></div><div class="refentry" lang="en"><a name="glutInit.3GLUT"/><div class="titlepage"/><div class="refnamediv"><a name="glutInit.3GLUT-name"/><h2>Name</h2><p>glutInit &#8212; initialize the GLUT library.</p></div><div class="refsynopsisdiv"><a name="glutInit.3GLUT-c_spec"/><h2>C Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code>void <tt>glutInit</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code>int *<i><tt>argcp</tt></i>, char **<i><tt>argv</tt></i>);</code></td></tr></table></div><div class="refsynopsisdiv"><a name="glutInit.3GLUT-python_spec"/><h2>Python Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code><tt>glutInit</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>argcp</tt></i>, <i><tt>argv</tt></i>) &#8594; <tt>None</tt></code></td></tr></table></div><div class="refsect1" lang="en"><a name="glutInit.3GLUT-parameters"/><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><i><tt>argcp</tt></i></span></dt><dd>
						A pointer to the program's unmodified <i><tt>argc</tt></i> variable from main. Upon return, the
						value pointed to by <i><tt>argcp</tt></i> will be updated, because <tt>glutInit</tt>
						extracts any command line options intended for the GLUT library.
					</dd><dt><span class="term"><i><tt>argv</tt></i></span></dt><dd>
						The program's unmodified <i><tt>argv</tt></i> variable from main. Like <i><tt>argcp</tt></i>,
						the data for <i><tt>argv</tt></i> will be updated because <tt>glutInit</tt> extracts any
						command line options understood by the GLUT library.
					</dd></dl></div></div><div class="refsect1" lang="en"><a name="glutInit.3GLUT-description"/><h2>Description</h2><p>
			<tt>glutInit</tt> will initialize the GLUT library and negotiate a session with the window system. During
			this process, <tt>glutInit</tt> 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.
		</p><p>
			<tt>glutInit</tt> also processes command line options, but the specific options parse are window system
			dependent.
		</p></div><div class="refsect1" lang="en"><a name="glutInit.3GLUT-x_implementation_notes"/><h2>X Implementation Notes</h2><p>
			The X Window System specific options parsed by <tt>glutInit</tt> are as follows:
		</p><div class="variablelist"><dl><dt><span class="term"><span class="bold"><b>-display</b></span> <span class="emphasis"><em>DISPLAY</em></span></span></dt><dd>
						Specify the X server to connect to. If not specified, the value of the DISPLAY environment variable is used.
					</dd><dt><span class="term"><span class="bold"><b>-geometry</b></span> <span class="emphasis"><em>WxH+X+Y</em></span></span></dt><dd>
						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 <a href="glutInitWindowPosition.3GLUT.xml"><tt>glutInitWindowSize</tt></a> or <a href="glutInitWindowPosition.3GLUT.xml"><tt>glutInitWindowPosition</tt></a> were called directly.
					</dd><dt><span class="term"><span class="bold"><b>-iconic</b></span></span></dt><dd>
						Requests all top-level windows be created in an iconic state.
					</dd><dt><span class="term"><span class="bold"><b>-indirect</b></span></span></dt><dd>
						Force the use of indirect OpenGL rendering contexts.
					</dd><dt><span class="term"><span class="bold"><b>-direct</b></span></span></dt><dd>
						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.
					</dd><dt><span class="term"><span class="bold"><b>-gldebug</b></span></span></dt><dd>
						After processing callbacks and/or events, check if there are any OpenGL errors by calling <a href="glGetError.3G.xml"><tt>glGetError</tt></a>. If an error is reported, print out a warning by looking up the
						error code with <a href="gluErrorString.3G.xml"><tt>gluErrorString</tt></a>. Using this option is helpful in
						detecting OpenGL run-time errors.
					</dd><dt><span class="term"><span class="bold"><b>-sync</b></span></span></dt><dd>
						Enable synchronous X protocol transactions. This option makes it easier to track down potential X protocol
						errors.
					</dd></dl></div></div><div class="refsect1" lang="en"><a name="glutInit.3GLUT-see_also"/><h2>See Also</h2><p>
			<span class="simplelist"><a href="glutCreateWindow.3GLUT.xml">glutCreateWindow</a>, <a href="glutInitWindowPosition.3GLUT.xml">glutInitWindowPosition</a>, <a href="glutInitWindowSize.3GLUT.xml">glutInitWindowSize</a>, <a href="glutMainLoop.3GLUT.xml">glutMainLoop</a></span>
		</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="glutIgnoreKeyRepeat.3GLUT.xml">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="reference-GLUT.xml">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="glutInitDisplayMode.3GLUT.xml">Next</a></td></tr><tr><td width="40%" align="left" valign="top">glutIgnoreKeyRepeat </td><td width="20%" align="center"><a accesskey="h" href="index.xml">Home</a></td><td width="40%" align="right" valign="top"> glutInitDisplayMode</td></tr></table></div></body></html>