Added pluggable memory allocator and threading stub.

This commit is contained in:
Camilla Berglund
2011-03-07 14:09:13 +01:00
parent cf7819df8d
commit ccbb956341
8 changed files with 92 additions and 14 deletions

View File

@@ -463,6 +463,8 @@ typedef void (* GLFWmouseposfun)(GLFWwindow,int,int);
typedef void (* GLFWscrollfun)(GLFWwindow,int,int);
typedef void (* GLFWkeyfun)(GLFWwindow,int,int);
typedef void (* GLFWcharfun)(GLFWwindow,int);
typedef void* (* GLFWmallocfun)(size_t);
typedef void (* GLFWfreefun)(void*);
/* The video mode structure used by glfwGetVideoModes */
typedef struct
@@ -482,6 +484,18 @@ typedef struct
unsigned short blue[GLFW_GAMMA_RAMP_SIZE];
} GLFWgammaramp;
/* Custom memory allocator interface */
typedef struct
{
GLFWmallocfun malloc;
GLFWfreefun free;
} GLFWallocator;
/* Custom threading model interface */
typedef struct
{
} GLFWthreadmodel;
/*************************************************************************
* Prototypes
@@ -489,6 +503,7 @@ typedef struct
/* Initialization, termination and version querying */
GLFWAPI int glfwInit(void);
GLFWAPI int glfwInitWithModels(GLFWthreadmodel* threading, GLFWallocator* allocator);
GLFWAPI void glfwTerminate(void);
GLFWAPI void glfwGetVersion(int* major, int* minor, int* rev);
GLFWAPI const char* glfwGetVersionString(void);