blob: 4390a5d94db35cab26699dbd225eb22918b97d5e [file] [log] [blame]
Jason Samsc4cdf452010-07-07 11:55:51 -07001#ifndef __RS_MATH_RSH__
2#define __RS_MATH_RSH__
3
Jason Sams22fa3712010-05-19 17:22:57 -07004#include "rs_cl.rsh"
Jason Sams275b1e92010-05-28 18:08:16 -07005#include "rs_core.rsh"
6
Jason Sams717e34a2010-03-16 15:35:57 -07007
Jason Samsbe36bf32010-05-11 14:03:58 -07008
Jason Sams22fa3712010-05-19 17:22:57 -07009// Allocations
Jason Samsce92d4b2010-05-17 14:55:34 -070010extern rs_allocation rsGetAllocation(const void *);
Jason Sams22fa3712010-05-19 17:22:57 -070011extern uint32_t rsAllocationGetDimX(rs_allocation);
12extern uint32_t rsAllocationGetDimY(rs_allocation);
13extern uint32_t rsAllocationGetDimZ(rs_allocation);
14extern uint32_t rsAllocationGetDimLOD(rs_allocation);
15extern uint32_t rsAllocationGetDimFaces(rs_allocation);
16
17
18
Jason Sams22fa3712010-05-19 17:22:57 -070019// Debugging
20extern void __attribute__((overloadable))rsDebug(const char *, float);
21extern void __attribute__((overloadable))rsDebug(const char *, float2);
22extern void __attribute__((overloadable))rsDebug(const char *, float3);
23extern void __attribute__((overloadable))rsDebug(const char *, float4);
24extern void __attribute__((overloadable))rsDebug(const char *, int);
25extern 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
30extern int __attribute__((overloadable)) rsRand(int);
31extern int __attribute__((overloadable)) rsRand(int, int);
32extern float __attribute__((overloadable)) rsRand(float);
33extern float __attribute__((overloadable)) rsRand(float, float);
34
35extern float __attribute__((overloadable)) rsFrac(float);
36
37// time
38extern int32_t rsSecond();
39extern int32_t rsMinute();
40extern int32_t rsHour();
41extern int32_t rsDay();
42extern int32_t rsMonth();
43extern int32_t rsYear();
44extern int64_t rsUptimeMillis();
45extern int64_t rsStartTimeMillis();
46extern int64_t rsElapsedTimeMillis();
47
48extern int rsSendToClient(void *data, int cmdID, int len, int waitForSpace);
49
Jason Samsc61346b2010-05-28 18:23:22 -070050// Script to Script
Jason Sams479e2922010-07-09 15:34:32 -070051typedef 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 Samsc61346b2010-05-28 18:23:22 -070068extern void __attribute__((overloadable))rsForEach(rs_script, rs_allocation input);
69extern void __attribute__((overloadable))rsForEach(rs_script, rs_allocation input, rs_allocation output);
70extern void __attribute__((overloadable))rsForEach(rs_script, rs_allocation input, int xStart, int xEnd);
71extern void __attribute__((overloadable))rsForEach(rs_script, rs_allocation input, rs_allocation output, int xStart, int xEnd);
72extern void __attribute__((overloadable))rsForEach(rs_script, rs_allocation input, int xStart, int yStart, int xEnd, int yEnd);
73extern void __attribute__((overloadable))rsForEach(rs_script, rs_allocation input, rs_allocation output, int xStart, int yStart, int xEnd, int yEnd);
74
Jason Samsc4cdf452010-07-07 11:55:51 -070075#endif