mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-12 02:40:00 +01:00
36 lines
753 B
C++
36 lines
753 B
C++
#ifndef FRAMEBUFFER_H
|
|
#define FRAMEBUFFER_H
|
|
|
|
#include "Scene.h"
|
|
|
|
|
|
class FrameBuffer {
|
|
|
|
public:
|
|
FrameBuffer(uint width, uint height, bool useDepthBuffer = false);
|
|
~FrameBuffer();
|
|
|
|
// bind the FrameBuffer as current to draw into
|
|
void bind();
|
|
// releases the framebuffer object
|
|
static void release();
|
|
// blit copy to another, returns true on success
|
|
bool blit(FrameBuffer *other);
|
|
|
|
inline uint width() const { return width_; }
|
|
inline uint height() const { return height_; }
|
|
inline uint texture() const { return textureid_; }
|
|
float aspectRatio() const;
|
|
|
|
private:
|
|
void checkFramebufferStatus();
|
|
uint width_;
|
|
uint height_;
|
|
uint textureid_;
|
|
uint framebufferid_;
|
|
};
|
|
|
|
|
|
|
|
#endif // FRAMEBUFFER_H
|