// Copyright (C) 2015 Jérôme Leclercq // This file is part of the "Nazara Engine - Renderer module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once #ifndef NAZARA_RENDERBUFFER_HPP #define NAZARA_RENDERBUFFER_HPP #include #include #include #include #include #include #include namespace Nz { class RenderBuffer; using RenderBufferConstRef = ObjectRef; using RenderBufferLibrary = ObjectLibrary; using RenderBufferRef = ObjectRef; class NAZARA_RENDERER_API RenderBuffer : public RefCounted { friend RenderBufferLibrary; friend class Renderer; public: RenderBuffer(); RenderBuffer(const RenderBuffer&) = delete; RenderBuffer(RenderBuffer&&) = delete; ~RenderBuffer(); bool Create(PixelFormatType format, unsigned int width, unsigned int height); void Destroy(); unsigned int GetHeight() const; PixelFormatType GetFormat() const; unsigned int GetWidth() const; // Fonctions OpenGL unsigned int GetOpenGLID() const; bool IsValid() const; RenderBuffer& operator=(const RenderBuffer&) = delete; RenderBuffer& operator=(RenderBuffer&&) = delete; template static RenderBufferRef New(Args&&... args); // Signals: NazaraSignal(OnRenderBufferDestroy, const RenderBuffer* /*renderBuffer*/); NazaraSignal(OnRenderBufferRelease, const RenderBuffer* /*renderBuffer*/); private: static bool Initialize(); static void Uninitialize(); PixelFormatType m_pixelFormat; unsigned int m_height; unsigned int m_id; unsigned int m_width; static RenderBufferLibrary::LibraryMap s_library; }; } #include #endif // NAZARA_RENDERBUFFER_HPP