浏览代码

Updated C99 API.

Branimir Karadžić 10 年之前
父节点
当前提交
7ebc6e3cbb
共有 2 个文件被更改,包括 17 次插入0 次删除
  1. 12 0
      include/bgfx.c99.h
  2. 5 0
      src/bgfx.cpp

+ 12 - 0
include/bgfx.c99.h

@@ -167,6 +167,12 @@ BGFX_HANDLE_T(bgfx_vertex_decl_handle);
 #undef BGFX_HANDLE_T
 
 /**
+ *
+ */
+typedef void (*bgfx_release_fn_t)(void* _ptr, void* _userData);
+
+/**
+ *
  */
 typedef struct bgfx_memory
 {
@@ -176,6 +182,7 @@ typedef struct bgfx_memory
 } bgfx_memory_t;
 
 /**
+ *
  */
 typedef struct bgfx_transform
 {
@@ -634,6 +641,11 @@ BGFX_C_API const bgfx_memory_t* bgfx_copy(const void* _data, uint32_t _size);
  */
 BGFX_C_API const bgfx_memory_t* bgfx_make_ref(const void* _data, uint32_t _size);
 
+/**
+ *
+ */
+BGFX_C_API const bgfx_memory_t* bgfx_make_ref_release(const void* _data, uint32_t _size, bgfx_release_fn_t _releaseFn, void* _userData);
+
 /**
  *  Set debug flags.
  *

+ 5 - 0
src/bgfx.cpp

@@ -3096,6 +3096,11 @@ BGFX_C_API const bgfx_memory_t* bgfx_make_ref(const void* _data, uint32_t _size)
 	return (const bgfx_memory_t*)bgfx::makeRef(_data, _size);
 }
 
+BGFX_C_API const bgfx_memory_t* bgfx_make_ref_release(const void* _data, uint32_t _size, bgfx_release_fn_t _releaseFn, void* _userData)
+{
+	return (const bgfx_memory_t*)bgfx::makeRef(_data, _size, _releaseFn, _userData);
+}
+
 BGFX_C_API void bgfx_set_debug(uint32_t _debug)
 {
 	bgfx::setDebug(_debug);