File: GLRenderToTexture.h

package info (click to toggle)
bullet 2.83.7%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 48,772 kB
  • sloc: cpp: 355,312; lisp: 12,087; ansic: 11,969; python: 644; makefile: 116; xml: 27
file content (32 lines) | stat: -rw-r--r-- 606 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

#ifndef GL_RENDER_TO_TEXTURE_H
#define GL_RENDER_TO_TEXTURE_H

///See http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-14-render-to-texture/
#include "OpenGLInclude.h"

enum 
{
	RENDERTEXTURE_COLOR=1,
	RENDERTEXTURE_DEPTH,
};
struct GLRenderToTexture
{
	GLuint m_framebufferName;
	GLuint	m_depthrenderbuffer;
	bool	m_initialized;
	int		m_renderTextureType;
public:
	GLRenderToTexture();
	
	void init(int width, int height, GLuint textureId, int renderTextureType=RENDERTEXTURE_COLOR);
	bool	enable();
	void	disable();
	
	virtual ~GLRenderToTexture();
	
};


#endif //GL_RENDER_TO_TEXTURE_H