0

I have been having issues with the function "gladLoadGLLoader" in which I have been passing (GLADloadproc)wglGetProcAddress. I learned that this is because wglGetProcAddress only does functions from OpenGL 1.1+ and GetProcAddress does functions from OpenGL 1.0 and 1.1. How would one go about loading everything with Glad. And, please, do not suggest something like glfw because I like to manage windowing and input myself. Everything works from creating the context up until loading Glad. And, yes, I have bound the context.

genpfault
  • 51,148
  • 11
  • 85
  • 139
Evan
  • 31
  • 3
  • Could you get it to work with glad's own loader, `gladLoadGL()`? You'll have to include it when generating your glad files. – fordcars Feb 17 '22 at 01:26
  • @fordcars I tried just doing gladLoadGL but I still got the same result. The screen is still white after I clear it do a greenish color – Evan Feb 17 '22 at 01:45
  • Your issue *may* be somewhere else. Normally, using gl functions without loading them correctly causes a hard crash. Does `gladLoadGL()` return true or false? Can you get the GL version with `glGetString(GL_VERSION)`? – fordcars Feb 17 '22 at 01:51
  • There are a bunch of other loading libraries that don't deal with anything else: https://www.khronos.org/opengl/wiki/OpenGL_Loading_Library take your pick. – n0rd Feb 17 '22 at 01:53
  • @fordcars it returns true and the version is 4.6 – Evan Feb 17 '22 at 02:41
  • @Evan this would indicate there is an issue somewhere else. You might want to look at different resources about clearing your context. Don't forget to [swap buffers](https://learn.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-swapbuffers)! – fordcars Feb 17 '22 at 02:45
  • Here is a link that could help: https://www.khronos.org/opengl/wiki/Tutorial:_OpenGL_3.1_The_First_Triangle_(C%2B%2B/Win) – fordcars Feb 17 '22 at 02:48

0 Answers0