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
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 int get_width() const;
42 int get_height() const;
44 void set_texture(Texture *tex, int idx = 0);
45 void set_depth_texture(Texture *tex);
47 Texture *texture(int idx = 0) const;
48 Texture *depth_texture() const;
50 void set_auto_viewport(bool enable);
51 bool auto_viewport() const;
54 const Mat4 &texture_matrix() const;
57 void set_render_target(RenderTarget *rt);
58 RenderTarget *current_render_target();
60 bool push_render_target(RenderTarget *rt);
61 bool pop_render_target();