Cocos2d-x  v4
TextureCube Class Reference

TextureCube is a collection of six separate square textures that are put onto the faces of an imaginary cube. More...

Inherits Ref.

Public Member Functions

void setTexParameters (const Texture2D::TexParams &)
 Sets the min filter, mag filter, wrap s and wrap t texture parameters. More...
 
bool reloadTexture ()
 reload texture cube after GLESContext reconstructed.
 
- Public Member Functions inherited from Ref
void 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...
 
virtual ~Ref ()
 Destructor. More...
 

Static Public Member Functions

static TextureCubecreate (const std::string &positive_x, const std::string &negative_x, const std::string &positive_y, const std::string &negative_y, const std::string &positive_z, const std::string &negative_z)
 create cube texture from 6 textures. More...
 

Protected Member Functions

 TextureCube ()
 Constructor.
 
virtual ~TextureCube ()
 Destructor.
 

Additional Inherited Members

- Public Attributes inherited from Ref
unsigned int _ID
 object id, ScriptSupport need public _ID
 
int _luaID
 Lua reference id.
 
void * _scriptObject
 scriptObject, support for swift
 
bool _rooted
 When true, it means that the object was already rooted.
 

Detailed Description

TextureCube is a collection of six separate square textures that are put onto the faces of an imaginary cube.

Member Function Documentation

◆ create()

static TextureCube* create ( const std::string &  positive_x,
const std::string &  negative_x,
const std::string &  positive_y,
const std::string &  negative_y,
const std::string &  positive_z,
const std::string &  negative_z 
)
static

create cube texture from 6 textures.

Parameters
positive_xtexture for the right side of the texture cube face.
negative_xtexture for the up side of the texture cube face.
positive_ytexture for the top side of the texture cube face
negative_ytexture for the bottom side of the texture cube face
positive_ztexture for the forward side of the texture cube face.
negative_ztexture for the rear side of the texture cube face.
Returns
A new texture cube inited with given parameters.

◆ setTexParameters()

void setTexParameters ( const Texture2D::TexParams )

Sets the min filter, mag filter, wrap s and wrap t texture parameters.

If the texture size is NPOT (non power of 2), then in can only use GL_CLAMP_TO_EDGE in GL_TEXTURE_WRAP_{S,T}.


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