Files
OpenVulkano/openVulkanoCpp/Vulkan/Scene/VulkanCamera.hpp

38 lines
864 B
C++

/*
* 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/.
*/
#pragma once
#include "Base/ICloseable.hpp"
#include "IRecordable.hpp"
#include "Vulkan/Resources/UniformBuffer.hpp"
namespace openVulkanoCpp::Vulkan
{
class VulkanCamera : public ICloseable, public IRecordable
{
Scene::Camera* camera = nullptr;
UniformBuffer* buffer = nullptr;
public:
void Init(Scene::Camera* camera, UniformBuffer* uniformBuffer)
{
this->camera = camera;
buffer = uniformBuffer;
}
void Record(VulkanDrawContext* context) override
{
buffer->Update(camera->GetData(), Scene::Camera::SIZE, context->currentImageId);
buffer->Record(context);
}
void Close() override
{
buffer->Close();
}
};
}