문제

I am using wlgGetProcAddress to get functions using a context created with wglCreateContext. I have set the context with wglMakeCurrent. I get a valid function pointer for glGetStringi, but I get NULL for glGetString. I thought that glGetString and glGetStringi were introduced in the same version of OpenGL (1.0). Any ideas why I am getting this NULL?

const GLubyte* (*glGetString)(GLenum);
const GLubyte* (*glGetStringi)(GLenum, GLuint);
glGetString = reinterpret_cast<decltype(glGetString)>(wglGetProcAddress("glGetString"));
glGetStringi = reinterpret_cast<decltype(glGetStringi)>(wglGetProcAddress("glGetStringi"));

In case it matters, I have a Radeon HD 7950 with driver version 13.251.0.0.

도움이 되었습니까?

해결책

glGetStringi was introduced much later than 1.0 - I believe it is 3.3. To make things worse, on core 3.3+ profile you can't use glGetString(GL_EXTENSIONS), but required to use glGetStringi, which is unavailable for lower profile versions.

MSDN documentation says wglGetProcAddress only returns addresses for extension functions. And 'extension' in their terms is everything that is not in GL 1.1.

Please read https://www.opengl.org/discussion_boards/showthread.php/168281-Can-t-get-wglGetProcAddress-to-work-in-opengl-3-1

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top