Use Ubuntu to develop OpenGL program 3

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.