Cocos2d-x  v3.10
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups
Configuration Class Reference

Configuration contains some openGL variables. More...

Inherits Ref.

Public Member Functions

virtual ~Configuration ()
 Destructor.
 
int getMaxTextureSize () const
 OpenGL Max texture size. More...
 
local getMaxTextureSize ()
 OpenGL Max texture size. More...
 
int getMaxModelviewStackDepth () const
 OpenGL Max Modelview Stack Depth. More...
 
local getMaxModelviewStackDepth ()
 OpenGL Max Modelview Stack Depth. More...
 
int getMaxTextureUnits () const
 Returns the maximum texture units. More...
 
local getMaxTextureUnits ()
 Returns the maximum texture units. More...
 
bool supportsNPOT () const
 Whether or not the GPU supports NPOT (Non Power Of Two) textures. More...
 
bool supportsPVRTC () const
 Whether or not PVR Texture Compressed is supported. More...
 
bool supportsETC () const
 Whether or not ETC Texture Compressed is supported. More...
 
local supportsETC ()
 Whether or not ETC Texture Compressed is supported. More...
 
bool supportsS3TC () const
 Whether or not S3TC Texture Compressed is supported. More...
 
local supportsS3TC ()
 Whether or not S3TC Texture Compressed is supported. More...
 
bool supportsATITC () const
 Whether or not ATITC Texture Compressed is supported. More...
 
local supportsATITC ()
 Whether or not ATITC Texture Compressed is supported. More...
 
bool supportsBGRA8888 () const
 Whether or not BGRA8888 textures are supported. More...
 
local supportsBGRA8888 ()
 Whether or not BGRA8888 textures are supported. More...
 
bool supportsDiscardFramebuffer () const
 Whether or not glDiscardFramebufferEXT is supported. More...
 
local supportsDiscardFramebuffer ()
 Whether or not glDiscardFramebufferEXT is supported. More...
 
bool supportsShareableVAO () const
 Whether or not shareable VAOs are supported. More...
 
local supportsShareableVAO ()
 Whether or not shareable VAOs are supported. More...
 
int getMaxSupportDirLightInShader () const
 Max support directional light in shader, for Sprite3D. More...
 
local getMaxSupportDirLightInShader ()
 Max support directional light in shader, for Sprite3D. More...
 
int getMaxSupportPointLightInShader () const
 Max support point light in shader, for Sprite3D. More...
 
local getMaxSupportPointLightInShader ()
 Max support point light in shader, for Sprite3D. More...
 
int getMaxSupportSpotLightInShader () const
 Max support spot light in shader, for Sprite3D. More...
 
local getMaxSupportSpotLightInShader ()
 Max support spot light in shader, for Sprite3D. More...
 
Animate3DQuality getAnimate3DQuality () const
 get 3d animate quality 3d animate quality. More...
 
local getAnimate3DQuality ()
 get 3d animate quality 3d animate quality. More...
 
bool checkForGLExtension (const std::string &searchName) const
 Returns whether or not an OpenGL is supported. More...
 
local checkForGLExtension ( local searchName)
 Returns whether or not an OpenGL is supported. More...
 
bool init ()
 Initialize method. More...
 
local init ()
 Initialize method. More...
 
const Value & getValue (const std::string &key, const Value &defaultValue=Value::Null) const
 Returns the value of a given key as a double. More...
 
local getValue ( local key, local Null)
 Returns the value of a given key as a double. More...
 
void setValue (const std::string &key, const Value &value)
 Sets a new key/value pair in the configuration dictionary. More...
 
std::string getInfo () const
 Returns the Configuration info. More...
 
void gatherGPUInfo ()
 Gathers OpenGL / GPU information.
 
local gatherGPUInfo ()
 Gathers OpenGL / GPU information.
 
void loadConfigFile (const std::string &filename)
 Loads a config file. More...
 
local loadConfigFile ( local filename)
 Loads a config file. More...
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
local retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Refautorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
local getReferenceCount ()
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 Destructor.
 

Static Public Member Functions

static ConfigurationgetInstance ()
 Returns a shared instance of Configuration. More...
 
static void destroyInstance ()
 Purge the shared instance of Configuration.
 
local destroyInstance ()
 Purge the shared instance of Configuration.
 
static ConfigurationsharedConfiguration ()
local sharedConfiguration ()
static void purgeConfiguration ()
local purgeConfiguration ()

Additional Inherited Members

- Public Attributes inherited from Ref
unsigned int _ID
 object id, ScriptSupport need public _ID
 
local _ID
 object id, ScriptSupport need public _ID
 
int _luaID
 Lua reference id.
 
local _luaID
 Lua reference id.
 
void * _scriptObject
 scriptObject, support for swift
 
local _scriptObject
 scriptObject, support for swift
 
bool _rooted
 When true, it means that the object was already rooted.
 
local _rooted
 When true, it means that the object was already rooted.
 
bool _scriptOwned
 The life of the object is scrolled by the scripting engine. More...
 
local _scriptOwned
 The life of the object is scrolled by the scripting engine. More...
 

Detailed Description

Configuration contains some openGL variables.

Member Function Documentation

static Configuration* getInstance ( )
static

Returns a shared instance of Configuration.

An autoreleased Configuration object.

local getInstance ( )
static

Returns a shared instance of Configuration.

An autoreleased Configuration object.

static Configuration*
sharedConfiguration
( )
static
local sharedConfiguration ( )
static
static void purgeConfiguration ( )
static
local purgeConfiguration ( )
static
int getMaxTextureSize ( ) const

OpenGL Max texture size.

The OpenGL Max texture size.

local getMaxTextureSize ( )

OpenGL Max texture size.

The OpenGL Max texture size.

int getMaxModelviewStackDepth ( ) const

OpenGL Max Modelview Stack Depth.

The OpenGL Max Modelview Stack Depth.

local getMaxModelviewStackDepth ( )

OpenGL Max Modelview Stack Depth.

The OpenGL Max Modelview Stack Depth.

int getMaxTextureUnits ( ) const

Returns the maximum texture units.

The maximum texture units.

local getMaxTextureUnits ( )

Returns the maximum texture units.

The maximum texture units.

bool supportsNPOT ( ) const

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

OpenGL ES 2.0 already supports NPOT (iOS).

Is true if supports NPOT.

local supportsNPOT ( )

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

OpenGL ES 2.0 already supports NPOT (iOS).

Is true if supports NPOT.

bool supportsPVRTC ( ) const

Whether or not PVR Texture Compressed is supported.

Is true if supports PVR Texture Compressed.

local supportsPVRTC ( )

Whether or not PVR Texture Compressed is supported.

Is true if supports PVR Texture Compressed.

bool supportsETC ( ) const

Whether or not ETC Texture Compressed is supported.

Is true if supports ETC Texture Compressed.

local supportsETC ( )

Whether or not ETC Texture Compressed is supported.

Is true if supports ETC Texture Compressed.

bool supportsS3TC ( ) const

Whether or not S3TC Texture Compressed is supported.

Is true if supports S3TC Texture Compressed.

local supportsS3TC ( )

Whether or not S3TC Texture Compressed is supported.

Is true if supports S3TC Texture Compressed.

bool supportsATITC ( ) const

Whether or not ATITC Texture Compressed is supported.

Is true if supports ATITC Texture Compressed.

local supportsATITC ( )

Whether or not ATITC Texture Compressed is supported.

Is true if supports ATITC Texture Compressed.

bool supportsBGRA8888 ( ) const

Whether or not BGRA8888 textures are supported.

Is true if supports BGRA8888 textures.

local supportsBGRA8888 ( )

Whether or not BGRA8888 textures are supported.

Is true if supports BGRA8888 textures.

bool supportsDiscardFramebuffer ( ) const

Whether or not glDiscardFramebufferEXT is supported.

Is true if supports glDiscardFramebufferEXT.

local supportsDiscardFramebuffer ( )

Whether or not glDiscardFramebufferEXT is supported.

Is true if supports glDiscardFramebufferEXT.

bool supportsShareableVAO ( ) const

Whether or not shareable VAOs are supported.

Is true if supports shareable VAOs.

local supportsShareableVAO ( )

Whether or not shareable VAOs are supported.

Is true if supports shareable VAOs.

int getMaxSupportDirLightInShader ( ) const

Max support directional light in shader, for Sprite3D.

Maximum supports directional light in shader.

local getMaxSupportDirLightInShader ( )

Max support directional light in shader, for Sprite3D.

Maximum supports directional light in shader.

int getMaxSupportPointLightInShader ( ) const

Max support point light in shader, for Sprite3D.

Maximum supports point light in shader.

local
getMaxSupportPointLightInShader
( )

Max support point light in shader, for Sprite3D.

Maximum supports point light in shader.

int getMaxSupportSpotLightInShader ( ) const

Max support spot light in shader, for Sprite3D.

Maximum supports spot light in shader.

local
getMaxSupportSpotLightInShader
( )

Max support spot light in shader, for Sprite3D.

Maximum supports spot light in shader.

Animate3DQuality
getAnimate3DQuality
( ) const

get 3d animate quality 3d animate quality.

Returns
3d动画质量。
local getAnimate3DQuality ( )

get 3d animate quality 3d animate quality.

Returns
3d动画质量。
bool checkForGLExtension ( const std::string &  searchName) const

Returns whether or not an OpenGL is supported.

A given search name. Is true if an OpenGL is supported.

local checkForGLExtension ( local  searchName)

Returns whether or not an OpenGL is supported.

A given search name. Is true if an OpenGL is supported.

bool init ( )

Initialize method.

Is true if initialize success.

local init ( )

Initialize method.

Is true if initialize success.

const Value& getValue ( const std::string &  key,
const Value &  defaultValue = Value::Null 
) const

Returns the value of a given key as a double.

A given key. if not find the value, return the defaultValue.

local getValue ( local  key,
local  defaultValue = Value::Null 
)

Returns the value of a given key as a double.

A given key. if not find the value, return the defaultValue.

void setValue ( const std::string &  key,
const Value &  value 
)

Sets a new key/value pair in the configuration dictionary.

A given key. A given value.

local setValue ( local  key,
local  value 
)

Sets a new key/value pair in the configuration dictionary.

A given key. A given value.

std::string getInfo ( ) const

Returns the Configuration info.

The Configuration info.

local getInfo ( )

Returns the Configuration info.

The Configuration info.

void loadConfigFile ( const std::string &  filename)

Loads a config file.

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

Config file name.

local loadConfigFile ( local  filename)

Loads a config file.

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

Config file name.


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