Fixed examples.
This commit is contained in:
@@ -35,7 +35,6 @@ static void defineBuffer() {
|
||||
/* Image */
|
||||
static int gcImage( lua_State *L ) {
|
||||
Image *image = luaL_checkudata ( L, 1, "Image" );
|
||||
printf( "gcImage\n" );
|
||||
|
||||
UnloadImage( *image );
|
||||
}
|
||||
@@ -53,7 +52,6 @@ static void defineImage() {
|
||||
/* Texture */
|
||||
static int gcTexture( lua_State *L ) {
|
||||
Texture *texture = luaL_checkudata ( L, 1, "Texture" );
|
||||
printf( "gcTexture\n" );
|
||||
|
||||
UnloadTexture( *texture );
|
||||
}
|
||||
@@ -71,7 +69,6 @@ static void defineTexture() {
|
||||
/* RenderRexture. */
|
||||
static int gcRenderTexture( lua_State *L ) {
|
||||
RenderTexture *renderTexture = luaL_checkudata ( L, 1, "RenderTexture" );
|
||||
printf( "gcRenderTexture\n" );
|
||||
|
||||
UnloadRenderTexture( *renderTexture );
|
||||
}
|
||||
@@ -107,7 +104,6 @@ static void defineCamera3D() {
|
||||
/* Shader. */
|
||||
static int gcShader( lua_State *L ) {
|
||||
Shader *shader = luaL_checkudata ( L, 1, "Shader" );
|
||||
printf( "gcShader\n" );
|
||||
|
||||
UnloadShader( *shader );
|
||||
}
|
||||
@@ -125,7 +121,6 @@ static void defineShader() {
|
||||
/* Font. */
|
||||
static int gcFont( lua_State *L ) {
|
||||
Font *font = luaL_checkudata ( L, 1, "Font" );
|
||||
printf( "gcFont\n" );
|
||||
|
||||
UnloadFont( *font );
|
||||
}
|
||||
@@ -143,7 +138,6 @@ static void defineFont() {
|
||||
/* Wave. */
|
||||
static int gcWave( lua_State *L ) {
|
||||
Wave *wave = luaL_checkudata ( L, 1, "Wave" );
|
||||
printf( "gcWave\n" );
|
||||
|
||||
UnloadWave( *wave );
|
||||
}
|
||||
@@ -161,7 +155,6 @@ static void defineWave() {
|
||||
/* Sound. */
|
||||
static int gcSound( lua_State *L ) {
|
||||
Sound *sound = luaL_checkudata ( L, 1, "Sound" );
|
||||
printf( "gcSound\n" );
|
||||
|
||||
UnloadSound( *sound );
|
||||
}
|
||||
@@ -179,7 +172,6 @@ static void defineSound() {
|
||||
/* Music. */
|
||||
static int gcMusic( lua_State *L ) {
|
||||
Music *music = luaL_checkudata ( L, 1, "Music" );
|
||||
printf( "gcMusic\n" );
|
||||
|
||||
UnloadMusicStream( *music );
|
||||
}
|
||||
@@ -206,7 +198,6 @@ static void defineLight() {
|
||||
/* Material. */
|
||||
static int gcMaterial( lua_State *L ) {
|
||||
Material *material = luaL_checkudata ( L, 1, "Material" );
|
||||
printf( "gcMaterial\n" );
|
||||
|
||||
// int MAX_MATERIAL_MAPS = 12;
|
||||
|
||||
@@ -238,7 +229,6 @@ static void defineMaterial() {
|
||||
/* Mesh. */
|
||||
static int gcMesh( lua_State *L ) {
|
||||
Mesh *mesh = luaL_checkudata ( L, 1, "Mesh" );
|
||||
printf( "gcMesh\n" );
|
||||
|
||||
UnloadMesh( *mesh );
|
||||
}
|
||||
@@ -256,7 +246,6 @@ static void defineMesh() {
|
||||
/* Model. */
|
||||
static int gcModel( lua_State *L ) {
|
||||
Model *model = luaL_checkudata ( L, 1, "Model" );
|
||||
printf( "gcModel\n" );
|
||||
|
||||
UnloadModel( *model );
|
||||
// UnloadModelKeepMeshes( *model );
|
||||
@@ -275,7 +264,6 @@ static void defineModel() {
|
||||
/* ModelAnimation. */
|
||||
static int gcModelAnimation( lua_State *L ) {
|
||||
ModelAnimation *modelAnimation = luaL_checkudata ( L, 1, "ModelAnimation" );
|
||||
printf( "gcModelAnimation\n" );
|
||||
|
||||
UnloadModelAnimation( *modelAnimation );
|
||||
}
|
||||
|
||||
14
src/rgui.c
14
src/rgui.c
@@ -335,7 +335,7 @@ Toggle Button control, returns true when active
|
||||
*/
|
||||
int lguiGuiToggle( lua_State *L ) {
|
||||
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
|
||||
bool checked = lua_toboolean( L, 3 );
|
||||
bool checked = uluaGetBoolean( L, 3 );
|
||||
|
||||
lua_pushboolean( L, GuiToggle( bounds, luaL_checkstring( L, 2 ), checked ) );
|
||||
|
||||
@@ -367,7 +367,7 @@ Check Box control, returns true when active
|
||||
*/
|
||||
int lguiGuiCheckBox( lua_State *L ) {
|
||||
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
|
||||
bool checked = lua_toboolean( L, 3 );
|
||||
bool checked = uluaGetBoolean( L, 3 );
|
||||
|
||||
lua_pushboolean( L, GuiCheckBox( bounds, luaL_checkstring( L, 2 ), checked ) );
|
||||
|
||||
@@ -403,7 +403,7 @@ int lguiGuiTextBox( lua_State *L ) {
|
||||
// char text[ STRING_LEN ] = { '\0' };
|
||||
char text[ textSize + 1 ];
|
||||
strcpy( text, luaL_checkstring( L, 2 ) );
|
||||
bool editMode = lua_toboolean( L, 4 );
|
||||
bool editMode = uluaGetBoolean( L, 4 );
|
||||
|
||||
lua_pushboolean( L, GuiTextBox( bounds, text, textSize, editMode ) );
|
||||
lua_pushstring( L, text );
|
||||
@@ -424,7 +424,7 @@ int lguiGuiTextBoxMulti( lua_State *L ) {
|
||||
// char text[ STRING_LEN ] = { '\0' };
|
||||
char text[ textSize + 1 ];
|
||||
strcpy( text, luaL_checkstring( L, 2 ) );
|
||||
bool editMode = lua_toboolean( L, 4 );
|
||||
bool editMode = uluaGetBoolean( L, 4 );
|
||||
|
||||
lua_pushboolean( L, GuiTextBoxMulti( bounds, text, textSize, editMode ) );
|
||||
lua_pushstring( L, text );
|
||||
@@ -444,7 +444,7 @@ int lguiGuiSpinner( lua_State *L ) {
|
||||
int value = luaL_checkinteger( L, 3 );
|
||||
int minValue = luaL_checkinteger( L, 4 );
|
||||
int maxValue = luaL_checkinteger( L, 5 );
|
||||
bool editMode = lua_toboolean( L, 6 );
|
||||
bool editMode = uluaGetBoolean( L, 6 );
|
||||
|
||||
lua_pushboolean( L, GuiSpinner( bounds, luaL_checkstring( L, 2 ), &value, minValue, maxValue, editMode ) );
|
||||
lua_pushinteger( L, value );
|
||||
@@ -464,7 +464,7 @@ int lguiGuiValueBox( lua_State *L ) {
|
||||
int value = luaL_checkinteger( L, 3 );
|
||||
int minValue = luaL_checkinteger( L, 4 );
|
||||
int maxValue = luaL_checkinteger( L, 5 );
|
||||
bool editMode = lua_toboolean( L, 6 );
|
||||
bool editMode = uluaGetBoolean( L, 6 );
|
||||
|
||||
lua_pushboolean( L, GuiValueBox( bounds, luaL_checkstring( L, 2 ), &value, minValue, maxValue, editMode ) );
|
||||
lua_pushinteger( L, value );
|
||||
@@ -554,7 +554,7 @@ Dropdown Box control, returns selected item
|
||||
int lguiGuiDropdownBox( lua_State *L ) {
|
||||
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
|
||||
int active = luaL_checkinteger( L, 3 );
|
||||
bool editMode = lua_toboolean( L, 4 );
|
||||
bool editMode = uluaGetBoolean( L, 4 );
|
||||
|
||||
lua_pushboolean( L, GuiDropdownBox( bounds, luaL_checkstring( L, 2 ), &active, editMode ) );
|
||||
lua_pushinteger( L, active );
|
||||
|
||||
@@ -929,7 +929,7 @@ Load a vertex buffer attribute
|
||||
*/
|
||||
int lrlglLoadVertexBuffer( lua_State *L ) {
|
||||
Buffer *buffer = luaL_checkudata( L, 1, "Buffer" );
|
||||
bool dynamic = luaL_checkinteger( L, 2 );
|
||||
bool dynamic = uluaGetBoolean( L, 2 );
|
||||
|
||||
lua_pushinteger( L, rlLoadVertexBuffer( buffer->data, buffer->size, dynamic ) );
|
||||
|
||||
@@ -945,7 +945,7 @@ Load a new attributes element buffer
|
||||
*/
|
||||
int lrlglLoadVertexBufferElement( lua_State *L ) {
|
||||
Buffer *buffer = luaL_checkudata( L, 1, "Buffer" );
|
||||
bool dynamic = luaL_checkinteger( L, 2 );
|
||||
bool dynamic = uluaGetBoolean( L, 2 );
|
||||
|
||||
lua_pushinteger( L, rlLoadVertexBufferElement( buffer->data, buffer->size, dynamic ) );
|
||||
|
||||
@@ -1013,7 +1013,7 @@ int lrlglSetVertexAttribute( lua_State *L ) {
|
||||
int index = luaL_checkinteger( L, 1 );
|
||||
int compSize = luaL_checkinteger( L, 2 );
|
||||
int type = luaL_checkinteger( L, 3 );
|
||||
bool normalized = lua_toboolean( L, 4 );
|
||||
bool normalized = uluaGetBoolean( L, 4 );
|
||||
int stride = luaL_checkinteger( L, 5 );
|
||||
int pointer = luaL_checkinteger( L, 6 );
|
||||
|
||||
@@ -1151,7 +1151,7 @@ Load depth texture/renderbuffer (to be attached to fbo)
|
||||
*/
|
||||
int lrlglLoadTextureDepth( lua_State *L ) {
|
||||
Vector2 size = uluaGetVector2Index( L, 1 );
|
||||
bool useRenderBuffer = lua_toboolean( L, 2 );
|
||||
bool useRenderBuffer = uluaGetBoolean( L, 2 );
|
||||
|
||||
lua_pushinteger( L, rlLoadTextureDepth( size.x, size.y, useRenderBuffer ) );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user