cocos2d-x  3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Support

Namespaces

 cocos2d::GL
 

Classes

class  Device
 
class  FileUtils
 Helper class to handle file operations. More...
 

Enumerations

enum  TextAlign {
  CENTER = 0x33, TOP = 0x13, TOP_RIGHT = 0x12, RIGHT = 0x32,
  BOTTOM_RIGHT = 0x22, BOTTOM = 0x23, BOTTOM_LEFT = 0x21, LEFT = 0x31,
  TOP_LEFT = 0x11
}
 Defines the alignment of text. More...
 
enum  {
  VERTEX_ATTRIB_FLAG_NONE = 0, VERTEX_ATTRIB_FLAG_POSITION = 1 << 0, VERTEX_ATTRIB_FLAG_COLOR = 1 << 1, VERTEX_ATTRIB_FLAG_TEX_COORD = 1 << 2,
  VERTEX_ATTRIB_FLAG_NORMAL = 1 << 3, VERTEX_ATTRIB_FLAG_BLEND_WEIGHT = 1 << 4, VERTEX_ATTRIB_FLAG_BLEND_INDEX = 1 << 5, VERTEX_ATTRIB_FLAG_POS_COLOR_TEX = (VERTEX_ATTRIB_FLAG_POSITION | VERTEX_ATTRIB_FLAG_COLOR | VERTEX_ATTRIB_FLAG_TEX_COORD)
}
 Vertex attrib flags. More...
 

Functions

void CC_DLL  (void)
 Invalidates the GL state cache. More...
 
void CC_DLL  (GLuint program)
 Uses the GL program in case program is different than the current one. More...
 
void CC_DLL  (GLenum sfactor, GLenum dfactor)
 Uses a blending function in case it not already used. More...
 
void CC_DLL  (uint32_t flags)
 Will enable the vertex attribs that are passed as flags. More...
 
void CC_DLL  (GLuint textureUnit, GLuint textureId)
 If the texture is not already bound to a given unit, it binds it. More...
 
var  ( var textureUnit, var textureId)
 If the texture is not already bound to a given unit, it binds it. More...
 
local  ( local textureUnit, local textureId)
 If the texture is not already bound to a given unit, it binds it. More...
 
void CC_DLL  (GLenum texture)
 Select active texture unit. More...
 

Detailed Description

Enumeration Type Documentation

anonymous enum

Vertex attrib flags.

Enumerator
VERTEX_ATTRIB_FLAG_NONE 
VERTEX_ATTRIB_FLAG_POSITION 
VERTEX_ATTRIB_FLAG_COLOR 
VERTEX_ATTRIB_FLAG_TEX_COORD 
VERTEX_ATTRIB_FLAG_NORMAL 
VERTEX_ATTRIB_FLAG_BLEND_WEIGHT 
VERTEX_ATTRIB_FLAG_BLEND_INDEX 
VERTEX_ATTRIB_FLAG_POS_COLOR_TEX 
var enum

Vertex attrib flags.

Enumerator
VERTEX_ATTRIB_FLAG_NONE 
VERTEX_ATTRIB_FLAG_POSITION 
VERTEX_ATTRIB_FLAG_COLOR 
VERTEX_ATTRIB_FLAG_TEX_COORD 
VERTEX_ATTRIB_FLAG_NORMAL 
VERTEX_ATTRIB_FLAG_BLEND_WEIGHT 
VERTEX_ATTRIB_FLAG_BLEND_INDEX 
VERTEX_ATTRIB_FLAG_POS_COLOR_TEX 
local enum

Vertex attrib flags.

Enumerator
VERTEX_ATTRIB_FLAG_NONE 
VERTEX_ATTRIB_FLAG_POSITION 
VERTEX_ATTRIB_FLAG_COLOR 
VERTEX_ATTRIB_FLAG_TEX_COORD 
VERTEX_ATTRIB_FLAG_NORMAL 
VERTEX_ATTRIB_FLAG_BLEND_WEIGHT 
VERTEX_ATTRIB_FLAG_BLEND_INDEX 
VERTEX_ATTRIB_FLAG_POS_COLOR_TEX 
enum TextAlign
strong

Defines the alignment of text.

Enumerator
CENTER 
TOP 

Horizontal center and vertical center.

TOP_RIGHT 

Horizontal center and vertical top.

RIGHT 

Horizontal right and vertical top.

BOTTOM_RIGHT 

Horizontal right and vertical center.

BOTTOM 

Horizontal right and vertical bottom.

BOTTOM_LEFT 

Horizontal center and vertical bottom.

LEFT 

Horizontal left and vertical bottom.

TOP_LEFT 

Horizontal left and vertical center.

var TextAlign
strong

Defines the alignment of text.

Enumerator
CENTER 
TOP 

Horizontal center and vertical center.

TOP_RIGHT 

Horizontal center and vertical top.

RIGHT 

Horizontal right and vertical top.

BOTTOM_RIGHT 

Horizontal right and vertical center.

BOTTOM 

