mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Add new mesh data formats: int32, uint32, [u]int8, [u]int16, snorm8, and snorm16.
Integer formats for vertex attributes are only supported in glsl3 shaders. They use ivec/uvec types in glsl. --HG-- branch : minor
This commit is contained in:
@@ -214,6 +214,16 @@ inline float luax_checkfloat(lua_State *L, int idx)
|
||||
return static_cast<float>(luaL_checknumber(L, idx));
|
||||
}
|
||||
|
||||
inline lua_Number luax_checknumberclamped(lua_State *L, int idx, double minv, double maxv)
|
||||
{
|
||||
return std::min(std::max(luaL_checknumber(L, idx), minv), maxv);
|
||||
}
|
||||
|
||||
inline lua_Number luax_optnumberclamped(lua_State *L, int idx, double minv, double maxv, double def)
|
||||
{
|
||||
return std::min(std::max(luaL_optnumber(L, idx, def), minv), maxv);
|
||||
}
|
||||
|
||||
inline lua_Number luax_checknumberclamped01(lua_State *L, int idx)
|
||||
{
|
||||
return std::min(std::max(luaL_checknumber(L, idx), 0.0), 1.0);
|
||||
|
||||
Reference in New Issue
Block a user