{
  "schemaVersion": "0.11.0",
  "canonical": "https://www.pystone.net/notes/opengl-notes/",
  "atlas": "https://www.pystone.net/?node=opengl-notes#knowledge-atlas",
  "markdown": "https://www.pystone.net/notes/opengl-notes.md",
  "context": "https://www.pystone.net/notes/opengl-notes.context.json",
  "knowledgeVersion": "224c990773de.5fa8af6e39fa",
  "build": {
    "siteCommit": "224c990773de166d23a886306577dd90379529ce",
    "notesCommit": "5fa8af6e39fa3891d1b9b4832bfa6c4e0ecaaf0a",
    "builtAt": "1970-01-01T00:00:00.000Z",
    "version": "224c990773de.5fa8af6e39fa"
  },
  "id": "note:opengl-notes",
  "slug": "opengl-notes",
  "title": "OpenGL",
  "type": "note",
  "visibility": "public",
  "idStability": "rename-stable",
  "author": {
    "name": "Perrin Yong",
    "profile": "https://www.pystone.net/profile/"
  },
  "publisher": {
    "name": "Perrin Yong",
    "profile": "https://www.pystone.net/profile/"
  },
  "aliases": [],
  "summary": "OpenGL",
  "contentRole": "unspecified",
  "isMoc": false,
  "mocRecognition": "none",
  "generated": false,
  "attribution": "unspecified",
  "domain": "10-计算机、信息技术与工程",
  "tags": [],
  "mocs": [],
  "contentHash": "e89adc4c5cfd0de846903106b1e5b2cdfb1ae7c0891dedaa2e2a8d84bf22bb46",
  "assets": [],
  "headings": [
    {
      "depth": 1,
      "text": "OpenGL",
      "anchor": "opengl",
      "citation": "https://www.pystone.net/notes/opengl-notes/#opengl"
    },
    {
      "depth": 2,
      "text": "Overview",
      "anchor": "overview",
      "citation": "https://www.pystone.net/notes/opengl-notes/#overview"
    },
    {
      "depth": 3,
      "text": "什么是OpenGL",
      "anchor": "什么是opengl",
      "citation": "https://www.pystone.net/notes/opengl-notes/#%E4%BB%80%E4%B9%88%E6%98%AFopengl"
    },
    {
      "depth": 3,
      "text": "01状态机上下文环境",
      "anchor": "01状态机上下文环境",
      "citation": "https://www.pystone.net/notes/opengl-notes/#01%E7%8A%B6%E6%80%81%E6%9C%BA%E4%B8%8A%E4%B8%8B%E6%96%87%E7%8E%AF%E5%A2%83"
    },
    {
      "depth": 3,
      "text": "相关程序库",
      "anchor": "相关程序库",
      "citation": "https://www.pystone.net/notes/opengl-notes/#%E7%9B%B8%E5%85%B3%E7%A8%8B%E5%BA%8F%E5%BA%93"
    },
    {
      "depth": 4,
      "text": "Context and window toolkits",
      "anchor": "context-and-window-toolkits",
      "citation": "https://www.pystone.net/notes/opengl-notes/#context-and-window-toolkits"
    },
    {
      "depth": 5,
      "text": "OpenGL Utility Toolkit (GLUT)",
      "anchor": "opengl-utility-toolkit-glut",
      "citation": "https://www.pystone.net/notes/opengl-notes/#opengl-utility-toolkit-glut"
    },
    {
      "depth": 5,
      "text": "freeglut",
      "anchor": "freeglut",
      "citation": "https://www.pystone.net/notes/opengl-notes/#freeglut"
    },
    {
      "depth": 5,
      "text": "GLFW",
      "anchor": "glfw",
      "citation": "https://www.pystone.net/notes/opengl-notes/#glfw"
    },
    {
      "depth": 4,
      "text": "Extension loading libraries",
      "anchor": "extension-loading-libraries",
      "citation": "https://www.pystone.net/notes/opengl-notes/#extension-loading-libraries"
    },
    {
      "depth": 5,
      "text": "GLEW（OpenGL Extension Wrangler）",
      "anchor": "glewopengl-extension-wrangler",
      "citation": "https://www.pystone.net/notes/opengl-notes/#glewopengl-extension-wrangler"
    },
    {
      "depth": 3,
      "text": "OpenGL ES",
      "anchor": "opengl-es",
      "citation": "https://www.pystone.net/notes/opengl-notes/#opengl-es"
    },
    {
      "depth": 3,
      "text": "相关学习网站",
      "anchor": "相关学习网站",
      "citation": "https://www.pystone.net/notes/opengl-notes/#%E7%9B%B8%E5%85%B3%E5%AD%A6%E4%B9%A0%E7%BD%91%E7%AB%99"
    },
    {
      "depth": 2,
      "text": "Getting Started",
      "anchor": "getting-started",
      "citation": "https://www.pystone.net/notes/opengl-notes/#getting-started"
    },
    {
      "depth": 3,
      "text": "环境搭建",
      "anchor": "环境搭建",
      "citation": "https://www.pystone.net/notes/opengl-notes/#%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA"
    },
    {
      "depth": 2,
      "text": "Ref",
      "anchor": "ref",
      "citation": "https://www.pystone.net/notes/opengl-notes/#ref"
    }
  ],
  "claims": [],
  "outgoing": [],
  "incoming": [
    {
      "id": "note:game-graphics-and-runtime",
      "title": "游戏图形与运行时",
      "url": "https://www.pystone.net/notes/game-graphics-and-runtime/",
      "atlas": "https://www.pystone.net/?node=game-graphics-and-runtime#knowledge-atlas",
      "label": "游戏图形与运行时",
      "origin": "explicit",
      "humanReviewed": true,
      "context": "渲染基础中的“OpenGL”导航项",
      "citation": "https://www.pystone.net/notes/game-graphics-and-runtime/#%E6%B8%B2%E6%9F%93%E5%9F%BA%E7%A1%80"
    }
  ],
  "contentMarkdown": "# OpenGL\n\n> 创建时间：2020/10/21 22:27\n\n  * OpenGL\n    * Overview\n      * 什么是OpenGL\n      * 01状态机上下文环境\n      * 相关程序库\n        * Context and window toolkits\n          * OpenGL Utility Toolkit (GLUT)\n          * freeglut\n          * GLFW\n        * Extension loading libraries\n          * GLEW（OpenGL Extension Wrangler）\n      * OpenGL ES\n      * 相关学习网站\n    * Getting Started\n      * 环境搭建\n    * Ref\n\n## Overview\n\n### 什么是OpenGL\n\nOpenGL (Open Graphics Library) 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.\n\n### 01状态机上下文环境\n\n状态机\n状态——当前绘制状态：光照设置，纹理设置\n\n上下文（context）\nGLFW库，把上下文信息赋值给要绘图的窗口\n\n### 相关程序库\n\n早期的 OpenGL 版本会一同发布配套的 GLU库(OpenGL Utility Library)，提供一些同时代硬件尚不支持的简单功能。\n\n#### Context and window toolkits\n\nThese toolkits are designed to create and manage OpenGL windows, and manage input, but little beyond that.\n\n##### OpenGL Utility Toolkit (GLUT)\n\n> An old windowing handler, no longer maintained.\n\n处理OpenGL程序的工具库，负责处理和底层操作系统的调用以及I/O，并包括了以下常见的功能：\n\n  * 定义以及控制视窗\n\n  * 侦测并处理键盘及鼠标的事件\n\n  * 以一个函数调用绘制某些常用的立体图形，例如长方体、球、以及犹他茶壶（实心或只有骨架，如glutWireTeapot()）\n\n  * 提供了简单菜单列的实现\n\n> GLUT的两个主要目的是创建一个跨平台的库（事实上GLUT就是跨平台的），以及简化学习OpenGL的条件。透过GLUT编写OpenGL通常只需要增加几行额外GLUT的代码，而且不需要知道每个不同操作系统处理视窗的API。\n\n##### freeglut\n\nan open-source alternative to the OpenGL Utility Toolkit (GLUT) library.\n\nGLUT (and hence FreeGLUT) allows the user to **create and manage windows containing OpenGL contexts on a wide range of platforms and also read the mouse, keyboard and joystick functions**. FreeGLUT is intended to be a full replacement for GLUT, and has only a few differences.\n\nFreeglut’s API is a **superset** of the GLUT API, and it is more stable and up to date than GLUT.\n\n> 小知识：superset（超集），对应于subset（子集）。如果一个集合S2中的每一个元素都在集合S1中，且集合S1中可能包含S2中没有的元素，则集合S1就是S2的一个超集，反过来，S2是S1的子集。\n\n##### GLFW\n\nGraphics Library Framework（图形库框架） - A cross-platform **windowing** and **keyboard-mouse-joystick handler** ; is more **game-oriented**\n创建并管理窗口和 OpenGL 上下文，同时还提供了处理手柄、键盘、鼠标输入的功能。\n可以代替GLUT\n\n#### Extension loading libraries\n\nGiven the high workload involved in identifying and loading OpenGL extensions, a few libraries have been designed which **load all available extensions and functions automatically**. Examples include **GLEE** , **GLEW** and **glbinding**.\n\n##### GLEW（OpenGL Extension Wrangler）\n\nGLEW是一个跨平台的C++扩展库，是对底层 OpenGL 接口的封装，能自动识别你的平台所支持的全部OpenGL高级扩展函数，让你的代码跨平台。\n\n> glad：和 glew 作用相同，glew 的升级版\n\n### OpenGL ES\n\n**OpenGL for Embedded Systems** ，是三维图形应用程序接口OpenGL的子集，针对手机、PDA和游戏主机等嵌入式设备而设计。\n\n> OpenGL ES是从OpenGL裁剪定制而来的，去除了glBegin/glEnd，四边形（GL_QUADS）、多边形（GL_POLYGONS）等复杂图元等许多非绝对必要的特性。经过多年发展，现在主要有两个版本，OpenGL ES 1.x针对固定管线硬件的，OpenGL ES 2.x针对可编程管线硬件。OpenGL ES 1.0是以OpenGL 1.3规范为基础的，OpenGL ES 1.1是以OpenGL 1.5规范为基础的，它们分别又支持common和common lite两种profile。lite profile只支持定点实数，而common profile既支持定点数又支持浮点数。OpenGL ES 2.0则是参照OpenGL 2.0规范定义的，common profile发布于2005-8，引入了对可编程管线的支持。OpenGL ES 3.0于2012年公布，加入了大量新特性。\n\n### 相关学习网站\n\n官网 www.opengl.org\n一些教程：\nopen.gl\nopengl-tutorial.org\nlearnopengl <https://learnopengl.com/>\n<https://www.khronos.org/opengl/wiki/Getting_Started>\n中文教程：<https://wiki.jikexueyuan.com/project/modern-opengl-tutorial/>\n\n## Getting Started\n\n### 环境搭建\n\n<https://blog.csdn.net/xn4545945/article/details/8579485> 正弦函数\n<https://blog.csdn.net/Jaihk662/article/details/105496707>\n<https://www.cnblogs.com/csu-lmw/p/11587594.html>\n<https://blog.csdn.net/theonegis/article/details/50245459>\n<https://blog.csdn.net/theonegis/article/details/50088155>\n<https://zhuanlan.zhihu.com/p/81951298>\n<https://www.cnblogs.com/msxh/p/9622617.html>\n<https://blog.csdn.net/sigmarising/article/details/80470054>\n\n## Ref\n\n<https://en.wikipedia.org/wiki/OpenGL>\n<https://www.cnblogs.com/msxh/p/9622617.html>\n"
}
