Files
botw/lib/sead/include/gfx/seadFrameBuffer.h
T
Léo Lam 18c60323a9 Switch to subrepos
git subrepo clone https://github.com/open-ead/sead lib/sead

subrepo:
  subdir:   "lib/sead"
  merged:   "1b66e825d"
upstream:
  origin:   "https://github.com/open-ead/sead"
  branch:   "master"
  commit:   "1b66e825d"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "2f68596"

git subrepo clone (merge) https://github.com/open-ead/nnheaders lib/NintendoSDK

subrepo:
  subdir:   "lib/NintendoSDK"
  merged:   "9ee21399f"
upstream:
  origin:   "https://github.com/open-ead/nnheaders"
  branch:   "master"
  commit:   "9ee21399f"
git-subrepo:
  version:  "0.4.3"
  origin:   "ssh://git@github.com/ingydotnet/git-subrepo"
  commit:   "2f68596"

git subrepo clone https://github.com/open-ead/agl lib/agl

subrepo:
  subdir:   "lib/agl"
  merged:   "7c063271b"
upstream:
  origin:   "https://github.com/open-ead/agl"
  branch:   "master"
  commit:   "7c063271b"
git-subrepo:
  version:  "0.4.3"
  origin:   "ssh://git@github.com/ingydotnet/git-subrepo"
  commit:   "2f68596"

git subrepo clone https://github.com/open-ead/EventFlow lib/EventFlow

subrepo:
  subdir:   "lib/EventFlow"
  merged:   "c35d21b34"
upstream:
  origin:   "https://github.com/open-ead/EventFlow"
  branch:   "master"
  commit:   "c35d21b34"
git-subrepo:
  version:  "0.4.3"
  origin:   "ssh://git@github.com/ingydotnet/git-subrepo"
  commit:   "2f68596"
2022-03-21 21:31:42 +01:00

83 lines
2.8 KiB
C++

#pragma once
#include "gfx/seadColor.h"
#include "math/seadBoundBox.h"
#include "math/seadVector.h"
#include "prim/seadRuntimeTypeInfo.h"
namespace sead
{
class DrawContext;
class DisplayBuffer;
class LogicalFrameBuffer
{
SEAD_RTTI_BASE(LogicalFrameBuffer)
public:
LogicalFrameBuffer(const Vector2f& virtual_size, const BoundBox2f& physical_area)
: mVirtualSize(virtual_size), mPhysicalArea(physical_area)
{
}
LogicalFrameBuffer(const Vector2f& virtual_size, f32 physical_x, f32 physical_y, f32 physical_w,
f32 physical_h)
: mVirtualSize(virtual_size),
mPhysicalArea(physical_x, physical_y, physical_x + physical_w, physical_y + physical_h)
{
}
LogicalFrameBuffer(const Vector2f& virtual_size, f32 physical_x, f32 physical_y, u32 physical_w,
u32 physical_h)
: mVirtualSize(virtual_size),
mPhysicalArea(physical_x, physical_y, physical_x + physical_w, physical_y + physical_h)
{
}
virtual ~LogicalFrameBuffer();
const Vector2f& getVirtualSize() const { return mVirtualSize; }
const BoundBox2f& getPhysicalArea() const { return mPhysicalArea; }
void setVirtualSize(const Vector2f& virtual_size) { mVirtualSize = virtual_size; }
void setPhysicalArea(const BoundBox2f& ph_size)
{
mPhysicalArea.set(ph_size.getMin(), ph_size.getMax());
}
void setPhysicalArea(f32 x, f32 y, f32 w, f32 h) { mPhysicalArea.set(x, y, x + w, y + h); }
void setPhysicalArea(f32 x, f32 y, u32 w, u32 h) { mPhysicalArea.set(x, y, x + w, y + h); }
private:
Vector2f mVirtualSize;
BoundBox2f mPhysicalArea;
};
class FrameBuffer : public LogicalFrameBuffer
{
SEAD_RTTI_OVERRIDE(FrameBuffer, LogicalFrameBuffer)
public:
FrameBuffer(const Vector2f& virtual_size, const BoundBox2f& physical_area)
: LogicalFrameBuffer(virtual_size, physical_area)
{
}
FrameBuffer(const Vector2f& virtual_size, f32 physical_x, f32 physical_y, f32 physical_w,
f32 physical_h)
: LogicalFrameBuffer(virtual_size, physical_x, physical_y, physical_w, physical_h)
{
}
FrameBuffer(const Vector2f& virtual_size, f32 physical_x, f32 physical_y, u32 physical_w,
u32 physical_h)
: LogicalFrameBuffer(virtual_size, physical_x, physical_y, physical_w, physical_h)
{
}
~FrameBuffer() override;
virtual void copyToDisplayBuffer(DrawContext* draw_context,
const DisplayBuffer* display_buffer) const;
virtual void clear(u32 clr_flag, const Color4f& color, f32 depth, u32 stencil) const = 0;
virtual void clearMRT(DrawContext* draw_context, u32 target, const Color4f& color) const;
virtual void bindImpl_() const = 0;
void bind(DrawContext* draw_context) const;
};
} // namespace sead