NVIDIA Jetson TK1学习与开发(八):图文详解OpenGL在Jetson TK1上的安装和使用
最后更新于:2022-04-01 16:04:15
## 图文详解OpenGL在Jetson TK1上的安装和使用
### 1、入门介绍与资源推介
OpenGL(全写Open Graphics Library)是个定义了一个跨编程语言、跨平台的编程接口规格的专业的图形程序接口。它用于三维图像(二维的亦可),是一个功能强大,调用方便的底层图形库。
OpenGL ES (OpenGL for Embedded Systems) 是 OpenGL 三维图形 API 的子集,针对手机、PDA和游戏主机等嵌入式设备而设计。该API由Khronos集团定义推广,Khronos是一个图形软硬件行业协会,该协会主要关注图形和多媒体方面的开放标准。
下面推荐学习OpenGL的一些网址:
**OpenGL tutorial**:[http://www.opengl-tutorial.org/](http://www.opengl-tutorial.org/)
**OpenGL samples**:[https://github.com/NVIDIAGameWorks/OpenGLSamples](https://github.com/NVIDIAGameWorks/OpenGLSamples)
**Cross-platform OpenGL and OpenGL ES samples (for Windows, Android, and Linux)**:[https://developer.nvidia.com/gameworks-opengl-samples](https://developer.nvidia.com/gameworks-opengl-samples)
**OpenGL study documentation**:[http://docs.nvidia.com/gameworks/index.html#gameworkslibrary/graphicssamples/opengl_samples/opengl_index.htm](http://docs.nvidia.com/gameworks/index.html#gameworkslibrary/graphicssamples/opengl_samples/opengl_index.htm)
### 2、OpenGL Graphics and Compute Samples下载
下载地址:[https://developer.nvidia.com/gameworksdownload#?tx=$gameworks,graphics_library$graphics_api,opengl_4.3](https://developer.nvidia.com/gameworksdownload#?tx=$gameworks,graphics_library$graphics_api,opengl_4.3)
如下图所示:

The OpenGL Graphics and Compute Samples pack is a resource for cross-platform OpenGL 4 (GL4) and OpenGL ES 2 and 3 (ES2 and ES3) development, targeting Android, Windows, and Linux (x86/x64 and Linux for Tegra). The samples run on all four target platforms from a single source base.
### 3、OpenGL Samples Prerequisites

### 4、OpenGL Samples Setup Guide
将下载好的gl-graphics-compute-samples-linux-2.0拷贝到Jetson TK1平台中,如下图:


解压samples pack并且把它移到工作目录,如下图:


Install the Linux target pre-requisites:


~~~
sudo apt-get update(this is critical, or else the next line will do nothing)
sudo apt-get install g++
~~~
进入目录make:

生成的apps位于..../samples/bin/linux-arm32/,如下图所示:

### 5、示例演示
进入apps所在的目录后,./xxxx即可,以Bindless Graphics Sample为例,演示结果如下图所示:
