Jason Sams | c4cdf45 | 2010-07-07 11:55:51 -0700 | [diff] [blame] | 1 | #ifndef __RS_MATH_RSH__ |
| 2 | #define __RS_MATH_RSH__ |
| 3 | |
Jason Sams | 22fa371 | 2010-05-19 17:22:57 -0700 | [diff] [blame] | 4 | #include "rs_cl.rsh" |
Jason Sams | 275b1e9 | 2010-05-28 18:08:16 -0700 | [diff] [blame] | 5 | #include "rs_core.rsh" |
| 6 | |
Jason Sams | 717e34a | 2010-03-16 15:35:57 -0700 | [diff] [blame] | 7 | |
Jason Sams | be36bf3 | 2010-05-11 14:03:58 -0700 | [diff] [blame] | 8 | |
Jason Sams | 22fa371 | 2010-05-19 17:22:57 -0700 | [diff] [blame] | 9 | // Allocations |
Jason Sams | ce92d4b | 2010-05-17 14:55:34 -0700 | [diff] [blame] | 10 | extern rs_allocation rsGetAllocation(const void *); |
Jason Sams | 22fa371 | 2010-05-19 17:22:57 -0700 | [diff] [blame] | 11 | extern uint32_t rsAllocationGetDimX(rs_allocation); |
| 12 | extern uint32_t rsAllocationGetDimY(rs_allocation); |
| 13 | extern uint32_t rsAllocationGetDimZ(rs_allocation); |
| 14 | extern uint32_t rsAllocationGetDimLOD(rs_allocation); |
| 15 | extern uint32_t rsAllocationGetDimFaces(rs_allocation); |
| 16 | |
| 17 | |
| 18 | |
Jason Sams | 22fa371 | 2010-05-19 17:22:57 -0700 | [diff] [blame] | 19 | // Debugging |
| 20 | extern void __attribute__((overloadable))rsDebug(const char *, float); |
| 21 | extern void __attribute__((overloadable))rsDebug(const char *, float2); |
| 22 | extern void __attribute__((overloadable))rsDebug(const char *, float3); |
| 23 | extern void __attribute__((overloadable))rsDebug(const char *, float4); |
| 24 | extern void __attribute__((overloadable))rsDebug(const char *, int); |
| 25 | extern void __attribute__((overloadable))rsDebug(const char *, const void *); |
| 26 | #define RS_DEBUG(a) rsDebug(#a, a) |
| 27 | #define RS_DEBUG_MARKER rsDebug(__FILE__, __LINE__) |
| 28 | |
| 29 | // RS Math |
| 30 | extern int __attribute__((overloadable)) rsRand(int); |
| 31 | extern int __attribute__((overloadable)) rsRand(int, int); |
| 32 | extern float __attribute__((overloadable)) rsRand(float); |
| 33 | extern float __attribute__((overloadable)) rsRand(float, float); |
| 34 | |
| 35 | extern float __attribute__((overloadable)) rsFrac(float); |
| 36 | |
| 37 | // time |
| 38 | extern int32_t rsSecond(); |
| 39 | extern int32_t rsMinute(); |
| 40 | extern int32_t rsHour(); |
| 41 | extern int32_t rsDay(); |
| 42 | extern int32_t rsMonth(); |
| 43 | extern int32_t rsYear(); |
| 44 | extern int64_t rsUptimeMillis(); |
| 45 | extern int64_t rsStartTimeMillis(); |
| 46 | extern int64_t rsElapsedTimeMillis(); |
| 47 | |
| 48 | extern int rsSendToClient(void *data, int cmdID, int len, int waitForSpace); |
| 49 | |
Jason Sams | c61346b | 2010-05-28 18:23:22 -0700 | [diff] [blame] | 50 | // Script to Script |
Jason Sams | 479e292 | 2010-07-09 15:34:32 -0700 | [diff] [blame] | 51 | typedef struct rs_script_call_rec { |
| 52 | rs_script script; |
| 53 | rs_allocation input; |
| 54 | rs_allocation output; |
| 55 | |
| 56 | uint32_t xStart; |
| 57 | uint32_t xEnd; |
| 58 | uint32_t yStart; |
| 59 | uint32_t yEnd; |
| 60 | uint32_t zStart; |
| 61 | uint32_t zEnd; |
| 62 | uint32_t arrayStart; |
| 63 | uint32_t arrayEnd; |
| 64 | |
| 65 | const void * usrData; |
| 66 | } rs_script_call; |
| 67 | |
Jason Sams | c61346b | 2010-05-28 18:23:22 -0700 | [diff] [blame] | 68 | extern void __attribute__((overloadable))rsForEach(rs_script, rs_allocation input); |
| 69 | extern void __attribute__((overloadable))rsForEach(rs_script, rs_allocation input, rs_allocation output); |
| 70 | extern void __attribute__((overloadable))rsForEach(rs_script, rs_allocation input, int xStart, int xEnd); |
| 71 | extern void __attribute__((overloadable))rsForEach(rs_script, rs_allocation input, rs_allocation output, int xStart, int xEnd); |
| 72 | extern void __attribute__((overloadable))rsForEach(rs_script, rs_allocation input, int xStart, int yStart, int xEnd, int yEnd); |
| 73 | extern void __attribute__((overloadable))rsForEach(rs_script, rs_allocation input, rs_allocation output, int xStart, int yStart, int xEnd, int yEnd); |
| 74 | |
Jason Sams | c4cdf45 | 2010-07-07 11:55:51 -0700 | [diff] [blame] | 75 | #endif |