在新开线程示例,加入红色字体代码
UINT CMicroDlg::ThreadshowOpenGL(LPVOID *lParm)
{
CMicroDlg* theDlg = (CMicroDlg*)lParm;
//初始化 gl
CDC* pDC = theDlg->GetDlgItem(IDC_STATIC_DISP_MAP)->GetDC();
HDC hDC = pDC->GetSafeHdc();
HGLRC hglrc = wglCreateContext(hDC);
//wglShareLists(wglGetCurrentContext(), hglrc);
//wglMakeCurrent(hDC, hglrc);
CRect rectPIC;
CStatic *pCtrl = (CStatic*)theDlg->GetDlgItem(IDC_STATIC_DISP_MAP);
pCtrl->GetClientRect(&rectPIC);
theDlg->theStatic->InitGL(hDC, rectPIC);
while (TRUE)
{
if (theDlg->isOpengl)
{
/ / to do。。。。。
}
}
return 0;
}