Gluinit function:
First, the command line parameters of the main function must be passed to the gluinit function. This function initializes the glut library. Http://www.opengl.org/documentation/specs/glut/spec3/node10.html
If the following parameters are included in the parameters passed to main, they will be extracted by gluinit and used as the initialization glut library for trial use. These parameters are deleted from the argcp pointer when the gluinit function returns.
-Display display
-Geometry w x H + x + y
-Iconic
-Indirect
-Direct
-Gldebug
-Sync
If the gluinit function failsProgramEnd.
The environment variable display is used to set where the image is displayed. Format: Host: NUMA. numb
Directly log on to the graphic interface or log on to the command line interface and use startx to start the image. The display environment variable is automatically set to 0: 0. If the host is empty, the xserver runs on the local machine, and the graphics program (xclient) connects to the xserver using UNIX socket instead of TCP.
NUMA value:
When a TCP connection is used, numa is the connected port minus the value of 6000. If NUMA is 0, it indicates that it is connected to Port 6000;
When you connect using UNIX socket, it indicates the path of the connected UNIX socket. If it is 0, it indicates connecting to/tmp/. X11-unix/x0.
Numb is almost always 0.
You can use the following command to view the environment variable display
Chenshu @ chenshu-desktop :~ $ ENV | grep display
Display =: 0.0
The format of passing parameters is as follows: (Note that there is a space behind-display)
-Display: 0.0
In this way, three parameters are passed in. After the return result of the gluinit function, the parameter is changed to one. -Display: the two parameters 0.0 are removed.
-Geometry is used to determine the position of a window. The function is the same as that of gluinitwindowsize or gluinitwindowposition.
Other parameters will be introduced later