2013-04-05 17:13:46 +08:00
|
|
|
enum tCCImageFormat
|
2011-06-14 14:31:25 +08:00
|
|
|
{
|
2012-04-26 09:34:42 +08:00
|
|
|
kCCImageFormatJPEG = 0,
|
2012-02-02 14:26:38 +08:00
|
|
|
kCCImageFormatPNG = 1,
|
2013-04-05 17:13:46 +08:00
|
|
|
};
|
2011-06-14 14:31:25 +08:00
|
|
|
|
2012-02-02 14:26:38 +08:00
|
|
|
class CCRenderTexture : public CCNode
|
2011-06-14 14:31:25 +08:00
|
|
|
{
|
2012-02-02 14:26:38 +08:00
|
|
|
CCSprite* getSprite();
|
|
|
|
void setSprite(CCSprite* psprite);
|
2011-06-14 14:31:25 +08:00
|
|
|
|
2012-02-02 14:26:38 +08:00
|
|
|
void begin();
|
2013-04-05 17:13:46 +08:00
|
|
|
void endToLua ();
|
2012-02-02 14:26:38 +08:00
|
|
|
void beginWithClear(float r, float g, float b, float a);
|
2012-06-15 11:46:51 +08:00
|
|
|
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);
|
2011-06-14 14:31:25 +08:00
|
|
|
|
|
|
|
void clear(float r, float g, float b, float a);
|
2012-06-15 11:46:51 +08:00
|
|
|
void clearDepth(float depthValue);
|
|
|
|
void clearStencil(int stencilValue);
|
2012-08-28 15:54:19 +08:00
|
|
|
|
2012-04-26 09:34:42 +08:00
|
|
|
CCImage* newCCImage();
|
2012-08-28 15:54:19 +08:00
|
|
|
|
2012-04-26 09:34:42 +08:00
|
|
|
bool saveToFile(const char *szFilePath);
|
|
|
|
bool saveToFile(const char *name, tCCImageFormat format);
|
2011-06-14 14:31:25 +08:00
|
|
|
|
2013-04-05 17:13:46 +08:00
|
|
|
static CCRenderTexture * create(int w ,int h, CCTexture2DPixelFormat eFormat, GLuint uDepthStencilFormat);
|
2012-06-15 11:46:51 +08:00
|
|
|
static CCRenderTexture * create(int w, int h, CCTexture2DPixelFormat eFormat);
|
|
|
|
static CCRenderTexture * create(int w, int h);
|
2011-06-14 14:31:25 +08:00
|
|
|
};
|