cocos2d-x  2.2
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CCConfiguration Class Reference

CCConfiguration contains some openGL variables. More...

#include <CCConfiguration.h>

Inheritance diagram for CCConfiguration:
CCObject CCCopying

Public Member Functions

virtual ~CCConfiguration (void)
int getMaxTextureSize (void) const
 OpenGL Max texture size. More...
 
int getMaxModelviewStackDepth (void) const
 OpenGL Max Modelview Stack Depth. More...
 
int getMaxTextureUnits (void) const
 returns the maximum texture units More...
 
bool supportsNPOT (void) const
 Whether or not the GPU supports NPOT (Non Power Of Two) textures. More...
 
bool supportsPVRTC (void) const
 Whether or not PVR Texture Compressed is supported. More...
 
bool supportsBGRA8888 (void) const
 Whether or not BGRA8888 textures are supported. More...
 
bool supportsDiscardFramebuffer (void) const
 Whether or not glDiscardFramebufferEXT is supported. More...
 
bool supportsShareableVAO (void) const
 Whether or not shareable VAOs are supported. More...
 
bool checkForGLExtension (const std::string &searchName) const
 returns whether or not an OpenGL is supported More...
 
bool init (void)
const char * getCString (const char *key, const char *default_value=NULL) const
 returns the value of a given key as a string. More...
 
bool getBool (const char *key, bool default_value=false) const
 returns the value of a given key as a boolean. More...
 
double getNumber (const char *key, double default_value=0.0) const
 returns the value of a given key as a double. More...
 
CCObjectgetObject (const char *key) const
 returns the value of a given key as a double More...
 
void setObject (const char *key, CCObject *value)
 sets a new key/value pair in the configuration dictionary More...
 
void dumpInfo (void) const
 dumps the current configuration on the console More...
 
void gatherGPUInfo (void)
 gathers OpenGL / GPU information More...
 
void loadConfigFile (const char *filename)
 Loads a config file. More...
 
- Public Member Functions inherited from CCObject
 CCObject (void)
virtual ~CCObject (void)
void release (void)
void retain (void)
CCObjectautorelease (void)
CCObjectcopy (void)
bool isSingleReference (void) const
unsigned int retainCount (void) const
virtual bool isEqual (const CCObject *pObject)
virtual void acceptVisitor (CCDataVisitor &visitor)
virtual void update (float dt)
- Public Member Functions inherited from CCCopying
virtual CCObjectcopyWithZone (CCZone *pZone)

Static Public Member Functions

static CCConfigurationsharedConfiguration (void)
 returns a shared instance of CCConfiguration More...
 
static void purgeConfiguration (void)
 purge the shared instance of CCConfiguration More...
 

Protected Attributes

GLint m_nMaxTextureSize
GLint m_nMaxModelviewStackDepth
bool m_bSupportsPVRTC
bool m_bSupportsNPOT
bool m_bSupportsBGRA8888
bool m_bSupportsDiscardFramebuffer
bool m_bSupportsShareableVAO
GLint m_nMaxSamplesAllowed
GLint m_nMaxTextureUnits
char * m_pGlExtensions
CCDictionarym_pValueDict
- Protected Attributes inherited from CCObject
unsigned int m_uReference
unsigned int m_uAutoReleaseCount

Additional Inherited Members

- Public Attributes inherited from CCObject
unsigned int m_uID
int m_nLuaID

Detailed Description

CCConfiguration contains some openGL variables.

Since
v0.99.0

Constructor & Destructor Documentation

virtual ~CCConfiguration ( void  )
virtual

Member Function Documentation

bool checkForGLExtension ( const std::string &  searchName) const

returns whether or not an OpenGL is supported

void dumpInfo ( void  ) const

dumps the current configuration on the console

void gatherGPUInfo ( void  )

gathers OpenGL / GPU information

bool getBool ( const char *  key,
bool  default_value = false 
) const

returns the value of a given key as a boolean.

If the key is not found, it will return the default value

const char* getCString ( const char *  key,
const char *  default_value = NULL 
) const

returns the value of a given key as a string.

If the key is not found, it will return the default value

int getMaxModelviewStackDepth ( void  ) const

OpenGL Max Modelview Stack Depth.

int getMaxTextureSize ( void  ) const

OpenGL Max texture size.

int getMaxTextureUnits ( void  ) const

returns the maximum texture units

Since
v2.0.0
double getNumber ( const char *  key,
double  default_value = 0.0 
) const

returns the value of a given key as a double.

If the key is not found, it will return the default value

CCObject* getObject ( const char *  key) const

returns the value of a given key as a double

bool init ( void  )
void loadConfigFile ( const char *  filename)

Loads a config file.

If the keys are already present, then they are going to be replaced. Otherwise the new keys are added.

static void purgeConfiguration ( void  )
static

purge the shared instance of CCConfiguration

void setObject ( const char *  key,
CCObject value 
)

sets a new key/value pair in the configuration dictionary

static CCConfiguration*
sharedConfiguration
( void  )
static

returns a shared instance of CCConfiguration

bool supportsBGRA8888 ( void  ) const

Whether or not BGRA8888 textures are supported.

Since
v0.99.2
bool supportsDiscardFramebuffer ( void  ) const

Whether or not glDiscardFramebufferEXT is supported.

Since
v0.99.2
bool supportsNPOT ( void  ) const

Whether or not the GPU supports NPOT (Non Power Of Two) textures.

OpenGL ES 2.0 already supports NPOT (iOS).

Since
v0.99.2
bool supportsPVRTC ( void  ) const

Whether or not PVR Texture Compressed is supported.

bool supportsShareableVAO ( void  ) const

Whether or not shareable VAOs are supported.

Since
v2.0.0

Member Data Documentation

bool m_bSupportsBGRA8888
protected
bool m_bSupportsDiscardFramebuffer
protected
bool m_bSupportsNPOT
protected
bool m_bSupportsPVRTC
protected
bool m_bSupportsShareableVAO
protected
GLint m_nMaxModelviewStackDepth
protected
GLint m_nMaxSamplesAllowed
protected
GLint m_nMaxTextureSize
protected
GLint m_nMaxTextureUnits
protected
char* m_pGlExtensions
protected
CCDictionary* m_pValueDict
protected

The documentation for this class was generated from the following file: