GL/WGL: Upgrade to glad2
This commit is contained in:
parent
3b27db9435
commit
a39069cdb9
6 changed files with 9587 additions and 3221 deletions
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue