2024-07-01 23:31:18 +08:00
|
|
|
|
#include"VulkanAppFramework.h"
|
|
|
|
|
#include"Gizmo.h"
|
|
|
|
|
|
|
|
|
|
using namespace hgl;
|
|
|
|
|
using namespace hgl::graph;
|
|
|
|
|
|
|
|
|
|
class TestApp:public SceneAppFramework
|
|
|
|
|
{
|
2024-07-29 14:01:10 +08:00
|
|
|
|
StaticMesh *sm=nullptr;
|
|
|
|
|
|
2024-07-01 23:31:18 +08:00
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
bool InitGizmo()
|
|
|
|
|
{
|
2024-07-30 00:47:28 +08:00
|
|
|
|
if(!InitGizmoResource(db))
|
2024-07-01 23:31:18 +08:00
|
|
|
|
return(false);
|
|
|
|
|
|
2024-07-29 14:01:10 +08:00
|
|
|
|
sm=GetGizmoMoveStaticMesh();
|
|
|
|
|
|
2024-07-01 23:31:18 +08:00
|
|
|
|
return(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
bool Init(uint w,uint h)
|
|
|
|
|
{
|
|
|
|
|
if(!SceneAppFramework::Init(w,h))
|
|
|
|
|
return(false);
|
|
|
|
|
|
|
|
|
|
if(!InitGizmo())
|
|
|
|
|
return(false);
|
2024-07-29 14:01:10 +08:00
|
|
|
|
|
|
|
|
|
camera->pos=Vector3f(32,32,32);
|
|
|
|
|
camera_control->SetTarget(Vector3f(0,0,0));
|
|
|
|
|
camera_control->Refresh();
|
|
|
|
|
|
2024-07-30 00:47:28 +08:00
|
|
|
|
SceneNode *sn=sm->GetScene();
|
|
|
|
|
|
|
|
|
|
sn->RefreshMatrix();
|
|
|
|
|
|
|
|
|
|
render_list->Expend(sn);
|
2024-07-01 23:31:18 +08:00
|
|
|
|
|
|
|
|
|
return(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
~TestApp()
|
|
|
|
|
{
|
|
|
|
|
FreeGizmoResource();
|
|
|
|
|
}
|
|
|
|
|
};//class TestApp:public SceneAppFramework
|
|
|
|
|
|
|
|
|
|
int main(int,char **)
|
|
|
|
|
{
|
|
|
|
|
return RunApp<TestApp>(1280,720);
|
|
|
|
|
}
|