update 2 examples

This commit is contained in:
2020-01-21 10:48:25 +08:00
parent c5b5486969
commit 9d92ebb8da
5 changed files with 60 additions and 25 deletions

View File

@@ -16,6 +16,8 @@ constexpr uint32_t SCREEN_HEIGHT=128;
class TestApp:public CameraAppFramework
{
Color4f color;
private:
SceneNode render_root;
@@ -23,6 +25,7 @@ private:
vulkan::Material * material =nullptr;
vulkan::MaterialInstance * material_instance =nullptr;
vulkan::Buffer * ubo_color =nullptr;
vulkan::Renderable *ro_plane_grid,
*ro_cube,
@@ -127,6 +130,14 @@ private:
bool InitUBO()
{
color.Set(1,1,1,1);
ubo_color=device->CreateUBO(sizeof(Vector4f),&color);
db->Add(ubo_color);
material_instance->BindUBO("color_material",ubo_color);
if(!InitCameraUBO(material_instance,"world"))
return(false);