rework examples according to new changes
This commit is contained in:
@@ -73,12 +73,12 @@ namespace OpenVulkano
|
||||
m_uniBuffer.setId = 3;
|
||||
m_drawablesPool.resize(cntDrawables);
|
||||
m_nodesPool.resize(cntDrawables);
|
||||
m_geo.reserve(cntDrawables);
|
||||
m_geo.resize(cntDrawables);
|
||||
m_texturedMat.texture = &Texture::PLACEHOLDER;
|
||||
|
||||
for (uint32_t i = 0; i < cntDrawables; i++)
|
||||
{
|
||||
Geometry* geo = nullptr;
|
||||
Geometry* geo = &m_geo[i];
|
||||
m_nodesPool[i].Init();
|
||||
if (i < quadsCnt)
|
||||
{
|
||||
@@ -94,11 +94,10 @@ namespace OpenVulkano
|
||||
}
|
||||
else
|
||||
{
|
||||
geo = GeometryFactory::MakePyramid(1, 1, glm::vec4(0, 1, 0, 1));
|
||||
*geo = GeometryFactory::MakePyramid(1, 1, glm::vec4(0, 1, 0, 1));
|
||||
m_nodesPool[i].SetMatrix(Math::Utils::translate(glm::mat4x4(1.f), Vector3f(-5 + std::rand() % 5, -5 + std::rand() % 5, -std::rand() % 10)));
|
||||
m_drawablesPool[i].Init(&m_shader, geo, &m_mat, &m_uniBuffer);
|
||||
}
|
||||
m_geo.push_back(geo);
|
||||
m_scene.GetRoot()->AddChild(&m_nodesPool[i]);
|
||||
m_nodesPool[i].AddDrawable(&m_drawablesPool[i]);
|
||||
}
|
||||
@@ -123,10 +122,6 @@ namespace OpenVulkano
|
||||
|
||||
void Close() override
|
||||
{
|
||||
for (Geometry* g: m_geo)
|
||||
{
|
||||
delete g;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -143,7 +138,7 @@ namespace OpenVulkano
|
||||
std::vector<Node> m_nodesPool;
|
||||
Vector3f_SIMD m_position = { 0, 0, -10 };
|
||||
OpenVulkano::Scene::UI::SimpleUi m_ui;
|
||||
std::vector<Geometry*> m_geo;
|
||||
std::vector<Geometry> m_geo;
|
||||
std::shared_ptr<OpenVulkano::Scene::UI::PerformanceInfo> m_perfInfo;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user