1.win平台增加WaitMessage实现和调用
2.Window类增加IsVisible函数用于返回当前是否需要显示 3.WIndow类增加Update函数,用于处理是否绘制的问题
This commit is contained in:
@@ -82,9 +82,18 @@ public:
|
||||
device->QueuePresent();
|
||||
}
|
||||
|
||||
virtual void Draw()=0;
|
||||
|
||||
bool Run()
|
||||
{
|
||||
win->MessageProc();
|
||||
return !win->IsClose();
|
||||
if(!win->Update())return(false);
|
||||
|
||||
if(win->IsVisible())
|
||||
{
|
||||
AcquireNextFrame();
|
||||
Draw();
|
||||
}
|
||||
|
||||
return(true);
|
||||
}
|
||||
};//class VulkanApplicationFramework
|
||||
|
@@ -157,9 +157,8 @@ public:
|
||||
return(true);
|
||||
}
|
||||
|
||||
void Draw()
|
||||
void Draw() override
|
||||
{
|
||||
AcquireNextFrame();
|
||||
Submit(cmd_buf[device->GetCurrentFrameIndices()]);
|
||||
}
|
||||
};//class TestApp:public VulkanApplicationFramework
|
||||
@@ -176,8 +175,7 @@ int main(int,char **)
|
||||
if(!app.Init())
|
||||
return(-1);
|
||||
|
||||
while(app.Run())
|
||||
app.Draw();
|
||||
while(app.Run());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user