#pragma once #include "Deer/Log.h" #include #include namespace Deer { enum class TextureBufferType { RGBA8, RED_INTEGER }; struct FrameBufferSpecification { unsigned int width, height; unsigned int samples; std::vector frameBufferTextures; bool swapChainTarget = false; FrameBufferSpecification(unsigned int _width, unsigned int _height, std::initializer_list _frameBufferTextures, unsigned int _samples = 1, bool _swapChainTarget = false) : width(_width), height(_height), samples(_samples), frameBufferTextures(_frameBufferTextures), swapChainTarget(_swapChainTarget) { } }; class FrameBuffer { public: virtual ~FrameBuffer() = default; virtual const FrameBufferSpecification& getSpecification() = 0; virtual void bind() = 0; virtual void unbind() = 0; virtual void clear() = 0; virtual void resize(unsigned int width, unsigned int height) = 0; virtual unsigned int getTextureBufferID(int id = 0) = 0; virtual void clearBuffer(unsigned int bufferId, void* data) = 0; virtual int getTextureBufferPixel(int id, unsigned int x, unsigned int y) = 0; static Ref create(const FrameBufferSpecification& spec); }; }