Update C sources and add new functions

This commit is contained in:
Milan Nikolic 2018-02-21 21:26:09 +01:00
parent 9784968948
commit 7874621942
24 changed files with 2149 additions and 1316 deletions

View file

@ -2,23 +2,41 @@
package raylib
/*
#include "raylib.h"
*/
import "C"
import (
"fmt"
"os"
)
// TraceLog - Trace log messages showing (INFO, WARNING, ERROR, DEBUG)
// SetTraceLog - Enable trace log message types (bit flags based)
func SetTraceLog(typeFlags int) {
logTypeFlags = typeFlags
ctypeFlags := (C.uchar)(typeFlags)
C.SetTraceLog(ctypeFlags)
}
// TraceLog - Show trace log messages (INFO, WARNING, ERROR, DEBUG)
func TraceLog(msgType int, text string, v ...interface{}) {
switch msgType {
case LogInfo:
fmt.Printf("INFO: "+text+"\n", v...)
case LogError:
fmt.Printf("ERROR: "+text+"\n", v...)
os.Exit(1)
if logTypeFlags&LogInfo == 0 {
fmt.Printf("INFO: "+text+"\n", v...)
}
case LogWarning:
fmt.Printf("WARNING: "+text+"\n", v...)
if logTypeFlags&LogWarning == 0 {
fmt.Printf("WARNING: "+text+"\n", v...)
}
case LogError:
if logTypeFlags&LogError == 0 {
fmt.Printf("ERROR: "+text+"\n", v...)
}
case LogDebug:
if traceDebugMsgs {
if logTypeFlags&LogDebug == 0 {
fmt.Printf("DEBUG: "+text+"\n", v...)
}
}