Update utils_android.go
This commit is contained in:
parent
460dab9501
commit
e33a1830c9
1 changed files with 29 additions and 0 deletions
|
@ -3,6 +3,35 @@
|
||||||
|
|
||||||
package rl
|
package rl
|
||||||
|
|
||||||
|
/*
|
||||||
|
#include "stdlib.h"
|
||||||
|
#include "raylib.h"
|
||||||
|
void TraceLogWrapper(int logLevel, const char *text)
|
||||||
|
{
|
||||||
|
TraceLog(logLevel, text);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
import "C"
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"unsafe"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Set the current threshold (minimum) log level
|
||||||
|
func SetTraceLog(logLevel TraceLogLevel) {
|
||||||
|
clogLevel := (C.int)(logLevel)
|
||||||
|
C.SetTraceLogLevel(clogLevel)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...)
|
||||||
|
func TraceLog(logLevel TraceLogLevel, text string, v ...interface{}) {
|
||||||
|
ctext := C.CString(fmt.Sprintf(text, v...))
|
||||||
|
defer C.free(unsafe.Pointer(ctext))
|
||||||
|
clogLevel := (C.int)(logLevel)
|
||||||
|
C.TraceLogWrapper(clogLevel, ctext)
|
||||||
|
}
|
||||||
|
|
||||||
// HomeDir - Returns user home directory
|
// HomeDir - Returns user home directory
|
||||||
// NOTE: On Android this returns internal data path and must be called after InitWindow
|
// NOTE: On Android this returns internal data path and must be called after InitWindow
|
||||||
func HomeDir() string {
|
func HomeDir() string {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue