Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't find gladLoadGL function #81

Closed
sasmaster opened this issue Mar 15, 2017 · 11 comments
Closed

Can't find gladLoadGL function #81

sasmaster opened this issue Mar 15, 2017 · 11 comments
Labels

Comments

@sasmaster
Copy link

Hi.I downloaded the sources from the online generator but I don't see gladLoadGL() function there.

@Shimmen
Copy link

Shimmen commented Mar 15, 2017

Did you specify glad to generate a loader or not? If you specified that it shouldn't generate its own loader it instead generated the function gladLoadGLLoader, where you pass in the loader procedure.

@sasmaster
Copy link
Author

Yes, I did.And it generated still without that func.

@Shimmen
Copy link

Shimmen commented Mar 15, 2017

Interesting. What version of glad are you using? From the master branch, some release, or from the web version? And what language?

@sasmaster
Copy link
Author

Web.Just went to the web page,configured the loader and generated.

@Shimmen
Copy link

Shimmen commented Mar 15, 2017

In the top of the glad.h and glad.c files is a comment looking somewhat like this:

OpenGL loader generated by glad 0.1.13a0 on Wed Mar 15 14:00:02 2017.

Language/Generator: C/C++
Specification: gl
APIs: gl=3.3
Profile: core
Extensions:
    
Loader: True
Local files: False
Omit khrplatform: False

Commandline:
    --profile="core" --api="gl=3.3" --generator="c" --spec="gl" --extensions=""
Online:
    http://glad.dav1d.de/#profile=core&language=c&specification=gl&loader=on&api=gl%3D3.3

Could you post an example of how yours look like?

@sasmaster
Copy link
Author

OpenGL ES loader generated by glad 0.1.13a0 on Wed Mar 15 09:49:44 2017.

Language/Generator: C/C++
Specification: gl
APIs: gles2=2.0
Profile: compatibility

@sasmaster
Copy link
Author

As a sidenote - I generated for ES2.0-3.0

@Shimmen
Copy link

Shimmen commented Mar 15, 2017

I haven't used glad for GLES, but looking at the generated glad.h I see a function with the definition GLAPI int gladLoadGLES2Loader(GLADloadproc). I assume that's the GLES equivalent for the function you are looking for. There is no function for loading with a built-in loader though and it doesn't seem to respect the toggle for it in the web generator. I don't know if that's expected or a bug, but it's pretty strange.

@Dav1dde
Copy link
Owner

Dav1dde commented Mar 15, 2017

gladLoadGL only exists for the GL API, there is no such function for GLES. As @Shimmen correctly pointed out you need to use int gladLoadGLES2Loader(GLADloadproc) and supply your own loader, if you're using GLFW this would be glfwGetProcAddress and for SDL SDL_GL_GetProcAddress.

There is no gladLoadGLES since there is no easy way to implement it (I would need to load the GLES.dll/so for EGL < 1.5 and get a eglGetProcAddress from somewhere). I plan to add a builtin loader for all the supported APIs though.

@knitterJ
Copy link

knitterJ commented Aug 1, 2022

You probably wanted to run getting started program from https://www.glfw.org/docs/latest/quick_guide.html.
It seems that gl.h, that contains gladLoadGL( GLADloadfunc load) can be generated only from the second version of Glad - Glad2 gl API https://gen.glad.sh/. In the first version of Glad this function is declared differently. From the basic stuff, never forget to include gl.c linker file in your project folder and the compilation process.

@bhavithc
Copy link

Just you need to use gladLoadGL((GLADloadfunc)glfwGetProcAddress) instead of gladLoadGLLoader

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants