cocos2d-x  3.0-alpha0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ShaderCache Class Reference

ShaderCache Singleton that stores manages GL shaders. More...

#include <CCShaderCache.h>

Inheritance diagram for ShaderCache:
Object

Public Member Functions

 ShaderCache ()
virtual ~ShaderCache ()
void loadDefaultShaders ()
 loads the default shaders More...
 
void reloadDefaultShaders ()
 reload the default shaders More...
 
GLProgramgetProgram (const std::string &key)
 returns a GL program for a given key More...
 
CC_DEPRECATED_ATTRIBUTE GLProgramprogramForKey (const std::string &key)
void addProgram (GLProgram *program, const std::string &key)
 adds a GLProgram to the cache for a given name More...
 
- Public Member Functions inherited from Object
 Object ()
 Constructor. More...
 
virtual ~Object ()
void release ()
 Release the ownership immediately. More...
 
void retain ()
 Retains the ownership. More...
 
Objectautorelease ()
 Release the ownership sometime soon automatically. More...
 
bool isSingleReference () const
 Returns a boolean value that indicates whether there is only one reference to the object. More...
 
unsigned int retainCount () const
 Returns the object's current reference count. More...
 
virtual bool isEqual (const Object *object)
 Returns a boolean value that indicates whether this object and a given object are equal. More...
 
virtual void acceptVisitor (DataVisitor &visitor)
virtual void update (float dt)

Static Public Member Functions

static ShaderCachegetInstance ()
 returns the shared instance More...
 
local getInstance ()
 returns the shared instance More...
 
static void destroyInstance ()
 purges the cache. More...
 
static CC_DEPRECATED_ATTRIBUTE
ShaderCache
sharedShaderCache ()
local sharedShaderCache ()
static CC_DEPRECATED_ATTRIBUTE void purgeSharedShaderCache ()
local purgeSharedShaderCache ()

Additional Inherited Members

- Public Attributes inherited from Object
unsigned int _ID
 object id, ScriptSupport need public _ID More...
 
int _luaID
 Lua reference id. More...
 
- Protected Attributes inherited from Object
unsigned int _reference
 count of references More...
 
var _reference
 count of references More...
 
local _reference
 count of references More...
 
unsigned int _autoReleaseCount
 count of autorelease More...
 
var _autoReleaseCount
 count of autorelease More...
 
local _autoReleaseCount
 count of autorelease More...
 

Detailed Description

ShaderCache Singleton that stores manages GL shaders.

Since
v2.0

Constructor & Destructor Documentation

var ctor ( )
local ShaderCache ( )
virtual ~ShaderCache ( )
virtual

Member Function Documentation

void addProgram ( GLProgram program,
const std::string &  key 
)

adds a GLProgram to the cache for a given name

var addProgram ( var  program,
var  key 
)

adds a GLProgram to the cache for a given name

local addProgram ( local  program,
local  key 
)

adds a GLProgram to the cache for a given name

static void destroyInstance ( )
static

purges the cache.

It releases the retained instance.

var destroyInstance ( )
static

purges the cache.

It releases the retained instance.

local destroyInstance ( )
static

purges the cache.

It releases the retained instance.

static ShaderCache* getInstance ( )
static

returns the shared instance

var getInstance ( )
static

returns the shared instance

local getInstance ( )
static

returns the shared instance

GLProgram* getProgram ( const std::string &  key)

returns a GL program for a given key

var getProgram ( var  key)

returns a GL program for a given key

local getProgram ( local  key)

returns a GL program for a given key

void loadDefaultShaders ( )

loads the default shaders

var loadDefaultShaders ( )

loads the default shaders

local loadDefaultShaders ( )

loads the default shaders

CC_DEPRECATED_ATTRIBUTE
GLProgram* programForKey
( const std::string &  key)
inline
static CC_DEPRECATED_ATTRIBUTE
void purgeSharedShaderCache
( )
static
var purgeSharedShaderCache ( )
static
local purgeSharedShaderCache ( )
static
void reloadDefaultShaders ( )

reload the default shaders

var reloadDefaultShaders ( )

reload the default shaders

local reloadDefaultShaders ( )

reload the default shaders

static CC_DEPRECATED_ATTRIBUTE
ShaderCache* sharedShaderCache
( )
static
var sharedShaderCache ( )
static
local sharedShaderCache ( )
static

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