Home

glutInit

glutInit is the initialization routine for the OpenGL Utility Toolkit (GLUT). It initializes the GLUT library and negotiates with the underlying windowing system to prepare for creating windows, contexts, and events. It is typically the first GLUT routine invoked in a program that uses GLUT.

The function is declared as void glutInit(int *argcp, char **argv). It takes pointers to the program’s argc

Command-line options processed by GLUT are implementation-dependent, but GLUT may recognize options related to display selection

Relation to other GLUT calls: glutInit must be called before any other GLUT routines, and its primary

and
argv
so
that
GLUT
can
modify
them,
usually
by
removing
GLUT-specific
command-line
options.
Because
of
this,
it
is
common
to
call
glutInit
at
the
very
start
of
main,
before
other
GLUT
functions,
and
to
pass
the
program’s
real
argc/argv
as
arguments.
or
window
geometry
and
may
strip
these
options
from
argv
as
it
processes
them.
Because
different
implementations
(such
as
freeglut
or
platform-specific
GLUT
variants)
may
support
different
options,
developers
should
refer
to
the
specific
library’s
documentation
for
exact
options
and
behavior.
role
is
to
initialize
the
library
and
the
window
system.
After
glutInit,
a
program
typically
calls
glutInitDisplayMode
to
specify
the
framebuffer
and
buffering
options,
followed
by
glutInitWindowSize
and
glutInitWindowPosition,
and
finally
glutCreateWindow
to
create
the
application
window.
In
short,
glutInit
provides
the
initial
setup
that
enables
subsequent
GLUT
operations.