Move Drawable draw call recording logic out of renderer
This commit is contained in:
25
openVulkanoCpp/Scene/SimpleDrawable.cpp
Normal file
25
openVulkanoCpp/Scene/SimpleDrawable.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#include "SimpleDrawable.hpp"
|
||||
#include <stdexcept>
|
||||
|
||||
namespace openVulkanoCpp::Scene
|
||||
{
|
||||
void SimpleDrawable::Init(Geometry* mesh, Material* material)
|
||||
{
|
||||
if (m_mesh || m_material) throw std::runtime_error("Drawable is already initialized.");
|
||||
m_mesh = mesh;
|
||||
m_material = material;
|
||||
}
|
||||
|
||||
void SimpleDrawable::Init(SimpleDrawable* drawable)
|
||||
{
|
||||
if (m_mesh || m_material) throw std::runtime_error("Drawable is already initialized.");
|
||||
m_mesh = drawable->m_mesh;
|
||||
m_material = drawable->m_material;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user