如何在Visual C++中使用PictureBox工具箱中的Opengl我没有在Internet上遇到过任何文档您是否知道任何文档,教程,代码示例等等话题?在Visual Studio 2008.net中的PictureBox工具箱上的Opengl
请问您能帮我吗?
如何在Visual C++中使用PictureBox工具箱中的Opengl我没有在Internet上遇到过任何文档您是否知道任何文档,教程,代码示例等等话题?在Visual Studio 2008.net中的PictureBox工具箱上的Opengl
请问您能帮我吗?
我想哟可以渲染到任何窗口上下文。
简单获取HWND并将其用于上下文创建。
void EnableOpenGL(HWND hWnd, HDC * hDC, HGLRC * hRC)
{
PIXELFORMATDESCRIPTOR pfd;
int iFormat;
// get the device context (DC)
*hDC = GetDC(hWnd);
// set the pixel format for the DC
ZeroMemory(&pfd, sizeof(pfd));
pfd.nSize = sizeof(pfd);
pfd.nVersion = 1;
pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL |
PFD_DOUBLEBUFFER;
pfd.iPixelType = PFD_TYPE_RGBA;
pfd.cColorBits = 24;
pfd.cDepthBits = 16;
pfd.iLayerType = PFD_MAIN_PLANE;
iFormat = ChoosePixelFormat(*hDC, &pfd);
SetPixelFormat(*hDC, iFormat, &pfd);
// create and enable the render context (RC)
*hRC = wglCreateContext(*hDC);
wglMakeCurrent(*hDC, *hRC);
}
我设法把它放在图片框,使用this example与modification,你必须只到COpenGL构造改为图片框(以前表格)。但是,无论如何,只有最后一个picturebox才会呈现。仍在努力...