当前位置:网站首页>glew, glee與 gl glu glut glx glext的區別和關系
glew, glee與 gl glu glut glx glext的區別和關系
2022-04-21 20:10:00 【delacrxoix_xu】
GLEW是一個跨平臺的C++擴展庫,基於OpenGL圖形接口。使用OpenGL的朋友都知道,window目前只支持OpenGL1.1的涵數,但 OpenGL現在都發展到2.0以上了,要使用這些OpenGL的高級特性,就必須下載最新的擴展,另外,不同的顯卡公司,也會發布一些只有自家顯卡才支 持的擴展函數,你要想用這數涵數,不得不去尋找最新的glext.h,有了GLEW擴展庫,你就再也不用為找不到函數的接口而煩惱,因為GLEW能自動識 別你的平臺所支持的全部OpenGL高級擴展涵數。也就是說,只要包含一個glew.h頭文件,你就能使用gl,glu,glext,wgl,glx的全 部函數。GLEW支持目前流行的各種操作系統(including Windows, Linux, Mac OS X, FreeBSD, Irix, and Solaris)。
項目主頁: http://glew.sourceforge.net/
文檔地址: http://glew.sourceforge.net/install.html
下載地址: https://sourceforge.net/project/downloading.php?group_id=67586&filename=glew-1.5.1-src.zip
glu是實用庫,包含有43個函數,函數名的前綴為glu。Glu 為了减輕繁重的編程工作,封裝了OpenGL函數,Glu函數通過調用核心庫的函數,為開發者提供相對簡單的用法,實現一些較為複雜的操作。
glaux是OpenGL輔助庫,包含有31個函數,函數名前綴為aux。這部分函數提供窗口管理、輸入輸出處理以及繪制一些簡單三維物體。
glut是實用工具庫,基本上是用於做窗口界面的,並且是跨平臺(所以有時你喜歡做簡單的demo的話,可以光用glut就ok了)
GLX:OpenGL extension for X.
對於X窗口系統,它所使用的的OpenGL擴展(GLX)是作為OpenGL的一個附件提供的,所有的GLX函數都使用前綴glX。
常見的OpenGL頭文件如下:(Windows系統中可以忽略大小寫的區別,我自己也沒太注意大小寫。同時,文件的路徑可能變化,例如不是<GL/gl.h>而是"gl.h",具體情况要看你到底把頭文件放到哪了)
<GL/gl.h>:OpenGL所使用的函數和常量聲明。
<GL/glu.h>:GLU(OpenGL實用庫)所使用的函數和常量聲明。GLU庫屬於OpenGL標准的一部分。(以下各種庫則不屬於)
<GL/glaux.h>:GLAUX(OpenGL輔助庫)所使用的函數和常量聲明。這個庫提供了創建窗口,處理鍵盤和鼠標事件,設置調色板等OpenGL本身不提供,但在編寫OpenGL程序時又經常用到的功能。目前這個庫已經過時,只有比較少的編譯環境中有提供,例如VC系列。在VC系列編譯器中,使用這個頭文件之前必須使用#include <windows.h>或者具有類似功能的頭文件。
<GL/glut.h>:GLUT(OpenGL實用工具包)所使用的函數和常量聲明。這個庫的功能大致與GLAUX類似,目前許多OpenGL教程使用這個庫來編寫演示程序。一些編譯系統可能不直接提供這個庫(例如VC系列),需要單獨下載安裝。這個頭文件自動包含了<GL/gl.h>和<GL/glu.h>,編程時不必再次包含它們。
<GL/glext.h>:擴展頭文件。因為微軟公司對OpenGL的支持不太積極,VC系列編譯器雖然有<GL/gl.h>這個頭文件,但是裏面只有OpenGL 1.1版本中所規定的內容,而沒有OpenGL 1.2及其以後版本。對當前的計算機配置而言,幾乎都支持OpenGL 1.4版本,更高的則到1.5, 2.0, 2.1,而VC無法直接使用這些功能。為了解决這一問題,就有了<GL/glext.h>頭文件。這個頭文件提供了高版本OpenGL所需要的各種常數聲明以及函數指針聲明。
<GL/wglext.h>:擴展頭文件。與<GL/glext.h>類似,但這個頭文件中只提供適用於Windows系統的各種OpenGL擴展所使用的函數和常量,不適用於其它操作系統。
"glee.h":GLEE開源庫的頭文件。它的出現是因為<GL/glext.h>雖然可以使用高版本的OpenGL函數,但是使用的形式不太方便。GLEE庫則讓高版本的OpenGL函數與其它OpenGL函數在使用上同樣方便。需要注意的是,這個頭文件與<GL/gl.h>是沖突的,在包含"glee.h"之前,不應該包含<GL/gl.h>。
#include <GL/glut.h>
#include "glee.h" // 錯誤,因為glut.h中含有gl.h,它與glee.h沖突
// 但是如果把兩個include順序交換,則正確
"glos.h":雖然這個也時常見到,但我也不知道它到底是什麼,可能是與系統相關的各種功能,也可能只是自己編寫的一個文件。我曾經看到一個glos.h頭文件中只有一句#include <GL/glut.h>。
版权声明
本文为[delacrxoix_xu]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204212001343927.html
边栏推荐
- C# 版本的 计时器类 精确到微秒 秒后保留一位小数 支持年月日时分秒带单位的输出
- How does the Mui tab realize circular rotation
- The difference between English and American pronunciation [turn]
- 05. Prototype mode
- Registration for PMP examination starts in the second half of 2022. Notice
- [2021] number of effective sequences programmed by Tencent autumn recruitment technology post
- 接口非幂等性解决
- webrtc入门:3.使用enumerateDevices获取设备中可用的流媒体
- Redis can send verification codes and limit the number of times sent every day
- Interesting souls are the same. It takes only 2 steps to slide the computer off
猜你喜欢

Interface non idempotent solution

Solution when the port is occupied

Three implementation methods of quick sorting
![[timing] lstnet: a time series prediction model combining CNN, RNN and ar](/img/b7/5b4fb5fc36f72aabfb04eafb941b57.png)
[timing] lstnet: a time series prediction model combining CNN, RNN and ar
C# Mandelbrot和Julia分形图像生成程序更新到2010-9-14版 支持多线程计算 多核处理器

One click installation of ROS and rosdep (no wall)

Redis Foundation

Surface point cloud normal

图像中stride的含义

Comprehensive solution for digital construction of double prevention mechanism in hazardous chemical enterprises
随机推荐
Common sense question bank system is a must for civil servants and knowledgeable people. From programmer to poet
Meaning of stripe in image
Digital business cloud community property platform system solution - easy property management and leveraging potential business opportunities
C# Mandelbrot和Julia分形图像生成程序更新到2010-9-14版 支持多线程计算 多核处理器
URL to download network resources
Dolphin DB vscode plug-in tutorial
redis
Enterprise cross-border e-commerce platform service solution, cross-border e-commerce trade business framework construction, operation and maintenance
How to solve the thread safety problem without locking
JUC queue interface and its implementation class
【verbs】使用ibverbs api注意事项|libibverbs 中 fork() 支持的状态如何?
Use of complex function in MATLAB
How to restore the deleted photos? Four schemes, which is the official guide
Comment déterminer si le BIT nbit de la valeur de type int est 1 ou 0
Three implementation methods of quick sorting
【原】通俗说法所谓数码相机的“动态像素”和“静态像素”背后的故事
05. Prototype mode
JS monitor mobile phone screen rotation (horizontal screen or vertical screen)
Vtkjs introduction
【原】biginteger。大数乘法。大数运算。“无限大数字”乘法。大数乘法两种方法对比