GetPlatform.
This commit is contained in:
8
API.md
8
API.md
@@ -4496,6 +4496,14 @@ Set Lua garbage collection to unload object data
|
||||
|
||||
---
|
||||
|
||||
> platform = RL.GetPlatform()
|
||||
|
||||
Get platform. Returns "Windows", "Linux", "FreeBSD", "OpenBSD", "Apple" or "Emscripten"
|
||||
|
||||
- Success return string
|
||||
|
||||
---
|
||||
|
||||
## Core - Files management functions
|
||||
|
||||
---
|
||||
|
||||
@@ -1882,6 +1882,11 @@ function RL.IsGCUnloadEnabled() end
|
||||
---@return any RL.SetGCUnload
|
||||
function RL.SetGCUnload( enabled ) end
|
||||
|
||||
---Get platform. Returns "Windows", "Linux", "FreeBSD", "OpenBSD", "Apple" or "Emscripten"
|
||||
---- Success return string
|
||||
---@return any platform
|
||||
function RL.GetPlatform() end
|
||||
|
||||
-- Core - Files management functions
|
||||
|
||||
---Load file data as byte array (read). Buffer type is BUFFER_UNSIGNED_CHAR
|
||||
|
||||
@@ -49,6 +49,7 @@ DETAILED CHANGES:
|
||||
- ADDED: Bitwise operations for cross Lua compatibility.
|
||||
- ADDED: GetMeshData.
|
||||
- FIXED: GenMeshCustom indices wasn't changing triangleCount.
|
||||
- ADDED: GetPlatform.
|
||||
|
||||
------------------------------------------------------------------------
|
||||
Release: ReiLua version 0.7.0 Using Raylib 5.0 and Forked Raygui 4.0
|
||||
|
||||
@@ -114,6 +114,7 @@ int lcoreGetLogLevelInvalid( lua_State* L );
|
||||
int lcoreOpenURL( lua_State* L );
|
||||
int lcoreIsGCUnloadEnabled( lua_State* L );
|
||||
int lcoreSetGCUnload( lua_State* L );
|
||||
int lcoreGetPlatform( lua_State* L );
|
||||
/* Files management functions. */
|
||||
int lcoreLoadFileData( lua_State* L );
|
||||
int lcoreSaveFileData( lua_State* L );
|
||||
|
||||
25
src/core.c
25
src/core.c
@@ -1490,6 +1490,31 @@ int lcoreSetGCUnload( lua_State* L ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
> platform = RL.GetPlatform()
|
||||
|
||||
Get platform. Returns "Windows", "Linux", "FreeBSD", "OpenBSD", "Apple" or "Emscripten"
|
||||
|
||||
- Success return string
|
||||
*/
|
||||
int lcoreGetPlatform( lua_State* L ) {
|
||||
#if defined( _WIN32 )
|
||||
lua_pushstring( L, "Windows" );
|
||||
#elif defined( __linux__ )
|
||||
lua_pushstring( L, "Linux" );
|
||||
#elif defined( __FreeBSD__ )
|
||||
lua_pushstring( L, "FreeBSD" );
|
||||
#elif defined( __OpenBSD__ )
|
||||
lua_pushstring( L, "OpenBSD" );
|
||||
#elif defined( __APPLE__ )
|
||||
lua_pushstring( L, "Apple" );
|
||||
#elif defined( __EMSCRIPTEN__ )
|
||||
lua_pushstring( L, "Emscripten" );
|
||||
#endif
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
## Core - Files management functions
|
||||
*/
|
||||
|
||||
@@ -1378,6 +1378,7 @@ void luaRegister() {
|
||||
assingGlobalFunction( "OpenURL", lcoreOpenURL );
|
||||
assingGlobalFunction( "IsGCUnloadEnabled", lcoreIsGCUnloadEnabled );
|
||||
assingGlobalFunction( "SetGCUnload", lcoreSetGCUnload );
|
||||
assingGlobalFunction( "GetPlatform", lcoreGetPlatform );
|
||||
/* Files management functions. */
|
||||
assingGlobalFunction( "LoadFileData", lcoreLoadFileData );
|
||||
assingGlobalFunction( "SaveFileData", lcoreSaveFileData );
|
||||
|
||||
Reference in New Issue
Block a user