- Hands-On C++ Game Animation Programming
- Gabor Szauer
- 240字
- 2021-06-30 14:45:47
Adding an OpenGL loader
There is some external code that this chapter depends on, called glad. When you create a new OpenGL context on Windows, it's created with a legacy OpenGL context. The extension mechanism of OpenGL will let you use this legacy context to create a new modern context.
Once the modern context is created, you will need to get function pointers to all OpenGL functions. The functions need to be loaded with wglGetProcAdress, which returns a function pointer.
Loading every OpenGL function in this fashion would be very time-consuming. This is where having an OpenGL loader comes in; glad will do all this work for you. An OpenGL loader is a library or some code that calls wglGetProcAdress on the functions that the OpenGL API defines.
There are several OpenGL loaders available on Windows.; this book will use glad. glad is a small library that consists of only a few files. It has a simple API; you call one function and get access to all the OpenGL functions. glad has a web-based interface; you can find it at https://glad.dav1d.de/.
Important note
When using an X Windows system, such as many popular Linux distributions, the function to load OpenGL functions is glXGetProcAddress. As with Windows, there are OpenGL loaders available for Linux as well. Not all OSes need an OpenGL loader; for example, macOS, iOS, and Android don't need a loader. Both iOS and Android run on OpenGL ES.
- Oracle從新手到高手
- MySQL 8 DBA基礎(chǔ)教程
- FLL+WRO樂高機(jī)器人競賽教程:機(jī)械、巡線與PID
- 劍指MySQL:架構(gòu)、調(diào)優(yōu)與運維
- Getting Started with Hazelcast(Second Edition)
- ASP.NET Core 2 Fundamentals
- 移動互聯(lián)網(wǎng)軟件開發(fā)實驗指導(dǎo)
- 愛上C語言:C KISS
- 零基礎(chǔ)C#學(xué)習(xí)筆記
- Mapping with ArcGIS Pro
- 關(guān)系數(shù)據(jù)庫與SQL Server 2012(第3版)
- Mastering JavaScript Promises
- 深度剖析ApacheDubbo核心技術(shù)內(nèi)幕
- 面向?qū)ο蟪绦蛟O(shè)計教程(C#版)
- Delphi Cookbook