draw_triangle_use_UBO迁移到新框架
This commit is contained in:
parent
8436e57ed7
commit
a04adb897e
@ -1 +1 @@
|
||||
Subproject commit 737fe5c80d013f807cbb8f4d333d5a59c82571bc
|
||||
Subproject commit 6fbc7078181cefc7e5da590c2d4ccc70507934b7
|
@ -35,8 +35,6 @@ class TestApp:public WorkObject
|
||||
{
|
||||
private:
|
||||
|
||||
Color4f clear_color =Color4f(0.2f,0.2f,0.2f,1.0f);
|
||||
|
||||
MaterialInstance * material_instance =nullptr;
|
||||
Mesh * render_obj =nullptr;
|
||||
|
||||
@ -48,7 +46,7 @@ private:
|
||||
{
|
||||
mtl::Material2DCreateConfig cfg(PrimitiveType::Triangles,
|
||||
CoordinateSystem2D::Ortho,
|
||||
mtl::WithLocalToWorld::Without);
|
||||
mtl::WithLocalToWorld::With);
|
||||
|
||||
VILConfig vil_config;
|
||||
|
||||
@ -73,7 +71,7 @@ private:
|
||||
|
||||
bool InitVBO()
|
||||
{
|
||||
const auto ext=GetExtent2D();
|
||||
const auto ext=GetExtent();
|
||||
|
||||
for(uint i=0;i<VERTEX_COUNT;i++)
|
||||
{
|
||||
@ -86,6 +84,11 @@ private:
|
||||
{VAN::Position,POSITION_DATA_FORMAT,position_data},
|
||||
{VAN::Color, COLOR_DATA_FORMAT, color_data}
|
||||
});
|
||||
|
||||
SceneNode *scene_root=GetSceneRoot(); ///<取得场景根节点
|
||||
|
||||
scene_root->Add(new SceneNode(render_obj));
|
||||
|
||||
return(render_obj);
|
||||
}
|
||||
|
||||
@ -103,15 +106,6 @@ public:
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
void Render(double delta_time,graph::RenderCmdBuffer *cmd)override
|
||||
{
|
||||
cmd->SetClearColor(0,clear_color);
|
||||
|
||||
cmd->BeginRenderPass();
|
||||
cmd->Render(render_obj);
|
||||
cmd->EndRenderPass();
|
||||
}
|
||||
};//class TestApp:public WorkObject
|
||||
|
||||
int os_main(int,os_char **)
|
||||
|
Loading…
x
Reference in New Issue
Block a user