38 lines
871 B
C++
38 lines
871 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 OpenVulkano::Vulkan
|
|
{
|
|
class VulkanCamera : public ICloseable, public IRecordable
|
|
{
|
|
Scene::Camera* m_camera = nullptr;
|
|
UniformBuffer* m_buffer = nullptr;
|
|
|
|
public:
|
|
void Init(Scene::Camera* camera, UniformBuffer* uniformBuffer)
|
|
{
|
|
m_camera = camera;
|
|
m_buffer = uniformBuffer;
|
|
}
|
|
|
|
void Record(VulkanDrawContext* context) override
|
|
{
|
|
m_buffer->Update(m_camera->GetData(), Scene::Camera::SIZE, context->currentImageId);
|
|
m_buffer->Record(context);
|
|
}
|
|
|
|
void Close() override
|
|
{
|
|
m_buffer->Close();
|
|
}
|
|
};
|
|
} |