seperate out tick and render update calls

This commit is contained in:
2024-01-07 14:37:33 +01:00
parent 96bab0200f
commit 75e7c5e3c7
5 changed files with 56 additions and 10 deletions

View File

@@ -3,7 +3,7 @@
#include <stdint.h>
#define SOLANA_PLUGIN_VERSION 6
#define SOLANA_PLUGIN_VERSION 7
#if defined(_MSC_VER) || defined(__MINGW32__)
#define SOLANA_PLUGIN_EXPORT __declspec(dllexport)
@@ -15,6 +15,7 @@
#if defined(SOLANA_PLUGIN_HOST)
#define SOLANA_PLUGIN_DECL
// TODO: this looks like decl should be used, but it isnt
#else
#define SOLANA_PLUGIN_DECL SOLANA_PLUGIN_EXPORT
#endif
@@ -34,7 +35,9 @@ struct SolanaAPI {
// ---------- info ----------
// TODO: change to exported struct, so we dont have to execute this code
SOLANA_PLUGIN_EXPORT const char* solana_plugin_get_name(void);
// TODO: add author and other attributes
// get the SOLANA_PLUGIN_VERSION the plugin was compiled with
SOLANA_PLUGIN_EXPORT uint32_t solana_plugin_get_version(void);
@@ -46,9 +49,14 @@ SOLANA_PLUGIN_EXPORT uint32_t solana_plugin_start(struct SolanaAPI* solana_api);
SOLANA_PLUGIN_EXPORT void solana_plugin_stop(void);
// called periodically
SOLANA_PLUGIN_EXPORT void solana_plugin_tick(float delta);
// ---------- called periodically ----------
// rendering needs to be called in a different interval AND needs to be garantied from mainthread
// the functions return the minimum time in seconds until the update should be called next
// for compute tasks
SOLANA_PLUGIN_EXPORT float solana_plugin_tick(float delta);
// on frame rendering
SOLANA_PLUGIN_EXPORT float solana_plugin_render(float delta);
#ifdef __cplusplus
}