mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-15 06:00:12 +00:00
33 lines
606 B
C
33 lines
606 B
C
|
|
||
|
#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
|
||
|
|