我将尝试为您翻译关于IT技术的内容,以下是需要翻译的内容:
当窗口大小改变时,我想调整图形设备缓冲区的大小,但是我无法检测到这个事件。
这是C++ Windows编程。我尝试了:
while(WM_QUIT != msg.message){
if(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)){
switch(msg.message){
case WM_SIZE:
return; //<-- If the program closes because of this return, then I know I found the right statements.
}
//TranslateMessage(&msg);
//DispatchMessage(&msg);
}else{
poly.setConstantBuffer(space.getCamera());
poly.draw(iSize);
graphics.render();
}
}
它没有返回,这意味着不正确。那么捕获调整大小事件的正确方法是什么?