cocos2d-x  3.0-rc0
 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:
Ref

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 Ref
void retain ()
 Retains the ownership. More...
 
void release ()
 Release the ownership immediately. More...
 
Refautorelease ()
 Release the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()

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...
 
local destroyInstance ()
 purges the cache. More...
 
static CC_DEPRECATED_ATTRIBUTE
ShaderCache
sharedShaderCache ()
local sharedShaderCache ()
static CC_DEPRECATED_ATTRIBUTE void purgeSharedShaderCache ()
local purgeSharedShaderCache ()

Additional Inherited Members

- Protected Member Functions inherited from Ref
 Ref ()
 Constructor. More...
 
- Protected Attributes inherited from Ref
unsigned int _referenceCount
 count of references 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: