Hello. While porting my project to the latest framework version (Windows, x64) I have encountered a difficulty that I don't know how to solve. My plugin had an openGL viewport that I created out of CustomWidget like this:
Then after some setup I used mHdc device context to initiate an opengl rendering context
However after porting to hdi_core 0.7.0 when I try to retrieve device contect with GetDC(mHwnd) I get a null pointer. GetLastError function retrieves ERROR_INVALID_WINDOW_HANDLE error code. I'm not really shure what to do to fix this error and retrieve device context. What can possibly cause it? Maybe there is a better way framework-wise to create an opengl context? Any advice is welcome.
Code:
hdi::core::CustomWidget frame = hdi::core::CustomWidget(hdi::core::Rect(5, 75, 550, 520));
HWND mHwnd = (HWND)frame.platformWidget();
HDC mHdc = GetDC(mHwnd);
Then after some setup I used mHdc device context to initiate an opengl rendering context
Code:
HGLRC mHglrc = wglCreateContext(mHdc);
However after porting to hdi_core 0.7.0 when I try to retrieve device contect with GetDC(mHwnd) I get a null pointer. GetLastError function retrieves ERROR_INVALID_WINDOW_HANDLE error code. I'm not really shure what to do to fix this error and retrieve device context. What can possibly cause it? Maybe there is a better way framework-wise to create an opengl context? Any advice is welcome.