Graphics 版 (精华区)
发信人: killest (victor), 信区: Graphics
标 题: [转载] VC 4.0中使用OpenGL(16)
发信站: 紫 丁 香 (Wed Apr 22 10:30:07 1998), 站内信件
【 以下文字转载自 Programming 讨论区 】
【 原文由 xiaojun 所发表 】
wndClass.hCursor = LoadCursor(NULL, IDC_ARROW);
wndClass.lpszClassName = "HELLO";
if (!RegisterClass(&wndClass)) return FALSE;
}
hwnd = CreateWindow("HELLO", "HELLO",
WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
NULL, NULL, hInstance, NULL);
hDC = GetDC(hwnd);
memset(&pfd, 0, sizeof(pfd));
pfd.nSize = sizeof(pfd);
pfd.nVersion = 1;
pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL;
pfd.iPixelType = PFD_TYPE_RGBA;
pfd.iLayerType = PFD_MAIN_PLANE;
pfd.cDepthBits = 16;
iPixelFormat = ChoosePixelFormat(hDC, &pfd);
SetPixelFormat(hDC, iPixelFormat, &pfd);
hglrc = wglCreateContext(hDC);
ReleaseDC(hwnd, hDC);
ShowWindow(hwnd, nCmdShow);
UpdateWindow(hwnd);
while (GetMessage(&msg, NULL, 0, 0))
--
※ 来源:.紫 丁 香 bbs.hit.edu.cn.[FROM: hs6.hit.edu.cn]
--
※ 转载:.紫 丁 香 bbs.hit.edu.cn.[FROM: victor.hit.edu.c]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:4.144毫秒