File tree 3 files changed +16
-2
lines changed
3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -735,7 +735,14 @@ class DebugRendererImpl final : public JPH::DebugRenderer
735
735
{
736
736
public:
737
737
JPH_OVERRIDE_NEW_DELETE
738
- BatchImpl (const JPC_DebugRenderer_Primitive *prim) : RenderPrimitive(prim) { }
738
+ BatchImpl (const JPC_DebugRenderer_Primitive *c_primitive) : RenderPrimitive(c_primitive) {}
739
+ ~BatchImpl ()
740
+ {
741
+ if (sInstance && sInstance ->c_renderer ->vtbl ->DestroyTriangleBatch )
742
+ {
743
+ sInstance ->c_renderer ->vtbl ->DestroyTriangleBatch (sInstance ->c_renderer , c_primitive);
744
+ }
745
+ }
739
746
740
747
virtual void AddRef () override
741
748
{
Original file line number Diff line number Diff line change @@ -1048,6 +1048,10 @@ typedef struct JPC_DebugRendererVTable
1048
1048
const uint32_t *in_indices,
1049
1049
uint32_t in_index_count);
1050
1050
1051
+ // Optional
1052
+ void
1053
+ (*DestroyTriangleBatch)(void *in_self, const void *in_primitive);
1054
+
1051
1055
// Required, *cannot* be NULL.
1052
1056
void
1053
1057
(*DrawGeometry)(void *in_self,
Original file line number Diff line number Diff line change @@ -1278,7 +1278,6 @@ pub const DebugRenderer = if (!debug_renderer_enabled) extern struct {} else ext
1278
1278
1279
1279
pub fn destroySingleton () void {
1280
1280
_ = c .JPC_DestroyDebugRendererSingleton (); // For Zig API, don't care if one actually existed, discard error.
1281
-
1282
1281
}
1283
1282
1284
1283
pub fn createTriangleBatch (primitive_in : * const anyopaque ) * TriangleBatch {
@@ -1422,6 +1421,10 @@ pub const DebugRenderer = if (!debug_renderer_enabled) extern struct {} else ext
1422
1421
indices : [* ]u32 ,
1423
1422
index_count : u32 ,
1424
1423
) callconv (.C ) * anyopaque = null ,
1424
+ destroyTriangleBatch : ? * const fn (
1425
+ self : * T ,
1426
+ batch : * const anyopaque ,
1427
+ ) callconv (.C ) void = null ,
1425
1428
drawGeometry : ? * const fn (
1426
1429
self : * T ,
1427
1430
model_matrix : * const RMatrix ,
You can’t perform that action at this time.
0 commit comments