【OpenGL】OpenGL 入门

简介

Open Graphics Library (OpenGL) is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics. The API is typically used to interact with a graphics processing unit (GPU), to achieve hardware-accelerated rendering. Silicon Graphics Inc., (SGI) started developing OpenGL in 1991 and released it on June 30, 1992; applications use it extensively in the fields of computer-aided design (CAD), virtual reality, scientific visualization, information visualization, flight simulation, and video games. Since 2006 OpenGL has been managed by the non-profit technology consortium Khronos Group. – Wikipedia

OpenGL 本身并不是一个类似于 OpenCV 那样实现好了的库,而是一套定义好的接口API,一份 technical specification. 具体的实现,则由各硬件厂商自己去搞,也就是各种各样的显卡驱动。

比如说我现在的电脑上,集成显卡上是 Intel 实现的 OpenGL v4.5,

这里写图片描述

OpenGL 本身只关注怎么调用接口实现绘制,在各种不同的设备上,为了使用 OpenGL, 还需要初始化一个相应的 OpenGL 环境。这个环境需要配套的库来实现。

比如在桌面端,对应 macOS,Windows, *unix, 就需要 AGL,WGL,GLX 这些库来建立这个环境。为了在各平台下通用 OpenGL 框架,就有了 glut, GLFW 这样的框架来处理跨平台这样的琐事,关于这些框架的更多细节,看这里

针对手机等嵌入式设备上有专门的 OpenGL ES(OpenGL for Embedded System)
浏览器端有专门的WebGLWebGL 是对 OpenGL ES的 JS 封装,建立环境用的是EGL库。


Ref

猜你喜欢

转载自blog.csdn.net/baishuo8/article/details/81513378