openglcontext

wglCreateContextAttribsARB function crashes

这一生的挚爱 提交于 2019-12-01 10:25:00
问题 I try to write down code from this tutorial. I have the code of InitializeOGL(): bool Ogl::InitializeOGL(bool vSync) { cout<<"Init OpenGL"<<endl; int pixelFormat; PIXELFORMATDESCRIPTOR pixelFormatDescriptor; int result; char *vendorChar, *rendererChar; hDC = GetDC(hWnd); if(!hDC) return false; pixelFormat = ChoosePixelFormat(hDC,&pixelFormatDescriptor); if(pixelFormat==0) return false; result = SetPixelFormat(hDC,pixelFormat,&pixelFormatDescriptor); if(result!=1) return false; HGLRC