我最近一直在搞乱OpenGL,我注意到每当我试图调整窗口大小时,Windows消息泵就会阻塞,因此每当我点击菜单栏或调整窗口大小时,渲染就会停止.
为了解决这个问题,我正在研究多线程.
我有以下内容:
_beginthread(RenderEntryPoint, 0, 0);
while (!done)
{
PeekMessage(&msg, NULL, NULL, NULL, PM_REMOVE);
if (msg.message == WM_QUIT)
{
done = true;
}
else
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
void RenderEntryPoint(void *args)
{
while (1)
{
//render code
}
}
Run Code Online (Sandbox Code Playgroud)
但是,我的场景没有渲染,我不知道为什么.
| 归档时间: |
|
| 查看次数: |
694 次 |
| 最近记录: |