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();
|
||||||
|
|
|
@ -1090,4 +1090,4 @@ void Batch::str(const SpriteFont& font, const String& text, const Vec2& pos, Tex
|
||||||
}
|
}
|
||||||
|
|
||||||
pop_matrix();
|
pop_matrix();
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,4 +22,4 @@ const BlendMode BlendMode::Subtract = BlendMode(
|
||||||
BlendFactor::One,
|
BlendFactor::One,
|
||||||
BlendMask::RGBA,
|
BlendMask::RGBA,
|
||||||
0xffffffff
|
0xffffffff
|
||||||
);
|
);
|
||||||
|
|
|
@ -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();
|
||||||
|
}
|
||||||
|
|
|
@ -38,4 +38,4 @@ VertexFormat::VertexFormat(std::initializer_list<VertexAttribute> attributes, in
|
||||||
}
|
}
|
||||||
|
|
||||||
this->stride = stride;
|
this->stride = stride;
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,4 +91,4 @@ void RenderPass::perform()
|
||||||
|
|
||||||
// perform render
|
// perform render
|
||||||
GraphicsBackend::render(pass);
|
GraphicsBackend::render(pass);
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,4 +36,4 @@ ShaderRef Shader::create(const ShaderData& data)
|
||||||
}
|
}
|
||||||
|
|
||||||
return shader;
|
return shader;
|
||||||
}
|
}
|
||||||
|
|
|
@ -296,4 +296,4 @@ const SpriteFont::Character& SpriteFont::operator[](Codepoint codepoint) const
|
||||||
if (it != m_characters.end())
|
if (it != m_characters.end())
|
||||||
return it->second;
|
return it->second;
|
||||||
return empty;
|
return empty;
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,4 +61,4 @@ Subtexture Subtexture::crop(const Rect& clip) const
|
||||||
crop_info(clip, &dst.source, &dst.frame);
|
crop_info(clip, &dst.source, &dst.frame);
|
||||||
dst.update();
|
dst.update();
|
||||||
return dst;
|
return dst;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,4 +32,4 @@ TextureRef Texture::create(Stream& stream)
|
||||||
TextureRef Texture::create(const FilePath& file)
|
TextureRef Texture::create(const FilePath& file)
|
||||||
{
|
{
|
||||||
return create(Image(file));
|
return create(Image(file));
|
||||||
}
|
}
|
||||||
|
|
|
@ -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