Home » U++ Library support » U++ Widgets - General questions or Mixed problems » [GlCtrl] Integration and use of Glad loader instead of Glew
Re: [GlCtrl] Integration and use of Glad loader instead of Glew [message #54378 is a reply to message #54377] |
Wed, 08 July 2020 16:07   |
 |
Xemuth
Messages: 387 Registered: August 2018 Location: France
|
Senior Member |
|
|
If you want to have a look at how the package looks : https://github.com/Xemuth/UPP-glad
I have try it with OpenGL example (from reference) by replacing every include glew had by a single #include <glad/glad.h> and it worked well (on windows)
I also changed the MakeWGLContext function :
void MakeWGLContext(int depthBits, int stencilBits, int samples)
{
/*...*/
if(pass == 0) {
HGLRC hRC = wglCreateContext(hDC);
wglMakeCurrent(hDC, s_openGLContext);
if(!gladLoadGL()){
RLOG("Failed to load all OpenGL functions");
exit(-1);
}
if(!gladLoadWGL(hDC)){
RLOG("Failed to load Wiggle API");
exit(-1);
}
if ("GLAD_GL_VERSION_2_1") enhanced_mode=true;
wglMakeCurrent(NULL, NULL);
}
/*...*/
}
instead of :
void MakeWGLContext(int depthBits, int stencilBits, int samples)
{
/*...*/
if(pass == 0) {
HGLRC hRC = wglCreateContext(hDC);
wglMakeCurrent(hDC, s_openGLContext);
glewInit();
if (glewIsSupported("GL_VERSION_2_1")) enhanced_mode=true;
wglMakeCurrent(NULL, NULL);
}
/*...*/
}
I don't have made any change for X11 and GTK yet.
If you are interesse in change I can provide a patch file
[Updated on: Sat, 11 July 2020 19:29] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Mon Jun 02 23:02:55 CEST 2025
Total time taken to generate the page: 0.02754 seconds
|