adding SetTraceLogCallback
This commit is contained in:
parent
7bdb60d758
commit
ca72d271e1
4 changed files with 101 additions and 0 deletions
18
raylib/utils_log.c
Normal file
18
raylib/utils_log.c
Normal file
|
@ -0,0 +1,18 @@
|
|||
#include "raylib.h"
|
||||
#include "utils_log.h"
|
||||
#include <stdio.h> // Required for: vprintf()
|
||||
#include <string.h> // Required for: strcpy(), strcat()
|
||||
|
||||
#define MAX_TRACELOG_BUFFER_SIZE 128 // As defined in utils.c from raylib
|
||||
|
||||
void rayLogWrapperCallback(int logType, const char *text, va_list args) {
|
||||
char buffer[MAX_TRACELOG_BUFFER_SIZE] = { 0 };
|
||||
|
||||
vsprintf(buffer, text, args);
|
||||
|
||||
internalTraceLogCallbackGo(logType, buffer, strlen(buffer));
|
||||
}
|
||||
|
||||
void setLogCallbackWrapper(void) {
|
||||
SetTraceLogCallback(rayLogWrapperCallback);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue