VertexBufferObject::VertexBufferObject( const VertexFormat &vf, unsigned int vertexCount, const VertexPrecision *vertexData ) : BufferObject( vertexCount * vf.getVertexSize(), vertexData ), _vertexFormat( vf ), _vertexCount( vertexCount ) { }
int lua_VertexFormat_getVertexSize(lua_State* state) { // Get the number of parameters. int paramCount = lua_gettop(state); // Attempt to match the parameters to a valid binding. switch (paramCount) { case 1: { if ((lua_type(state, 1) == LUA_TUSERDATA)) { VertexFormat* instance = getInstance(state); unsigned int result = instance->getVertexSize(); // Push the return value onto the stack. lua_pushunsigned(state, result); return 1; } lua_pushstring(state, "lua_VertexFormat_getVertexSize - Failed to match the given parameters to a valid function signature."); lua_error(state); break; } default: { lua_pushstring(state, "Invalid number of parameters (expected 1)."); lua_error(state); break; } } return 0; }