wglGetProcAddress returns NULL

前端 未结 1 1691
执念已碎
执念已碎 2021-02-10 21:38

I was trying to use WGL_ARB_pbuffer for offscreen rendering with OpenGL,

but I was failed during initialization.

Here is my code.

wglGetExtensionsStringA         


        
1条回答
  •  心在旅途
    2021-02-10 22:21

    wglGetProcAddress requires an OpenGL rendering context; you need to call your wglCreateContext and wglMakeCurrent prior to calling wglGetProcAddress. If you have not already setup an OpenGL context, wglGetProcAddress will always return NULL. If you're not sure if you have an OpenGL context yet (for example, if you're using a 3rd party framework/library), call wglGetCurrentContext and check to make sure it's not returning NULL.

    0 讨论(0)
提交回复
热议问题