mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
Cleaning up Frambuffer.h
This commit is contained in:
parent
9be2a4a9f0
commit
598abe6722
2 changed files with 10 additions and 40 deletions
|
@ -35,6 +35,7 @@ typedef glm::vec4 Vec4;
|
|||
typedef glm::vec3 Vec3;
|
||||
typedef glm::vec2 Vec2;
|
||||
typedef glm::ivec2 Vec2i;
|
||||
typedef glm::uvec2 Vec2u;
|
||||
|
||||
// Description of a scalar type
|
||||
enum Type {
|
||||
|
|
|
@ -18,35 +18,6 @@ namespace gpu {
|
|||
|
||||
typedef Element Format;
|
||||
|
||||
class Viewport {
|
||||
public:
|
||||
int32 width = 1;
|
||||
int32 height = 1;
|
||||
int32 top = 0;
|
||||
int32 left = 0;
|
||||
float zmin = 0.f;
|
||||
float zmax = 1.f;
|
||||
|
||||
Viewport() {}
|
||||
Viewport(int32 w, int32 h, int32 t = 0, int32 l = 0, float zin = 0.f, float zax = 1.f):
|
||||
width(w),
|
||||
height(h),
|
||||
top(t),
|
||||
left(l),
|
||||
zmin(zin),
|
||||
zmax(zax)
|
||||
{}
|
||||
Viewport(const Vec2i& wh, const Vec2i& tl = Vec2i(0), const Vec2& zrange = Vec2(0.f, 1.f)):
|
||||
width(wh.x),
|
||||
height(wh.y),
|
||||
top(tl.x),
|
||||
left(tl.y),
|
||||
zmin(zrange.x),
|
||||
zmax(zrange.y)
|
||||
{}
|
||||
~Viewport() {}
|
||||
};
|
||||
|
||||
class Swapchain {
|
||||
public:
|
||||
// Properties
|
||||
|
@ -147,6 +118,7 @@ public:
|
|||
|
||||
bool validateTargetCompatibility(const Texture& texture, uint32 subresource = 0) const;
|
||||
|
||||
Vec2u getSize() const { return Vec2u(getWidth(), getHeight()); }
|
||||
uint16 getWidth() const;
|
||||
uint16 getHeight() const;
|
||||
uint16 getNumSamples() const;
|
||||
|
@ -157,24 +129,21 @@ public:
|
|||
void resize( uint16 width, uint16 height, uint16 samples = 1 );
|
||||
|
||||
static const uint32 MAX_NUM_RENDER_BUFFERS = 8;
|
||||
static uint32 getMaxNumRenderBuffers() { return MAX_NUM_RENDER_BUFFERS; }
|
||||
|
||||
// Get viewport covering the ful Canvas
|
||||
Viewport getViewport() const { return Viewport(getWidth(), getHeight(), 0, 0); }
|
||||
static uint32 getMaxNumRenderBuffers() { return MAX_NUM_RENDER_BUFFERS; }
|
||||
|
||||
protected:
|
||||
uint16 _width = 0;
|
||||
uint16 _height = 0;
|
||||
uint16 _numSamples = 0;
|
||||
SwapchainPointer _swapchain;
|
||||
|
||||
TextureViews _renderBuffers;
|
||||
TextureView _depthStencilBuffer;
|
||||
|
||||
uint32 _bufferMask = 0;
|
||||
|
||||
uint32 _frameCount = 0;
|
||||
|
||||
SwapchainPointer _swapchain;
|
||||
|
||||
TextureViews _renderBuffers;
|
||||
TextureView _depthStencilBuffer;
|
||||
uint16 _width = 0;
|
||||
uint16 _height = 0;
|
||||
uint16 _numSamples = 0;
|
||||
|
||||
void updateSize(const TexturePointer& texture);
|
||||
|
||||
|
|
Loading…
Reference in a new issue