rlSetVertexAttribute takes pointer as Buffer.

This commit is contained in:
jussi
2024-09-10 12:53:20 +03:00
parent 415f3b6c01
commit cd6471d339
9 changed files with 41 additions and 23 deletions

View File

@@ -1216,9 +1216,9 @@ int lrlglUnloadVertexBuffer( lua_State* L ) {
}
/*
> RL.rlSetVertexAttribute( int index, int compSize, int type, bool normalized, int stride, int pointer )
> RL.rlSetVertexAttribute( int index, int compSize, int type, bool normalized, int stride, buffer pointer )
Set vertex attribute. NOTE: Pointer should be given in size of bytes
Set vertex attribute.
*/
int lrlglSetVertexAttribute( lua_State* L ) {
int index = luaL_checkinteger( L, 1 );
@@ -1226,9 +1226,9 @@ int lrlglSetVertexAttribute( lua_State* L ) {
int type = luaL_checkinteger( L, 3 );
bool normalized = uluaGetBoolean( L, 4 );
int stride = luaL_checkinteger( L, 5 );
int pointer = luaL_checkinteger( L, 6 );
Buffer* pointer = uluaGetBuffer( L, 6 );
rlSetVertexAttribute( index, compSize, type, normalized, stride, (void*)( pointer * sizeof( char ) ) );
rlSetVertexAttribute( index, compSize, type, normalized, stride, pointer->data );
return 0;
}