GlistEngine
Loading...
Searching...
No Matches
gFbo.h
Go to the documentation of this file.
1/*
2 * gFbo.h
3 *
4 * Created on: 23 Feb 2021
5 * Author: Noyan
6 */
7
8#ifndef GRAPHICS_GFBO_H_
9#define GRAPHICS_GFBO_H_
10
11#include "gRenderObject.h"
12#include "gTexture.h"
13
14
15class gFbo : public gRenderObject {
16public:
18 virtual ~gFbo();
19
20 void allocate(int width, int height, bool isDepthMap = false, bool useDepthTexture = false);
21 unsigned int getId() const;
22 int getWidth() const;
23 int getHeight() const;
24 unsigned int getTextureId() const;
25 unsigned int getDepthTextureId() const;
27
28 void bind();
29 void unbind();
30
31 void draw(int x, int y);
32 void draw(int x, int y, int w, int h);
33 void draw(int x, int y, int w, int h, float rotate);
34 void draw(glm::vec2 position, glm::vec2 size, float rotate = 0.0f);
35
36 void drawSub(int x, int y, int sx, int sy, int sw, int sh);
37 void drawSub(int x, int y, int w, int h, int sx, int sy, int sw, int sh);
38 void drawSub(int x, int y, int w, int h, int sx, int sy, int sw, int sh, float rotate);
39 void drawSub(glm::vec2 pos, glm::vec2 size, glm::vec2 subpos, glm::vec2 subsize, float rotate = 0.0f);
40 void drawSub(const gRect& src, const gRect& dst, float rotate = 0.f);
41
42 static int defaultfbo;
43
44private:
45 unsigned int framebuffer;
46 unsigned int rbo;
47 gTexture* texture;
48 gTexture* depthtexture;
49 int width, height;
50 bool isdepthmap;
51 bool usedepthtexture;
52 bool isallocated;
53
54};
55
56#endif /* GRAPHICS_GFBO_H_ */
Definition gFbo.h:15
unsigned int getDepthTextureId() const
unsigned int getId() const
void draw(int x, int y, int w, int h, float rotate)
void bind()
int getWidth() const
unsigned int getTextureId() const
void allocate(int width, int height, bool isDepthMap=false, bool useDepthTexture=false)
void drawSub(int x, int y, int sx, int sy, int sw, int sh)
void draw(glm::vec2 position, glm::vec2 size, float rotate=0.0f)
void drawSub(int x, int y, int w, int h, int sx, int sy, int sw, int sh, float rotate)
void drawSub(const gRect &src, const gRect &dst, float rotate=0.f)
static int defaultfbo
Definition gFbo.h:42
void draw(int x, int y, int w, int h)
void unbind()
void draw(int x, int y)
virtual ~gFbo()
void drawSub(glm::vec2 pos, glm::vec2 size, glm::vec2 subpos, glm::vec2 subsize, float rotate=0.0f)
gTexture & getTexture()
void drawSub(int x, int y, int w, int h, int sx, int sy, int sw, int sh)
int getHeight() const
Definition gRect.h:27
Definition gRenderObject.h:25
Definition gTexture.h:17