vrseasons

diff src/rtarg.h @ 0:393ef1143c9c

VR seasons
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 07 Apr 2015 11:16:56 +0300
parents
children eea1b91dc3d4
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/rtarg.h	Tue Apr 07 11:16:56 2015 +0300
     1.3 @@ -0,0 +1,33 @@
     1.4 +#ifndef RTARG_H_
     1.5 +#define RTARG_H_
     1.6 +
     1.7 +class RenderTarget {
     1.8 +private:
     1.9 +	int xsz, ysz, tex_xsz, tex_ysz;
    1.10 +	unsigned int fbo;
    1.11 +	unsigned int color, depth;
    1.12 +	unsigned int tex_fmt;
    1.13 +
    1.14 +public:
    1.15 +	RenderTarget();
    1.16 +	~RenderTarget();
    1.17 +
    1.18 +	bool create(int xsz, int ysz);
    1.19 +	bool resize(int xsz, int ysz);
    1.20 +	void destroy();
    1.21 +
    1.22 +	bool is_valid() const;
    1.23 +
    1.24 +	unsigned int get_texture() const;
    1.25 +
    1.26 +	int get_width() const;
    1.27 +	int get_height() const;
    1.28 +	int get_tex_width() const;
    1.29 +	int get_tex_height() const;
    1.30 +
    1.31 +	friend void set_render_target(const RenderTarget *rtarg);
    1.32 +};
    1.33 +
    1.34 +void set_render_target(const RenderTarget *rtarg);
    1.35 +
    1.36 +#endif	/* RTARG_H_ */