2013-12-03 09:23:52 +08:00
|
|
|
//
|
|
|
|
// Created by NiTe Luo on 12/2/13.
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __CCNewRenderTexture_H_
|
|
|
|
#define __CCNewRenderTexture_H_
|
|
|
|
|
|
|
|
#include "CCRenderTexture.h"
|
|
|
|
|
|
|
|
NS_CC_BEGIN
|
|
|
|
|
|
|
|
class NewRenderTexture : public RenderTexture
|
|
|
|
{
|
|
|
|
public:
|
2013-12-05 03:54:57 +08:00
|
|
|
static NewRenderTexture* create(int w, int h, Texture2D::PixelFormat eFormat, GLuint uDepthStencilFormat);
|
|
|
|
static NewRenderTexture* create(int w, int h, Texture2D::PixelFormat eFormat);
|
|
|
|
static NewRenderTexture* create(int w, int h);
|
|
|
|
|
|
|
|
void beginWithClear(float r, float g, float b, float a);
|
|
|
|
void beginWithClear(float r, float g, float b, float a, float depthValue);
|
|
|
|
void beginWithClear(float r, float g, float b, float a, float depthValue, int stencilValue);
|
|
|
|
void beginWithClear(float r, float g, float b, float a, float depthValue, int stencilValue, GLbitfield flags);
|
|
|
|
|
|
|
|
virtual void begin() override;
|
|
|
|
virtual void end() override;
|
|
|
|
virtual void draw() override;
|
|
|
|
|
|
|
|
void clearDepth(float depthValue);
|
2013-12-03 09:23:52 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
NewRenderTexture();
|
2013-12-05 03:54:57 +08:00
|
|
|
virtual ~NewRenderTexture();
|
|
|
|
|
|
|
|
void onBegin();
|
|
|
|
void onEnd();
|
2013-12-03 09:23:52 +08:00
|
|
|
|
2013-12-05 03:54:57 +08:00
|
|
|
//Clear render buffer
|
|
|
|
void onClear();
|
|
|
|
void onClearDepth();
|
2013-12-03 09:23:52 +08:00
|
|
|
|
2013-12-05 03:54:57 +08:00
|
|
|
kmMat4 _oldTransMatrix, _oldProjMatrix;
|
|
|
|
kmMat4 _transformMatrix, _projectionMatrix;
|
2013-12-03 09:23:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
NS_CC_END
|
|
|
|
|
|
|
|
#endif //__CCNewRenderTexture_H_
|