Horizontal right and vertical bottom.

BOTTOM_LEFT 

Horizontal center and vertical bottom.

LEFT 

Horizontal left and vertical bottom.

TOP_LEFT 

Horizontal left and vertical center.

local TextAlign
strong

Defines the alignment of text.

Enumerator
CENTER 
TOP 

Horizontal center and vertical center.

TOP_RIGHT 

Horizontal center and vertical top.

RIGHT 

Horizontal right and vertical top.

BOTTOM_RIGHT 

Horizontal right and vertical center.

BOTTOM 

Horizontal right and vertical bottom.

BOTTOM_LEFT 

Horizontal center and vertical bottom.

LEFT 

Horizontal left and vertical bottom.

TOP_LEFT 

Horizontal left and vertical center.

Function Documentation

void CC_DLL
cocos2d::GL::invalidateStateCache
( void  )

Invalidates the GL state cache.

If CC_ENABLE_GL_STATE_CACHE it will reset the GL state cache.

Since
v2.0.0
var invalidateStateCache (   )

Invalidates the GL state cache.

If CC_ENABLE_GL_STATE_CACHE it will reset the GL state cache.

Since
v2.0.0
local invalidateStateCache (   )

Invalidates the GL state cache.

If CC_ENABLE_GL_STATE_CACHE it will reset the GL state cache.

Since
v2.0.0
void CC_DLL cocos2d::GL::useProgram ( GLuint  program)

Uses the GL program in case program is different than the current one.

If CC_ENABLE_GL_STATE_CACHE is disabled, it will the glUseProgram() directly.

Since
v2.0.0
var useProgram ( var  program)

Uses the GL program in case program is different than the current one.

If CC_ENABLE_GL_STATE_CACHE is disabled, it will the glUseProgram() directly.

Since
v2.0.0
local useProgram ( local  program)

Uses the GL program in case program is different than the current one.

If CC_ENABLE_GL_STATE_CACHE is disabled, it will the glUseProgram() directly.

Since
v2.0.0
void CC_DLL cocos2d::GL::blendFunc ( GLenum  sfactor,
GLenum  dfactor 
)

Uses a blending function in case it not already used.

If CC_ENABLE_GL_STATE_CACHE is disabled, it will the glBlendFunc() directly.

Since
v2.0.0
var blendFunc ( var  sfactor,
var  dfactor 
)

Uses a blending function in case it not already used.

If CC_ENABLE_GL_STATE_CACHE is disabled, it will the glBlendFunc() directly.

Since
v2.0.0
local blendFunc ( local  sfactor,
local  dfactor 
)

Uses a blending function in case it not already used.

If CC_ENABLE_GL_STATE_CACHE is disabled, it will the glBlendFunc() directly.

Since
v2.0.0
void CC_DLL
cocos2d::GL::enableVertexAttribs
( uint32_t  flags)

Will enable the vertex attribs that are passed as flags.

Possible flags:

  • VERTEX_ATTRIB_FLAG_POSITION
  • VERTEX_ATTRIB_FLAG_COLOR
  • VERTEX_ATTRIB_FLAG_TEX_COORDS

These flags can be ORed. The flags that are not present, will be disabled.

Since
v2.0.0
var enableVertexAttribs ( var  flags)

Will enable the vertex attribs that are passed as flags.

Possible flags:

  • VERTEX_ATTRIB_FLAG_POSITION
  • VERTEX_ATTRIB_FLAG_COLOR
  • VERTEX_ATTRIB_FLAG_TEX_COORDS

These flags can be ORed. The flags that are not present, will be disabled.

Since
v2.0.0
local enableVertexAttribs ( local  flags)

Will enable the vertex attribs that are passed as flags.

Possible flags:

  • VERTEX_ATTRIB_FLAG_POSITION
  • VERTEX_ATTRIB_FLAG_COLOR
  • VERTEX_ATTRIB_FLAG_TEX_COORDS

These flags can be ORed. The flags that are not present, will be disabled.

Since
v2.0.0
void CC_DLL
cocos2d::GL::bindTexture2DN
( GLuint  textureUnit,
GLuint  textureId 
)

If the texture is not already bound to a given unit, it binds it.

If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glBindTexture() directly.

Since
v2.1.0
var bindTexture2DN ( var  textureUnit,
var  textureId 
)

If the texture is not already bound to a given unit, it binds it.

If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glBindTexture() directly.

Since
v2.1.0
local bindTexture2DN ( local  textureUnit,
local  textureId 
)

If the texture is not already bound to a given unit, it binds it.

If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glBindTexture() directly.

Since
v2.1.0
void CC_DLL
cocos2d::GL::activeTexture
( GLenum  texture)

Select active texture unit.

If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glActiveTexture() directly.

Since
v3.0
var activeTexture ( var  texture)

Select active texture unit.

If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glActiveTexture() directly.

Since
v3.0
local activeTexture ( local  texture)

Select active texture unit.

If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glActiveTexture() directly.

Since
v3.0