How to build a complete OpenGL Development Environment on windows?

Source: Internet
Author: User
1. OpenGL Overview

OpenGL is essentially a programming interface (API) Standard for computer graphics. This standard is standardized in C language and specifies the prototype and name of the function and the global variable. Currently, this specification has been implemented on various platforms. Mesa3d is available on Linux + X. Although its name is not OpenGL, it fully complies with OpenGL specifications. The mesa3d update speed is very timely, basically keeping pace with the development of OpenGL standards, so if you develop OpenGL on the Linux platformProgramAs long as this database is available.

On the Windows platform, Microsoft once provided great support for the opengl32.lib and glu32.lib libraries. However, since Microsoft moved away from the OpenGL Association's direct3d development, the two libraries have never been updated. Currently, only opengl1.1 is supported, and the latest OpenGL specification reaches 3.0 (2009 ).

 

2. Export OpenGL functions supported by the graphics card driver

So, does it mean that we can only use opengl1.1 APIs to develop OpenGL programs on the Windows platform? No. In fact, opengl32.lib and glu32.lib do not implement OpenGL functions. Instead, they export the functions from the graphics card driver (provided by the graphics card supplier. All graphics card drivers in windows are constantly updated and follow the new version specifications of OpenGL. However, these new functions are not exported to developers (this export cannot be provided by graphics card providers, in that case, due to the large number of manufacturers, it is difficult to regulate ). To use functions that exist but are not exported, we have two methods.

2.1 manually export the OpenGL function to be used

That is, through

 

Hmoudle = loadlibray ("graphics card driver. dll ");

GL * = getprocaddress (hmoudle, name of the function to be exported );

GL *(...);

The biggest disadvantage of doing so is the trouble. It is useless to export a function.

 

2.2 Use existing extension Library

Some good people have developed extension libraries, such as glew. As long as the glew. h file is included during development, any OpenGL functions supported by the graphics card driver can be used directly. The main task of glew is to use the glewinit () function to export functions supported by all graphics cards. Enable developmentCodeAs follows:

Glewinit ();

GL *(...);

 

 

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.