OpenGL源代码

一、总的入口

https://www.khronos.org/opengl/wiki/Getting_Started#Downloading_OpenGL

So you want to take advantage of the power of the OpenGL API? If you are visiting this page because a game or software uses the OpenGL API, you need to install the appropriate graphic driver which enables usage of the functionality provided.

To program using the OpenGL API, you need the driver and the development package (depends on platform and programming language). More platform-specific details are described in the sections below.

 

二、LINUX专用:

https://www.khronos.org/opengl/wiki/Platform_specifics:_Linux

Platform specifics: Linux

This Section explains how to install Drivers to make OpenGL Programs run under Linux and how to use different Libraries/Toolkits to create Opengl Programs.

Mesa is an open-source OpenGL implementation, continually updated to support the latest OpenGL specification.

Direct Rendering Infrastructure, also known as the DRI, is a framework for allowing direct access to graphics hardware under the X Window System in a safe and efficient manner.

http://dri.freedesktop.org/wiki/

Mesa implements EGL 1.4

http://mesa3d.org/egl.html

Mesa implements OpenGL ES 1.1 and OpenGL ES 2.0

http://mesa3d.org/opengles.htmlMesa 11.0.0 implements the OpenGL 4.1 API. OpenGL 4.1 is only available if requested at context creation because compatibility contexts are not supported.

 

 

三、GLEW:

http://glew.sourceforge.net/

The OpenGL Extension Wrangler Library

The OpenGL Extension Wrangler Library (GLEW) is a cross-platform open-source C/C++ extension loading library. GLEW provides efficient run-time mechanisms for determining which OpenGL extensions are supported on the target platform. OpenGL core and extension functionality is exposed in a single header file. GLEW has been tested on a variety of operating systems, including Windows, Linux, Mac OS X, FreeBSD, Irix, and Solaris.

Downloads

GLEW is distributed as source and precompiled binaries.
The latest release is 2.1.0[07-31-17]:

 

 

 Source ZIP |  TGZ 
 Binaries Windows 32-bit and 64-bit 

 

An up-to-date copy is also available using git:

  • github
    git clone https://github.com/nigels-com/glew.git glew
     

Supported Extensions

The latest release contains support for OpenGL 4.6, compatibility and forward-compatible contexts and the following extensions:

News

  • [07-31-17] GLEW 2.1.0 adds support for OpenGL 4.6, new extensions and minor bug fixes
  • [07-24-16] GLEW 2.0.0 adds support for forward-compatible contexts, adds new extensions, OSMesa and EGL support, MX discontinued and minor bug fixes
  • [08-10-15] GLEW 1.13.0 adds support for new extensions, fixes minor bugs
  • [26-01-15] GLEW 1.12.0 fixes minor bugs and adds new extensions
  • [08-11-14] GLEW 1.11.0 adds support for OpenGL 4.5, new extensions
  • [07-22-13] GLEW 1.10.0 adds support for OpenGL 4.4, new extensions
  • [08-06-12] GLEW 1.9.0 adds support for OpenGL 4.3, new extensions
  • [07-17-12] GLEW 1.8.0 fixes minor bugs and adds new extensions
  • [08-26-11] GLEW 1.7.0 adds support for OpenGL 4.2, new extensions, fixes bugs
  • [04-27-11] GLEW 1.6.0 fixes minor bugs and adds eight new extensions
  • [01-31-11] GLEW 1.5.8 fixes minor bugs and adds two new extensions
  • [11-03-10] GLEW 1.5.7 fixes minor bugs and adds one new extension
  • [09-07-10] GLEW 1.5.6 adds support for OpenGL 4.1, fixes bugs

 

 

四、OPENGL ES 源代码(ES 1.1和ES 2.0):

https://www.mesa3d.org/opengles.html

OpenGL ES

Mesa implements OpenGL ES 1.1 and OpenGL ES 2.0. More information about OpenGL ES can be found at https://www.khronos.org/opengles/.

OpenGL ES depends on a working EGL implementation. Please refer to Mesa EGL for more information about EGL.

Build the Libraries

  1. Run configure with --enable-gles1 --enable-gles2 and enable the Gallium driver for your hardware.
  2. Build and install Mesa as usual.

Alternatively, if XCB-DRI2 is installed on the system, one can use egl_dri2 EGL driver with OpenGL|ES-enabled DRI drivers

  1. Run configure with --enable-gles1 --enable-gles2.
  2. Build and install Mesa as usual.

Both methods will install libGLESv1_CM, libGLESv2, libEGL, and one or more EGL drivers for your hardware.

Run the Demos

There are some demos in mesa/demos repository.

Developers

Dispatch Table

OpenGL ES has an additional indirection when dispatching functions

  Mesa:       glFoo() --> _mesa_Foo()
  OpenGL ES:  glFoo() --> _es_Foo() --> _mesa_Foo()

The indirection serves several purposes

  • When a function is in Mesa and the type matches, it checks the arguments and calls the Mesa function.
  • When a function is in Mesa but the type mismatches, it checks and converts the arguments before calling the Mesa function.
  • When a function is not available in Mesa, or accepts arguments that are not available in OpenGL, it provides its own implementation.

Other than the last case, OpenGL ES uses APIspec.xml to generate functions to check and/or converts the arguments.

  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值