reduced codes of rf_test.cpp
This commit is contained in:
parent
053e579071
commit
0735e783e6
2
CMCore
2
CMCore
@ -1 +1 @@
|
|||||||
Subproject commit e475de1692f5554f8e8c7e1a8f4eb73f8a297d55
|
Subproject commit 9dd89aa5a34ef90b983895d32645df9b53cce955
|
@ -1 +1 @@
|
|||||||
Subproject commit 4129ab24175c44fdb3d00608b80548c2b874fdd8
|
Subproject commit 2370ba12d7656da491f65be66d9e134484377866
|
@ -15,25 +15,19 @@ constexpr uint32_t SCREEN_HEIGHT=720;
|
|||||||
|
|
||||||
constexpr uint32_t VERTEX_COUNT=3;
|
constexpr uint32_t VERTEX_COUNT=3;
|
||||||
|
|
||||||
constexpr float position_data_float[VERTEX_COUNT*2]=
|
constexpr float position_data[VERTEX_COUNT*2]=
|
||||||
{
|
{
|
||||||
0.0, -0.5,
|
0.0, -0.5,
|
||||||
-0.5, 0.5,
|
-0.5, 0.5,
|
||||||
0.5, 0.5
|
0.5, 0.5
|
||||||
};
|
};
|
||||||
|
|
||||||
constexpr VkFormat PositionFormat=VF_V2F;
|
|
||||||
|
|
||||||
#define position_data position_data_float
|
|
||||||
|
|
||||||
constexpr float color_data[VERTEX_COUNT*4]=
|
constexpr float color_data[VERTEX_COUNT*4]=
|
||||||
{ 1,0,0,1,
|
{ 1,0,0,1,
|
||||||
0,1,0,1,
|
0,1,0,1,
|
||||||
0,0,1,1
|
0,0,1,1
|
||||||
};
|
};
|
||||||
|
|
||||||
constexpr VkFormat ColorFormat=VF_V4F;
|
|
||||||
|
|
||||||
class TestApp:public WorkObject
|
class TestApp:public WorkObject
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
@ -49,7 +43,7 @@ private:
|
|||||||
|
|
||||||
bool InitAutoMaterial()
|
bool InitAutoMaterial()
|
||||||
{
|
{
|
||||||
mtl::Material2DCreateConfig cfg(GetDeviceAttribute(),"VertexColor2d",Prim::Triangles);
|
mtl::Material2DCreateConfig cfg(GetDeviceAttribute(),"VertexColor2D",Prim::Triangles);
|
||||||
|
|
||||||
cfg.coordinate_system=CoordinateSystem2D::NDC;
|
cfg.coordinate_system=CoordinateSystem2D::NDC;
|
||||||
cfg.local_to_world=false;
|
cfg.local_to_world=false;
|
||||||
@ -77,8 +71,8 @@ private:
|
|||||||
|
|
||||||
rpc.Init("Triangle",VERTEX_COUNT);
|
rpc.Init("Triangle",VERTEX_COUNT);
|
||||||
|
|
||||||
if(!rpc.WriteVAB(VAN::Position, PositionFormat, position_data))return(false);
|
if(!rpc.WriteVAB(VAN::Position, VF_V2F, position_data))return(false);
|
||||||
if(!rpc.WriteVAB(VAN::Color, ColorFormat, color_data ))return(false);
|
if(!rpc.WriteVAB(VAN::Color, VF_V4F, color_data ))return(false);
|
||||||
|
|
||||||
render_obj=db->CreateRenderable(&rpc,material_instance,pipeline);
|
render_obj=db->CreateRenderable(&rpc,material_instance,pipeline);
|
||||||
return(render_obj);
|
return(render_obj);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user