1
0
Fork 0

GL/WGL: Upgrade to glad2

This commit is contained in:
Henrik Hautakoski 2019-12-22 21:00:05 +01:00
parent 3b27db9435
commit a39069cdb9
No known key found for this signature in database
GPG key ID: 96765B12FEAC4745
6 changed files with 9587 additions and 3221 deletions

View file

@ -9,6 +9,13 @@
namespace sp {
// Can't use GLAD's standard loader function because it
// calls wglGetProcAddress without __stdcall
// that results in some runtime exception.
static GLADapiproc func_loader(const char *name) {
return (GLADapiproc) wglGetProcAddress(name);
}
// Ensure that OpenGL extensions are loaded.
static void ensureExtensionsLoaded(HDC dc)
{
@ -17,11 +24,11 @@ static void ensureExtensionsLoaded(HDC dc)
if (!init) {
init = true;
if (!gladLoadWGL(dc)) {
if (!gladLoadWGL(dc, func_loader)) {
Log::error("Win32: Could not load WGL extensions");
}
if (!gladLoadGL()) {
if (!gladLoaderLoadGL()) {
Log::error("Win32: Could not load OpenGL extensions\n");
}
}