gx2r: Add some gx2r memory functions.

This commit is contained in:
James Benton 2016-10-09 20:58:02 +01:00
parent 41cee3bd14
commit 467fb4e8ca
2 changed files with 39 additions and 0 deletions

34
include/gx2r/mem.h Normal file
View File

@ -0,0 +1,34 @@
#pragma once
#include <wut.h>
#include "resource.h"
/**
* \defgroup gx2r_mem Memory
* \ingroup gx2r
* @{
*/
#ifdef __cplusplus
extern "C" {
#endif
typedef void * (*GX2RAllocFunction)(GX2RResourceFlags, uint32_t, uint32_t);
typedef void (*GX2RFreeFunction)(GX2RResourceFlags, void *);
void
GX2RInvalidateMemory(GX2RResourceFlags flags,
void *buffer,
uint32_t size);
BOOL
GX2RIsUserMemory(GX2RResourceFlags flags);
void
GX2RSetAllocator(GX2RAllocFunction allocFn,
GX2RFreeFunction freeFn);
#ifdef __cplusplus
}
#endif
/** @} */

View File

@ -224,3 +224,8 @@ EXPORT(GX2RDirectCallDisplayList);
EXPORT(GX2RSetAttributeBuffer);
EXPORT(GX2RDrawIndexed);
// gx2r/mem.h
EXPORT(GX2RInvalidateMemory);
EXPORT(GX2RIsUserMemory);
EXPORT(GX2RSetAllocator);