11-07-2017, 06:07 AM
Hello. I've encountered a problem that I'm not sure how to deal with yet, so any advice is welcome. I'm using openGL rendering in my plugin, basic workflow for it is something like this:
Initialization:
Then there is some draw routine triggered by hdi::core::Timer.
Something like this:
Everything worked perfectly. However when my Win10 updated to version 1709, build 16299.19 the viewport where image should have been became empty. I've checked for context validity and everything seemed fine. Even more - if I flushed rendered context to an image file, it showed me correct results - image was there, its size corresponded to custom widget size that hosted my context. So it seems that opengl works fine.
Only conclusion that I could think of is that Microsoft changed window lifecycle in this update and now all the rendered stuff gets invalidated somehow. Maybe there is a better place for my draw fuction other than timer triggered callback? Or maybe there are some actions I could take that are not obvious to me right now?
Initialization:
Code:
hdi::core::CustomWidget frame(...args);
CWnd *pWnd = frame.platformWidget();
HWND mHwnd = pWnd->GetSafeHwnd();
HDC mHdc = pWnd->GetDC()->m_hDC;
//set pixel format etc
HGLRC mHglrc = wglCreateContext(mHdc);
wglMakeCurrent(mHdc, mHglrc);
Then there is some draw routine triggered by hdi::core::Timer.
Something like this:
Code:
void Draw()
{
//setup gl
glBegin( ... );
//some rendering
glEnd();
glFlush();
SwapBuffers(mHdc);
}
Everything worked perfectly. However when my Win10 updated to version 1709, build 16299.19 the viewport where image should have been became empty. I've checked for context validity and everything seemed fine. Even more - if I flushed rendered context to an image file, it showed me correct results - image was there, its size corresponded to custom widget size that hosted my context. So it seems that opengl works fine.
Only conclusion that I could think of is that Microsoft changed window lifecycle in this update and now all the rendered stuff gets invalidated somehow. Maybe there is a better place for my draw fuction other than timer triggered callback? Or maybe there are some actions I could take that are not obvious to me right now?