4 #include <gmath/gmath.h>
8 // flags for RenderTarget::create
18 int tex_width, tex_height;
23 // either the depth texture or a dummy depth render target is used
25 unsigned int rbdepth, rbdepth_fmt;
26 Mat4 texmat; // texture matrix to map tex coords from [0,1] to the useful area
35 bool create(int xsz, int ysz, unsigned int fmt = GL_SRGB_ALPHA,
36 unsigned int flags = RT_COLOR | RT_DEPTH);
37 bool create_mrt(int xsz, int ysz, int num, unsigned int fmt = GL_RGB16F,
38 unsigned int flags = RT_COLOR | RT_DEPTH);
41 bool resize(int xsz, int ysz);
43 int get_width() const;
44 int get_height() const;
46 void set_texture(Texture *tex, int idx = 0);
47 void set_depth_texture(Texture *tex);
49 Texture *texture(int idx = 0) const;
50 Texture *depth_texture() const;
52 void set_auto_viewport(bool enable);
53 bool auto_viewport() const;
56 const Mat4 &texture_matrix() const;
59 void set_render_target(RenderTarget *rt);
60 RenderTarget *current_render_target();
62 bool push_render_target(RenderTarget *rt);
63 bool pop_render_target();