Cromon

GxDevice.cpp

Oct 20th, 2012
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.73 KB | None | 0 0
  1.             typedef HGLRC (APIENTRY* PFNWGLCREATECONTEXTATTRIBSARB)(HDC hDc, HGLRC hShareContext, const int* attribList);
  2.             PFNWGLCREATECONTEXTATTRIBSARB wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARB)wglGetProcAddress("wglCreateContextAttribsARB");
  3.             int attribs[] = {
  4.                 WGL_CONTEXT_MAJOR_VERSION_ARB, 4,
  5.                 WGL_CONTEXT_MINOR_VERSION_ARB, 1,
  6.                 WGL_CONTEXT_FLAGS_ARB, WGL_CONTEXT_DEBUG_BIT_ARB,        
  7.                 WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB,
  8.                 0
  9.             };
  10.  
  11.             auto tmpCtx = wglCreateContextAttribsARB(mWindowDC, nullptr, attribs);
  12.             wglMakeCurrent(nullptr, nullptr);
  13.             wglDeleteContext(mRenderContext);
  14.             mRenderContext = tmpCtx;
  15.             W32_CALL(wglMakeCurrent(mWindowDC, mRenderContext));
Advertisement
Add Comment
Please, Sign In to add comment