The mapping mechanism of OpenGL is OpenGL's drawing style differs from that of windows in general, and the main differences are as follows:(1) Windows uses GDI (Graphy device Interface Graphics Device interface) to draw on the device Description table DC .(2) OpenGL uses OpenGL
For more information, see http://www.cppblog.com/doing5552/archive/2009/01/08/71532.html.
1. Check whether the graphics card of the Local Machine supports OpenGL. The confirmation method is as follows:
Search for the following two files in the system directory (c: \ windows \ system32 by default for WINXP:
Opengl32.dll and glu32.dll, if any, indicate that your video card has implemented the
;int maxTextureSize;int maxLights;int maxAttribStacks;int maxModelViewStacks;int maxProjectionStacks;int maxClipPlanes;int maxTextureStacks;int pixelFormat; // get vendor string str = (char*)glGetString(GL_VENDOR);// get renderer string str = (char*)glGetString(GL_RENDERER);// get version string str = (char*)glGetString(GL_VERSION);// get all extensions as a string str = (char*)glGetString(GL_EXTENSIONS);// get number of color bits glGetIntegerv(GL_RED_BITS, colorBits[0])
, the answer is: Create a cube... then it will crash.
Assume that you have a certain degree of C \ c ++ programming basics, and then you are familiar with QT. If not, it is recommended to take the QT tutorial of bean, although it has not been updated for a long time.Iii. Preparations
First of all, you should configure ubuntu. See my other article :. Create a famous workstation-configure Ubuntu
Then install QT and creater, and enter the terminal:
Sudo apt-Get install qtcreator QT-SDK
Open create
# Include
ThisCodeThe general explanation is as follows:
1. First, add the necessary header file glut. H is included to use the function library provided by OpenGL. 2. display is a callback function written by the Program , used for drawing in a window. After registering it with the help of the main function, each time the image in the window needs to
glsl generated by the CG compiler requires some adjustments to work on the ATI driver. Therefore, an extra conversion is required. Fortunately, these tasks can be completed automatically through the program, and the speed is very fast. For details, refer to klayge's oglshaderobject: converttoglsl. In fact, all shader of klayge only writes one copy (the syntax uses HLSL 11 ), different APIs can be automatically compiled into Native shader for use (com
of work:Open C++builder 6.0. In the menu bar, select components → install package command, as shown in 1-1.
(Click to view larger image) Figure 1-1 Outline of the component installation package
When clicked, you will see the interface shown in
://developer.android.com/reference/javax/microedition/khronos/opengles/GL11Ext.html)
GL11ExtensionPack (http://developer.android.com/reference/javax/microedition/khronos/opengles/GL11ExtensionPack.html)
2. OpenGL ES 2.0 API class
Android. opengl. ELES20 ------ this package provides the OpenGL ES 2.0 interface, which is
. We only have one attribute, so the value is 0. If we have two attributes, A position and a normal direction. If they are all vectors in the 3-dimensional float format, this parameter must be set to (6*4) = 24 byte, And the last parameter is offset, if there are two attributes, this value is 0 for the first attribute, no offset, and 12 for the second attribute.
glDrawArrays(GL_POINTS, 0, 1);
Finally, we call the draw function, which is the starting p
file and Library to the project.
Add the following header files
# Include # Include
Add the following library files (not always used)
Opengl32.lib
Glu32.lib
GLUT. Lib
Glaux. Lib
After the preparation is complete, configure the environment and initialize the environment ~
1. Rewrite the onprecreate function and add member functions and member variables to the View class.
OpenGL requires ws_clipchildren (W
scenario. The atmospheric effect (collectively referred to as "fog") is used to add a depth prompt (depth-cue) and an antialiased effect, perform flat-shading and smoth-shading respectively, and add shadow and texture effects to the scene) A 2D image can be projected onto a 3D object, followed by motion-blurred, angle conversion, depth of field effect (depth-of-field ).Effect. This is a specific example. We can summarize the main graphic operations of OpenG
Android OpenGL ES application (1)
OpenGL has become a "standard" for 3D because it can be used across platforms and has rich interfaces. Almost all 3D games on mobile phones are related to OpenGL.
Of course, Microsoft has direct X, but it can only be used on the Microsoft platform.
) public static native void glDrawArrays( int mode, int first, int count );
We can see that 0 represents the position of the first vertex, and 6 represents six vertices to draw a triangle fan.
Next, we define the color of each vertex as a vertex attribute, which requires two steps: (1) vertex data; (2) Coloring machine. Android learning notes-basic usage of
This is my second learning of OpenGL. My first learning was in the sophomore computer graphics class. It was just a careless look at OpenGL. Now, after two years, I plan to make a complete and systematic learning of OpenGL for three purposes: 1. familiar with OpenGL programm
This is my second learning of OpenGL. My first learning was in the sophomore computer graphics class. It was just a careless look at OpenGL. Now, after two years, I plan to make a complete and systematic learning of OpenGL for three purposes: 1. familiar with OpenGL programm
[Video] Secrets of Embedded Linux/Android driver development (1) Touch Screen driver development and android driver development
Secrets of Embedded Linux/Android driver development (1) Touch Screen
1. OpenGL InstallationOpenGL is not software, as long as there is OpenGL-capable video card, we can install the appropriate driver to enable the OpenGL function of the video card. As shown below:1 sudo apt-get install build-essent
The environment used in this practice is CentOS 7.Reference: http://www.xuebuyuan.com/1472808.htmlOpenGL Development Environment Setup:1.OPENGL Library InstallationOpenGL Library using the Mesa library, install the command:Yum Intall mesa*Mesa Library is an open-source three-dimensional computer graphics library that implements the OpenGL application interface in
When talking about programming and plotting, many people may think of TC # include But have you ever wondered how those colorful PC games were written? Is it based on TC's poor 640*480 resolution and 16 colors? Obviously, this is not the case.
The purpose of this post is to give up TC's old graphic interface and let everyone get in touch with new things.
As one of the mainstream graphics APIs, OpenGL has superior features in some cases than DirectX.
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.