06-05-2018, 04:15 AM
Hello again. I'm back to this problem again. I've moved all the drawing routines to customWidget draw callback and it partially solved the problem.
Now rendered content is displayed but only on some machines. Namely all machines running on Intel integrated graphic cards still show an empty viewport. If there are any thoughts on what could be causing this or what should I try out I'd be grateful.
Here is a sample code for a redraw callback that simply paints the frame blue.
Now rendered content is displayed but only on some machines. Namely all machines running on Intel integrated graphic cards still show an empty viewport. If there are any thoughts on what could be causing this or what should I try out I'd be grateful.
Here is a sample code for a redraw callback that simply paints the frame blue.
Code:
HDC Hdc = *frame.platformDC();
int nPixelFormat;
PIXELFORMATDESCRIPTOR pfd;
memset(&pfd, 0x00, sizeof(pfd));
pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR);
pfd.dwFlags = PFD_SUPPORT_OPENGL | PFD_TYPE_RGBA;
pfd.iPixelType = PFD_TYPE_RGBA;
pfd.cColorBits = 16;
pfd.cDepthBits = 24;
nPixelFormat = ChoosePixelFormat(Hdc, &pfd);
if (!nPixelFormat)
return;
if (!SetPixelFormat(Hdc, nPixelFormat, &pfd))
return;
HGLRC Hglrc = wglCreateContext(Hdc);
wglMakeCurrent(Hdc, Hglrc);
glClearColor(0, 0, 1, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glFlush();
SwapBuffers(Hdc);
wglDeleteContext(Hglrc);
if (Hdc)
ReleaseDC(mHwnd, Hdc);