Program Listing for File HostAPI_macros.h
↰ Return to documentation for file (include/flamegpu/runtime/HostAPI_macros.h
)
#ifndef INCLUDE_FLAMEGPU_RUNTIME_HOSTAPI_MACROS_H_
#define INCLUDE_FLAMEGPU_RUNTIME_HOSTAPI_MACROS_H_
namespace flamegpu {
class HostAPI;
typedef void (*FLAMEGPU_HOST_FUNCTION_POINTER)(HostAPI *api);
typedef FLAMEGPU_HOST_FUNCTION_POINTER FLAMEGPU_INIT_FUNCTION_POINTER;
typedef FLAMEGPU_HOST_FUNCTION_POINTER FLAMEGPU_STEP_FUNCTION_POINTER;
typedef FLAMEGPU_HOST_FUNCTION_POINTER FLAMEGPU_EXIT_FUNCTION_POINTER;
#define FLAMEGPU_INIT_FUNCTION(funcName) FLAMEGPU_HOST_FUNCTION(funcName)
#define FLAMEGPU_STEP_FUNCTION(funcName) FLAMEGPU_HOST_FUNCTION(funcName)
#define FLAMEGPU_EXIT_FUNCTION(funcName) FLAMEGPU_HOST_FUNCTION(funcName)
#define FLAMEGPU_HOST_FUNCTION_DECL(funcName) \
extern flamegpu::FLAMEGPU_HOST_FUNCTION_POINTER funcName;
#define FLAMEGPU_HOST_FUNCTION_DEF(funcName) \
void funcName ## _impl(flamegpu::HostAPI* FLAMEGPU); \
flamegpu::FLAMEGPU_HOST_FUNCTION_POINTER funcName = funcName ## _impl; \
void funcName ## _impl(flamegpu::HostAPI* FLAMEGPU)
#define FLAMEGPU_HOST_FUNCTION(funcName) FLAMEGPU_HOST_FUNCTION_DEF(funcName)
enum CONDITION_RESULT { CONTINUE, EXIT };
typedef CONDITION_RESULT (*FLAMEGPU_HOST_CONDITION_POINTER)(HostAPI *api);
typedef FLAMEGPU_HOST_CONDITION_POINTER FLAMEGPU_EXIT_CONDITION_POINTER;
#define FLAMEGPU_EXIT_CONDITION(funcName) FLAMEGPU_HOST_CONDITION(funcName)
#define FLAMEGPU_HOST_CONDITION(funcName) \
flamegpu::CONDITION_RESULT funcName ## _impl(flamegpu::HostAPI* FLAMEGPU); \
flamegpu::FLAMEGPU_HOST_CONDITION_POINTER funcName = funcName ## _impl;\
flamegpu::CONDITION_RESULT funcName ## _impl(flamegpu::HostAPI* FLAMEGPU)
} // namespace flamegpu
#endif // INCLUDE_FLAMEGPU_RUNTIME_HOSTAPI_MACROS_H_