浏览代码

Designing some callbacks -WIP-

pull/1570/head
Ray 4 年前
父节点
当前提交
3431d58586
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. +7
    -0
      src/raylib.h

+ 7
- 0
src/raylib.h 查看文件

@ -874,6 +874,9 @@ typedef enum {
// Callbacks to be implemented by users // Callbacks to be implemented by users
typedef void (*TraceLogCallback)(int logType, const char *text, va_list args); 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);
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" { // Prevents name mangling of functions extern "C" { // Prevents name mangling of functions
@ -975,6 +978,10 @@ RLAPI void TraceLog(int logType, const char *text, ...); // Show trace
RLAPI void *MemAlloc(int size); // Internal memory allocator RLAPI void *MemAlloc(int size); // Internal memory allocator
RLAPI void MemFree(void *ptr); // Internal memory free RLAPI void MemFree(void *ptr); // Internal memory free
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 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 int GetRandomValue(int min, int max); // Returns a random value between min and max (both included)

正在加载...
取消
保存