mirror of
https://github.com/NoelFB/blah.git
synced 2024-11-25 16:18:57 +08:00
removing redundant framebuffer virtual methods
This commit is contained in:
parent
bd9736df03
commit
94f25cea88
|
@ -54,16 +54,16 @@ namespace Blah
|
||||||
virtual const Attachments& attachments() const = 0;
|
virtual const Attachments& attachments() const = 0;
|
||||||
|
|
||||||
// Gets the Attachment at a given index from the FrameBuffer
|
// Gets the Attachment at a given index from the FrameBuffer
|
||||||
virtual TextureRef& attachment(int index) = 0;
|
TextureRef& attachment(int index);
|
||||||
|
|
||||||
// Gets the Attachment at a given index from the FrameBuffer
|
// Gets the Attachment at a given index from the FrameBuffer
|
||||||
virtual const TextureRef& attachment(int index) const = 0;
|
const TextureRef& attachment(int index) const;
|
||||||
|
|
||||||
// Gets the width of the FrameBuffer
|
// Gets the width of the FrameBuffer
|
||||||
virtual int width() const = 0;
|
virtual int width() const;
|
||||||
|
|
||||||
// Gets the height of the FrameBuffer
|
// Gets the height of the FrameBuffer
|
||||||
virtual int height() const = 0;
|
virtual int height() const;
|
||||||
|
|
||||||
// Clears the FrameBuffer
|
// Clears the FrameBuffer
|
||||||
virtual void clear(Color color = Color::black, float depth = 1.0f, u8 stencil = 0, ClearMask mask = ClearMask::All) = 0;
|
virtual void clear(Color color = Color::black, float depth = 1.0f, u8 stencil = 0, ClearMask mask = ClearMask::All) = 0;
|
||||||
|
|
|
@ -278,18 +278,6 @@ namespace
|
||||||
return empty_attachments;
|
return empty_attachments;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual TextureRef& attachment(int index) override
|
|
||||||
{
|
|
||||||
BLAH_ASSERT(false, "Backbuffer doesn't have any attachments");
|
|
||||||
return empty_texture;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual const TextureRef& attachment(int index) const override
|
|
||||||
{
|
|
||||||
BLAH_ASSERT(false, "Backbuffer doesn't have any attachments");
|
|
||||||
return empty_texture;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual int width() const override
|
virtual int width() const override
|
||||||
{
|
{
|
||||||
return App::draw_width();
|
return App::draw_width();
|
||||||
|
|
|
@ -31,3 +31,23 @@ FrameBufferRef FrameBuffer::create(int width, int height, const AttachmentFormat
|
||||||
|
|
||||||
return GraphicsBackend::create_framebuffer(width, height, attachments.data(), attachments.size());
|
return GraphicsBackend::create_framebuffer(width, height, attachments.data(), attachments.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TextureRef& FrameBuffer::attachment(int index)
|
||||||
|
{
|
||||||
|
return attachments()[index];
|
||||||
|
}
|
||||||
|
|
||||||
|
const TextureRef& FrameBuffer::attachment(int index) const
|
||||||
|
{
|
||||||
|
return attachments()[index];
|
||||||
|
}
|
||||||
|
|
||||||
|
int FrameBuffer::width() const
|
||||||
|
{
|
||||||
|
return attachments()[0]->width();
|
||||||
|
}
|
||||||
|
|
||||||
|
int FrameBuffer::height() const
|
||||||
|
{
|
||||||
|
return attachments()[0]->height();
|
||||||
|
}
|
||||||
|
|
|
@ -332,26 +332,6 @@ namespace Blah
|
||||||
return m_attachments;
|
return m_attachments;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual TextureRef& attachment(int index) override
|
|
||||||
{
|
|
||||||
return m_attachments[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual const TextureRef& attachment(int index) const override
|
|
||||||
{
|
|
||||||
return m_attachments[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual int width() const override
|
|
||||||
{
|
|
||||||
return m_attachments[0]->width();
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual int height() const override
|
|
||||||
{
|
|
||||||
return m_attachments[0]->height();
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void clear(Color color, float depth, u8 stencil, ClearMask mask) override
|
virtual void clear(Color color, float depth, u8 stencil, ClearMask mask) override
|
||||||
{
|
{
|
||||||
float col[4] = { color.r / 255.0f, color.g / 255.0f, color.b / 255.0f, color.a / 255.0f };
|
float col[4] = { color.r / 255.0f, color.g / 255.0f, color.b / 255.0f, color.a / 255.0f };
|
||||||
|
|
|
@ -83,26 +83,6 @@ namespace Blah
|
||||||
return m_attachments;
|
return m_attachments;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual TextureRef& attachment(int index) override
|
|
||||||
{
|
|
||||||
return m_attachments[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual const TextureRef& attachment(int index) const override
|
|
||||||
{
|
|
||||||
return m_attachments[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual int width() const override
|
|
||||||
{
|
|
||||||
return m_attachments[0]->width();
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual int height() const override
|
|
||||||
{
|
|
||||||
return m_attachments[0]->height();
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void clear(Color color) override
|
virtual void clear(Color color) override
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -729,26 +729,6 @@ namespace Blah
|
||||||
return m_attachments;
|
return m_attachments;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual TextureRef& attachment(int index) override
|
|
||||||
{
|
|
||||||
return m_attachments[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual const TextureRef& attachment(int index) const override
|
|
||||||
{
|
|
||||||
return m_attachments[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual int width() const override
|
|
||||||
{
|
|
||||||
return m_width;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual int height() const override
|
|
||||||
{
|
|
||||||
return m_height;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void clear(Color color, float depth, u8 stencil, ClearMask mask) override
|
virtual void clear(Color color, float depth, u8 stencil, ClearMask mask) override
|
||||||
{
|
{
|
||||||
int clear = 0;
|
int clear = 0;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user