6

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);
Marnie Rodriguez
  • 431
  • 2
  • 8
  • 22

1 Answers1

14

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.

Ripi2
  • 7,031
  • 1
  • 17
  • 33