2
0
Branimir Karadžić 10 жил өмнө
parent
commit
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
 #undef BGFX_HANDLE_T
 
 
 /**
 /**
+ *
+ */
+typedef void (*bgfx_release_fn_t)(void* _ptr, void* _userData);
+
+/**
+ *
  */
  */
 typedef struct bgfx_memory
 typedef struct bgfx_memory
 {
 {
@@ -176,6 +182,7 @@ typedef struct bgfx_memory
 } bgfx_memory_t;
 } bgfx_memory_t;
 
 
 /**
 /**
+ *
  */
  */
 typedef struct bgfx_transform
 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(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.
  *  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);
 	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_C_API void bgfx_set_debug(uint32_t _debug)
 {
 {
 	bgfx::setDebug(_debug);
 	bgfx::setDebug(_debug);