axmol/tools/tolua++/CCTexture2D.pkg

87 lines
2.6 KiB
Plaintext

typedef enum {
// kCCTexture2DPixelFormat_Automatic = 0,
//! 32-bit texture: RGBA8888
kCCTexture2DPixelFormat_RGBA8888,
//! 24-bit texture: RGBA888
kCCTexture2DPixelFormat_RGB888,
//! 16-bit texture without Alpha channel
kCCTexture2DPixelFormat_RGB565,
//! 8-bit textures used as masks
kCCTexture2DPixelFormat_A8,
//! 8-bit intensity texture
kCCTexture2DPixelFormat_I8,
//! 16-bit textures used as masks
kCCTexture2DPixelFormat_AI88,
//! 16-bit textures: RGBA4444
kCCTexture2DPixelFormat_RGBA4444,
//! 16-bit textures: RGB5A1
kCCTexture2DPixelFormat_RGB5A1,
//! 4-bit PVRTC-compressed texture: PVRTC4
kCCTexture2DPixelFormat_PVRTC4,
//! 2-bit PVRTC-compressed texture: PVRTC2
kCCTexture2DPixelFormat_PVRTC2,
//! Default texture format: RGBA8888
kCCTexture2DPixelFormat_Default = kCCTexture2DPixelFormat_RGBA8888,
// backward compatibility stuff
// kTexture2DPixelFormat_Automatic = kCCTexture2DPixelFormat_Automatic,
kTexture2DPixelFormat_RGBA8888 = kCCTexture2DPixelFormat_RGBA8888,
kTexture2DPixelFormat_RGB888 = kCCTexture2DPixelFormat_RGB888,
kTexture2DPixelFormat_RGB565 = kCCTexture2DPixelFormat_RGB565,
kTexture2DPixelFormat_A8 = kCCTexture2DPixelFormat_A8,
kTexture2DPixelFormat_RGBA4444 = kCCTexture2DPixelFormat_RGBA4444,
kTexture2DPixelFormat_RGB5A1 = kCCTexture2DPixelFormat_RGB5A1,
kTexture2DPixelFormat_Default = kCCTexture2DPixelFormat_Default
} CCTexture2DPixelFormat;
class ccTexParams {
ccTexParams(void);
GLuint minFilter;
GLuint magFilter;
GLuint wrapS;
GLuint wrapT;
};
class CCTexture2D : public CCObject
{
void releaseData(void* data);
void* keepData(void* data, unsigned int length);
CCTexture2DPixelFormat getPixelFormat();
unsigned int getPixelsWide();
unsigned int getPixelsHigh();
GLuint getName();
CCSize getContentSizeInPixels();
void setMaxS(GLfloat val);
GLfloat getMaxS();
GLfloat getMaxT();
void setMaxT(GLfloat val);
bool hasPremultipliedAlpha();
bool hasMipmaps();
void drawAtPoint(CCPoint point);
void drawInRect(CCRect rect);
CCSize getContentSize(void);
void setTexParameters(ccTexParams* texParams);
void setAntiAliasTexParameters();
void setAliasTexParameters();
void generateMipmap();
const char* stringForFormat();
unsigned int bitsPerPixelForFormat();
unsigned int bitsPerPixelForFormat(CCTexture2DPixelFormat format);
static void setDefaultAlphaPixelFormat(CCTexture2DPixelFormat format);
static CCTexture2DPixelFormat defaultAlphaPixelFormat();
};