Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Having an issue with "gladLoadGL". I'm getting an error saying it does not take 1 argument

Tags:

opengl

glad

I'm trying to do some openGL tutorials (https://www.glfw.org/docs/latest/quick_guide.html#quick_example) and one of the functions is gladLoadGL. The line of code is "gladLoadGL(glfwGetProcAddress);" however when I try to run I get the error "C2660 'gladLoadGL': function does not take 1 arguments".

I've tried searching online but no one seems to be having the same issue as I am. I've looked into the glad.h file and the function has a warning "Function definition gladLoadGL not found" which maybe where my issue is coming from. When I generated the glad code (https://glad.dav1d.de/) the settings I had where Language C/C++, Specification OpenGL, gl Version 4.6, Profile Core, and Generate a loader was ticked.

gladLoadGL(glfwGetProcAddress);
like image 205
Marnie Rodriguez Avatar asked Jan 26 '23 19:01

Marnie Rodriguez


1 Answers

Use:

a) a loader from an already know API that has a loader, e.g. glfw

gladLoadGLLoader((GLADloadproc) glfwGetProcAddress);

or b) directly:

gladLoadGL();

Notice the different used function.

like image 184
Ripi2 Avatar answered May 19 '23 19:05

Ripi2