Implement SetScratchBuffer

This commit is contained in:
bloeys
2022-01-28 06:36:19 +04:00
parent 4af88c06d3
commit 56a7943405
4 changed files with 17 additions and 2 deletions

View File

@ -11,6 +11,8 @@ extern "C" {
struct CPxScene
{
void* obj;
void* scratchBuffer;
CPxU32 scratchBufferSize;
};
CPxAPI CSTRUCT CPxPvdSceneClient* CPxScene_getScenePvdClient(CSTRUCT CPxScene*);
@ -18,6 +20,14 @@ extern "C" {
CPxAPI void CPxScene_simulate(CSTRUCT CPxScene*, CPxReal elapsedTime);
CPxAPI bool CPxScene_fetchResults(CSTRUCT CPxScene*, bool block, CPxU32* errorState);
/// <summary>
/// Creates a scratch buffer thats a multiple of 16K to be used by the scene when running CPxScene_simulate.
/// The buffer MUST be 16-byte aligned. If a buffer already exists then it is freed and a new one is allocated.
/// If multiples passed are zero then any existing buffers are cleared
/// </summary>
/// <returns></returns>
CPxAPI void CPxScene_setScratchBuffer(CSTRUCT CPxScene*, uint32_t multiplesOf16k);
CPxAPI void CPxScene_release(CSTRUCT CPxScene*);
#ifdef __cplusplus