mirror of https://github.com/bjornbytes/lovr.git
ShaderBlock:getOffset;
This commit is contained in:
parent
e3e17bc84c
commit
86380e7694
|
@ -2,6 +2,14 @@
|
||||||
#include "graphics/shader.h"
|
#include "graphics/shader.h"
|
||||||
#include "math/transform.h"
|
#include "math/transform.h"
|
||||||
|
|
||||||
|
int l_lovrShaderBlockGetOffset(lua_State* L) {
|
||||||
|
ShaderBlock* block = luax_checktype(L, 1, ShaderBlock);
|
||||||
|
const char* field = luaL_checkstring(L, 2);
|
||||||
|
const Uniform* uniform = lovrShaderBlockGetUniform(block, field);
|
||||||
|
lua_pushinteger(L, uniform->offset);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
int l_lovrShaderBlockGetSize(lua_State* L) {
|
int l_lovrShaderBlockGetSize(lua_State* L) {
|
||||||
ShaderBlock* block = luax_checktype(L, 1, ShaderBlock);
|
ShaderBlock* block = luax_checktype(L, 1, ShaderBlock);
|
||||||
lua_pushinteger(L, lovrShaderBlockGetSize(block));
|
lua_pushinteger(L, lovrShaderBlockGetSize(block));
|
||||||
|
@ -25,6 +33,7 @@ int l_lovrShaderBlockSend(lua_State* L) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const luaL_Reg lovrShaderBlock[] = {
|
const luaL_Reg lovrShaderBlock[] = {
|
||||||
|
{ "getOffset", l_lovrShaderBlockGetOffset },
|
||||||
{ "getSize", l_lovrShaderBlockGetSize },
|
{ "getSize", l_lovrShaderBlockGetSize },
|
||||||
{ "isWritable", l_lovrShaderBlockIsWritable },
|
{ "isWritable", l_lovrShaderBlockIsWritable },
|
||||||
{ "send", l_lovrShaderBlockSend },
|
{ "send", l_lovrShaderBlockSend },
|
||||||
|
|
Loading…
Reference in New Issue