Possible callbacks -WIP-
This commit is contained in:
parent
2b1ec5d8d2
commit
0c63c7c907
16
src/raylib.h
16
src/raylib.h
@ -877,6 +877,8 @@ typedef void (*TraceLogCallback)(int logType, const char *text, va_list args);
|
||||
typedef void *(*MemAllocCallback)(int size);
|
||||
typedef void *(*MemReallocCallback)(int size);
|
||||
typedef void (*MemFreeCallback)(void *ptr);
|
||||
typedef unsigned char* (*LoadFileDataCallback)(const char* fileName, unsigned int* bytesRead); // Load file data as byte array (read)
|
||||
typedef char* (*LoadFileTextCallback)(const char* fileName); // Load text data from file (read), returns a '\0' terminated string
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" { // Prevents name mangling of functions
|
||||
@ -969,20 +971,22 @@ RLAPI float GetFrameTime(void); // Returns tim
|
||||
RLAPI double GetTime(void); // Returns elapsed time in seconds since InitWindow()
|
||||
|
||||
// Misc. functions
|
||||
RLAPI int GetRandomValue(int min, int max); // Returns a random value between min and max (both included)
|
||||
RLAPI void TakeScreenshot(const char *fileName); // Takes a screenshot of current screen (filename extension defines format)
|
||||
RLAPI void SetConfigFlags(unsigned int flags); // Setup init configuration flags (view FLAGS)
|
||||
|
||||
RLAPI void SetTraceLogLevel(int logType); // Set the current threshold (minimum) log level
|
||||
RLAPI void SetTraceLogCallback(TraceLogCallback callback); // Set a trace log callback to enable custom logging
|
||||
RLAPI void TraceLog(int logType, const char *text, ...); // Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR)
|
||||
|
||||
RLAPI void SetTraceLogLevel(int logType); // Set the current threshold (minimum) log level
|
||||
RLAPI void *MemAlloc(int size); // Internal memory allocator
|
||||
RLAPI void MemFree(void *ptr); // Internal memory free
|
||||
|
||||
// Set system callbacks
|
||||
RLAPI void SetTraceLogCallback(TraceLogCallback callback); // Set a trace log callback to enable custom logging
|
||||
RLAPI void SetMemAllocCallback(MemAllocCallback callback); // Set custom memory allocator
|
||||
RLAPI void SetMemReallocCallback(MemReallocCallback callback); // Set custom memory reallocator
|
||||
RLAPI void SetMemFreeCallback(MemFreeCallback callback); // Set custom memory free
|
||||
|
||||
RLAPI void TakeScreenshot(const char *fileName); // Takes a screenshot of current screen (saved a .png)
|
||||
RLAPI int GetRandomValue(int min, int max); // Returns a random value between min and max (both included)
|
||||
RLAPI void SetLoadFileDataCallback(LoadFileDataCallback callback); // override default file access functions
|
||||
RLAPI void SetLoadFileTextCallback(LoadFileDataCallback callback); // override default file access functions
|
||||
|
||||
// Files management functions
|
||||
RLAPI unsigned char *LoadFileData(const char *fileName, unsigned int *bytesRead); // Load file data as byte array (read)
|
||||
|
Loading…
x
Reference in New Issue
Block a user