Rest of the core misc functions.
This commit is contained in:
27
API.md
27
API.md
@@ -1355,6 +1355,24 @@ Get elapsed time in seconds since InitWindow()
|
||||
|
||||
---
|
||||
|
||||
> success = RL_TakeScreenshot( string fileName )
|
||||
|
||||
Takes a screenshot of current screen ( filename extension defines format )
|
||||
|
||||
- Failure return false
|
||||
- Success return true
|
||||
|
||||
---
|
||||
|
||||
> success = RL_SetConfigFlags( int flags )
|
||||
|
||||
Setup init configuration flags ( view FLAGS )
|
||||
|
||||
- Failure return false
|
||||
- Success return true
|
||||
|
||||
---
|
||||
|
||||
> success = RL_TraceLog( int logLevel, string text )
|
||||
|
||||
Show trace log messages ( LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR... )
|
||||
@@ -1364,6 +1382,15 @@ Show trace log messages ( LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR... )
|
||||
|
||||
---
|
||||
|
||||
> success = RL_SetTraceLogLevel( int logLevel )
|
||||
|
||||
Set the current threshold ( minimum ) log level
|
||||
|
||||
- Failure return false
|
||||
- Success return true
|
||||
|
||||
---
|
||||
|
||||
> success = RL_OpenURL( string url )
|
||||
|
||||
Open URL with default system browser ( If available )
|
||||
|
||||
1
devnotes
1
devnotes
@@ -6,6 +6,5 @@ Backlog {
|
||||
* Codepoints
|
||||
* String management. At least TextSplit.
|
||||
|
||||
* Physac?
|
||||
* VR?
|
||||
}
|
||||
|
||||
@@ -38,7 +38,10 @@ int lcoreSetTargetFPS( lua_State *L );
|
||||
int lcoreGetFrameTime( lua_State *L );
|
||||
int lcoreGetTime( lua_State *L );
|
||||
/* Misc. */
|
||||
int lcoreTakeScreenshot( lua_State *L );
|
||||
int lcoreSetConfigFlags( lua_State *L );
|
||||
int lcoreTraceLog( lua_State *L );
|
||||
int lcoreSetTraceLogLevel( lua_State *L );
|
||||
int lcoreOpenURL( lua_State *L );
|
||||
/* Cursor. */
|
||||
int lcoreShowCursor( lua_State *L );
|
||||
|
||||
60
src/core.c
60
src/core.c
@@ -617,6 +617,46 @@ int lcoreGetTime( lua_State *L ) {
|
||||
## Core - Misc
|
||||
*/
|
||||
|
||||
/*
|
||||
> success = RL_TakeScreenshot( string fileName )
|
||||
|
||||
Takes a screenshot of current screen ( filename extension defines format )
|
||||
|
||||
- Failure return false
|
||||
- Success return true
|
||||
*/
|
||||
int lcoreTakeScreenshot( lua_State *L ) {
|
||||
if ( !lua_isstring( L, -1 ) ) {
|
||||
TraceLog( LOG_WARNING, "%s", "Bad call of function. RL_TakeScreenshot( string fileName )" );
|
||||
lua_pushboolean( L, false );
|
||||
return 1;
|
||||
}
|
||||
TakeScreenshot( lua_tostring( L, -1 ) );
|
||||
lua_pushboolean( L, true );
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
> success = RL_SetConfigFlags( int flags )
|
||||
|
||||
Setup init configuration flags ( view FLAGS )
|
||||
|
||||
- Failure return false
|
||||
- Success return true
|
||||
*/
|
||||
int lcoreSetConfigFlags( lua_State *L ) {
|
||||
if ( !lua_isnumber( L, -1 ) ) {
|
||||
TraceLog( LOG_WARNING, "%s", "Bad call of function. RL_SetConfigFlags( int flags )" );
|
||||
lua_pushboolean( L, false );
|
||||
return 1;
|
||||
}
|
||||
SetConfigFlags( lua_tointeger( L, -1 ) );
|
||||
lua_pushboolean( L, true );
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
> success = RL_TraceLog( int logLevel, string text )
|
||||
|
||||
@@ -637,6 +677,26 @@ int lcoreTraceLog( lua_State *L ) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
> success = RL_SetTraceLogLevel( int logLevel )
|
||||
|
||||
Set the current threshold ( minimum ) log level
|
||||
|
||||
- Failure return false
|
||||
- Success return true
|
||||
*/
|
||||
int lcoreSetTraceLogLevel( lua_State *L ) {
|
||||
if ( !lua_isnumber( L, -1 ) ) {
|
||||
TraceLog( LOG_WARNING, "%s", "Bad call of function. RL_SetTraceLogLevel( int logLevel )" );
|
||||
lua_pushboolean( L, false );
|
||||
return 1;
|
||||
}
|
||||
SetTraceLogLevel( lua_tointeger( L, -1 ) );
|
||||
lua_pushboolean( L, true );
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
> success = RL_OpenURL( string url )
|
||||
|
||||
|
||||
@@ -688,7 +688,10 @@ void luaRegister() {
|
||||
lua_register( L, "RL_GetFrameTime", lcoreGetFrameTime );
|
||||
lua_register( L, "RL_GetTime", lcoreGetTime );
|
||||
/* Misc. */
|
||||
lua_register( L, "RL_TakeScreenshot", lcoreTakeScreenshot );
|
||||
lua_register( L, "RL_SetConfigFlags", lcoreSetConfigFlags );
|
||||
lua_register( L, "RL_TraceLog", lcoreTraceLog );
|
||||
lua_register( L, "RL_SetTraceLogLevel", lcoreSetTraceLogLevel );
|
||||
lua_register( L, "RL_OpenURL", lcoreOpenURL );
|
||||
/* Cursor. */
|
||||
lua_register( L, "RL_ShowCursor", lcoreShowCursor );
|
||||
|
||||
Reference in New Issue
Block a user