Axmol Engine 2.4.0-258ceca
|
Defines a binding between the vertex layout of a Mesh and the vertex input attributes of a vertex shader (Effect). More...
#include <VertexAttribBinding.h>
Inherits Object.
Public Member Functions | |
uint32_t | getVertexAttribsFlags () const |
Binds this vertex array object. | |
![]() | |
void | retain () |
Retains the ownership. | |
void | release () |
Releases the ownership immediately. | |
Object * | autorelease () |
Releases the ownership sometime soon automatically. | |
unsigned int | getReferenceCount () const |
Returns the Object's current reference count. | |
virtual | ~Object () |
Destructor. | |
Static Public Member Functions | |
static VertexAttribBinding * | create (MeshIndexData *meshIndexData, Pass *pass, MeshCommand *) |
Creates a new VertexAttribBinding between the given MeshVertexData and GLProgramState. | |
Additional Inherited Members | |
![]() | |
unsigned int | _ID |
object id, ScriptSupport need public _ID | |
int | _luaID |
Lua reference id. | |
Defines a binding between the vertex layout of a Mesh and the vertex input attributes of a vertex shader (Effect).
In a perfect world, this class would always be a binding directly between a unique VertexFormat and an Effect, where the VertexFormat is simply the definition of the layout of any anonymous vertex buffer. However, the OpenGL mechanism for setting up these bindings is Vertex Array Objects (VAOs). OpenGL requires a separate VAO per vertex buffer object (VBO), rather than per vertex layout definition. Therefore, although we would like to define this binding between a VertexFormat and Effect, we are specifying the binding between a Mesh and Effect to satisfy the OpenGL requirement of one VAO per VBO.
Note that this class still does provide a binding between a VertexFormat and an Effect, however this binding is actually a client-side binding and should only be used when writing custom code that use client-side vertex arrays, since it is slower than the server-side VAOs used by OpenGL (when creating a VertexAttribBinding between a Mesh and Effect).
|
static |
Creates a new VertexAttribBinding between the given MeshVertexData and GLProgramState.
If a VertexAttribBinding matching the specified MeshVertexData and GLProgramState already exists, it will be returned. Otherwise, a new VertexAttribBinding will be returned. If OpenGL VAOs are enabled, the a new VAO will be created and stored in the returned VertexAttribBinding, otherwise a client-side array of vertex attribute bindings will be stored.
mesh | The mesh. |
effect | The effect. |
uint32_t getVertexAttribsFlags | ( | ) | const |
Binds this vertex array object.
Unbinds this vertex array object. Returns the vertex attrib flags