diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core.c | 4 | ||||
| -rw-r--r-- | src/lua_core.c | 5 | ||||
| -rw-r--r-- | src/models.c | 3 | ||||
| -rw-r--r-- | src/rlgl.c | 41 |
4 files changed, 50 insertions, 3 deletions
@@ -2763,7 +2763,7 @@ int lcoreSetCamera3DUp( lua_State *L ) { } /* -> success = RL_SetCamera3DFovy( camera3D camera, Vector3 fovy ) +> success = RL_SetCamera3DFovy( camera3D camera, float fovy ) Set camera field-of-view apperture in Y ( degrees ) in perspective, used as near plane width in orthographic @@ -2772,7 +2772,7 @@ Set camera field-of-view apperture in Y ( degrees ) in perspective, used as near */ int lcoreSetCamera3DFovy( lua_State *L ) { if ( !lua_isnumber( L, -2 ) || !lua_isnumber( L, -1 ) ) { - TraceLog( LOG_WARNING, "%s", "Bad call of function. RL_SetCamera3DFovy( camera3D camera, Vector3 fovy )" ); + TraceLog( LOG_WARNING, "%s", "Bad call of function. RL_SetCamera3DFovy( camera3D camera, float fovy )" ); lua_pushboolean( L, false ); return 1; } diff --git a/src/lua_core.c b/src/lua_core.c index d714024..e2b1631 100644 --- a/src/lua_core.c +++ b/src/lua_core.c @@ -10,6 +10,7 @@ #include "rmath.h" #include "rgui.h" #include "lights.h" +#include "lrlgl.h" static void assignGlobalInt( int value, const char *name ) { lua_State *L = state->luaState; @@ -1257,6 +1258,10 @@ void luaRegister() { /* Basics. */ lua_register( L, "RL_CreateLight", llightsCreateLight ); lua_register( L, "RL_UpdateLightValues", llightsUpdateLightValues ); + /* RLGL */ + /* General render state. */ + lua_register( L, "RL_rlSetLineWidth", lrlglSetLineWidth ); + lua_register( L, "RL_rlGetLineWidth", lrlglGetLineWidth ); } /* Lua util functions. */ diff --git a/src/models.c b/src/models.c index 4e67ff0..ef5e493 100644 --- a/src/models.c +++ b/src/models.c @@ -1284,11 +1284,12 @@ int lmodelsDrawMesh( lua_State *L ) { return 1; } -/* TODO Not testet. */ +/* TODO Untested. */ /* > success = RL_DrawMeshInstanced( Mesh mesh, Material material, Matrix{} transforms, int instances ) Draw multiple mesh instances with material and different transforms +Note! Untested. - Failure return false - Success return true diff --git a/src/rlgl.c b/src/rlgl.c new file mode 100644 index 0000000..0ca3383 --- /dev/null +++ b/src/rlgl.c @@ -0,0 +1,41 @@ +#include "main.h" +#include "state.h" +#include "lua_core.h" +#include "lrlgl.h" + +/* +## RLGL - General render state +*/ + +/* +> success = RL_rlSetLineWidth( float width ) + +Set the line drawing width + +- Failure return false +- Success return true +*/ +int lrlglSetLineWidth( lua_State *L ) { + if ( !lua_isnumber( L, -1 ) ) { + TraceLog( LOG_WARNING, "%s", "Bad call of function. RL_rlSetLineWidth( float width )" ); + lua_pushboolean( L, false ); + return 1; + } + rlSetLineWidth( lua_tonumber( L, -1 ) ); + lua_pushboolean( L, true ); + + return 1; +} + +/* +> width = RL_rlGetLineWidth() + +Get the line drawing width + +- Success return float +*/ +int lrlglGetLineWidth( lua_State *L ) { + lua_pushnumber( L, rlGetLineWidth() ); + + return 1; +} |
