Renderer: Implement Framebuffers
This commit is contained in:
@@ -4,36 +4,38 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef NAZARA_OPENGLRENDERER_VKFRAMEBUFFER_HPP
|
||||
#define NAZARA_OPENGLRENDERER_VKFRAMEBUFFER_HPP
|
||||
#ifndef NAZARA_OPENGLRENDERER_GLFRAMEBUFFER_HPP
|
||||
#define NAZARA_OPENGLRENDERER_GLFRAMEBUFFER_HPP
|
||||
|
||||
#include <Nazara/Prerequisites.hpp>
|
||||
#include <Nazara/OpenGLRenderer/Wrapper/DeviceObject.hpp>
|
||||
|
||||
namespace Nz
|
||||
namespace Nz::GL
|
||||
{
|
||||
namespace Vk
|
||||
class Framebuffer : public DeviceObject<Framebuffer, GL_FRAMEBUFFER>
|
||||
{
|
||||
class Framebuffer : public DeviceObject<Framebuffer, VkFramebuffer, VkFramebufferCreateInfo, VK_OBJECT_TYPE_FRAMEBUFFER>
|
||||
{
|
||||
friend DeviceObject;
|
||||
friend DeviceObject;
|
||||
|
||||
public:
|
||||
Framebuffer() = default;
|
||||
Framebuffer(const Framebuffer&) = delete;
|
||||
Framebuffer(Framebuffer&&) = default;
|
||||
~Framebuffer() = default;
|
||||
public:
|
||||
Framebuffer() = default;
|
||||
Framebuffer(const Framebuffer&) = delete;
|
||||
Framebuffer(Framebuffer&&) noexcept = default;
|
||||
~Framebuffer() = default;
|
||||
|
||||
Framebuffer& operator=(const Framebuffer&) = delete;
|
||||
Framebuffer& operator=(Framebuffer&&) = delete;
|
||||
inline GLenum Check() const;
|
||||
|
||||
private:
|
||||
static inline VkResult CreateHelper(Device& device, const VkFramebufferCreateInfo* createInfo, const VkAllocationCallbacks* allocator, VkFramebuffer* handle);
|
||||
static inline void DestroyHelper(Device& device, VkFramebuffer handle, const VkAllocationCallbacks* allocator);
|
||||
};
|
||||
}
|
||||
inline void Renderbuffer(GLenum attachment, GLenum renderbuffer);
|
||||
inline void Texture2D(GLenum attachment, GLenum textarget, GLuint texture, GLint level = 0);
|
||||
|
||||
Framebuffer& operator=(const Framebuffer&) = delete;
|
||||
Framebuffer& operator=(Framebuffer&&) noexcept = default;
|
||||
|
||||
private:
|
||||
static inline GLuint CreateHelper(OpenGLDevice& device, const Context& context);
|
||||
static inline void DestroyHelper(OpenGLDevice& device, const Context& context, GLuint objectId);
|
||||
};
|
||||
}
|
||||
|
||||
#include <Nazara/OpenGLRenderer/Wrapper/Framebuffer.inl>
|
||||
|
||||
#endif // NAZARA_OPENGLRENDERER_VKFRAMEBUFFER_HPP
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user