2010-07-07 11:55:51 -07:00
|
|
|
#ifndef __RS_MATH_RSH__
|
|
|
|
#define __RS_MATH_RSH__
|
|
|
|
|
2010-05-19 17:22:57 -07:00
|
|
|
#include "rs_cl.rsh"
|
2010-05-28 18:08:16 -07:00
|
|
|
#include "rs_core.rsh"
|
|
|
|
|
2010-03-16 15:35:57 -07:00
|
|
|
|
2010-05-11 14:03:58 -07:00
|
|
|
|
2010-05-19 17:22:57 -07:00
|
|
|
// Allocations
|
2010-07-28 11:17:53 -07:00
|
|
|
extern rs_allocation __attribute__((overloadable))
|
|
|
|
rsGetAllocation(const void *);
|
|
|
|
extern uint32_t __attribute__((overloadable))
|
|
|
|
rsAllocationGetDimX(rs_allocation);
|
|
|
|
extern uint32_t __attribute__((overloadable))
|
|
|
|
rsAllocationGetDimY(rs_allocation);
|
|
|
|
extern uint32_t __attribute__((overloadable))
|
|
|
|
rsAllocationGetDimZ(rs_allocation);
|
|
|
|
extern uint32_t __attribute__((overloadable))
|
|
|
|
rsAllocationGetDimLOD(rs_allocation);
|
|
|
|
extern uint32_t __attribute__((overloadable))
|
|
|
|
rsAllocationGetDimFaces(rs_allocation);
|
2010-05-19 17:22:57 -07:00
|
|
|
|
2010-07-19 15:38:19 -07:00
|
|
|
extern const void * __attribute__((overloadable))
|
|
|
|
rsGetElementAt(rs_allocation, uint32_t x);
|
|
|
|
extern const void * __attribute__((overloadable))
|
|
|
|
rsGetElementAt(rs_allocation, uint32_t x, uint32_t y);
|
|
|
|
extern const void * __attribute__((overloadable))
|
|
|
|
rsGetElementAt(rs_allocation, uint32_t x, uint32_t y, uint32_t z);
|
2010-05-19 17:22:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
// Debugging
|
|
|
|
extern void __attribute__((overloadable))rsDebug(const char *, float);
|
|
|
|
extern void __attribute__((overloadable))rsDebug(const char *, float2);
|
|
|
|
extern void __attribute__((overloadable))rsDebug(const char *, float3);
|
|
|
|
extern void __attribute__((overloadable))rsDebug(const char *, float4);
|
|
|
|
extern void __attribute__((overloadable))rsDebug(const char *, int);
|
2010-07-28 11:17:53 -07:00
|
|
|
extern void __attribute__((overloadable))rsDebug(const char *, uint);
|
2010-05-19 17:22:57 -07:00
|
|
|
extern void __attribute__((overloadable))rsDebug(const char *, const void *);
|
|
|
|
#define RS_DEBUG(a) rsDebug(#a, a)
|
|
|
|
#define RS_DEBUG_MARKER rsDebug(__FILE__, __LINE__)
|
|
|
|
|
|
|
|
// RS Math
|
2010-07-28 11:17:53 -07:00
|
|
|
extern int __attribute__((overloadable))rsRand(int);
|
|
|
|
extern int __attribute__((overloadable))rsRand(int, int);
|
|
|
|
extern float __attribute__((overloadable))rsRand(float);
|
|
|
|
extern float __attribute__((overloadable))rsRand(float, float);
|
2010-05-19 17:22:57 -07:00
|
|
|
|
|
|
|
extern float __attribute__((overloadable)) rsFrac(float);
|
|
|
|
|
|
|
|
// time
|
2010-07-28 11:17:53 -07:00
|
|
|
extern int32_t /*__attribute__((overloadable))*/rsSecond();
|
|
|
|
extern int32_t /*__attribute__((overloadable))*/rsMinute();
|
|
|
|
extern int32_t /*__attribute__((overloadable))*/rsHour();
|
|
|
|
extern int32_t /*__attribute__((overloadable))*/rsDay();
|
|
|
|
extern int32_t /*__attribute__((overloadable))*/rsMonth();
|
|
|
|
extern int32_t /*__attribute__((overloadable))*/rsYear();
|
|
|
|
extern int64_t /*__attribute__((overloadable))*/rsUptimeMillis();
|
|
|
|
extern int64_t /*__attribute__((overloadable))*/rsStartTimeMillis();
|
|
|
|
extern int64_t /*__attribute__((overloadable))*/rsElapsedTimeMillis();
|
|
|
|
extern float /*__attribute__((overloadable))*/rsGetDt();
|
|
|
|
|
|
|
|
extern bool __attribute__((overloadable))rsSendToClient(int cmdID);
|
|
|
|
extern bool __attribute__((overloadable))rsSendToClient(int cmdID, const void *data, uint len);
|
|
|
|
extern void __attribute__((overloadable))rsSendToClientBlocking(int cmdID);
|
|
|
|
extern void __attribute__((overloadable))rsSendToClientBlocking(int cmdID, const void *data, uint len);
|
2010-05-19 17:22:57 -07:00
|
|
|
|
2010-05-28 18:23:22 -07:00
|
|
|
// Script to Script
|
2010-07-15 17:11:13 -07:00
|
|
|
typedef struct rs_script_call {
|
2010-07-09 15:34:32 -07:00
|
|
|
uint32_t xStart;
|
|
|
|
uint32_t xEnd;
|
|
|
|
uint32_t yStart;
|
|
|
|
uint32_t yEnd;
|
|
|
|
uint32_t zStart;
|
|
|
|
uint32_t zEnd;
|
|
|
|
uint32_t arrayStart;
|
|
|
|
uint32_t arrayEnd;
|
|
|
|
|
2010-07-15 17:11:13 -07:00
|
|
|
} rs_script_call_t;
|
|
|
|
|
|
|
|
extern void __attribute__((overloadable))rsForEach(rs_script script,
|
|
|
|
rs_allocation input,
|
|
|
|
rs_allocation output,
|
|
|
|
const void * usrData);
|
2010-07-09 15:34:32 -07:00
|
|
|
|
2010-07-15 17:11:13 -07:00
|
|
|
extern void __attribute__((overloadable))rsForEach(rs_script script,
|
|
|
|
rs_allocation input,
|
|
|
|
rs_allocation output,
|
|
|
|
const void * usrData,
|
|
|
|
const rs_script_call_t *);
|
2010-05-28 18:23:22 -07:00
|
|
|
|
2010-07-07 11:55:51 -07:00
|
|
|
#endif
|