Jason Sams | 22fa371 | 2010-05-19 17:22:57 -0700 | [diff] [blame] | 1 | #include "rs_cl.rsh" |
Jason Sams | 717e34a | 2010-03-16 15:35:57 -0700 | [diff] [blame] | 2 | |
Jason Sams | be36bf3 | 2010-05-11 14:03:58 -0700 | [diff] [blame] | 3 | |
Jason Sams | 22fa371 | 2010-05-19 17:22:57 -0700 | [diff] [blame] | 4 | // Allocations |
Jason Sams | ce92d4b | 2010-05-17 14:55:34 -0700 | [diff] [blame] | 5 | extern rs_allocation rsGetAllocation(const void *); |
Jason Sams | 22fa371 | 2010-05-19 17:22:57 -0700 | [diff] [blame] | 6 | extern uint32_t rsAllocationGetDimX(rs_allocation); |
| 7 | extern uint32_t rsAllocationGetDimY(rs_allocation); |
| 8 | extern uint32_t rsAllocationGetDimZ(rs_allocation); |
| 9 | extern uint32_t rsAllocationGetDimLOD(rs_allocation); |
| 10 | extern uint32_t rsAllocationGetDimFaces(rs_allocation); |
| 11 | |
| 12 | |
| 13 | |
| 14 | // Color conversion |
| 15 | extern uchar4 __attribute__((overloadable)) rsPackColorTo8888(float r, float g, float b); |
| 16 | extern uchar4 __attribute__((overloadable)) rsPackColorTo8888(float r, float g, float b, float a); |
| 17 | extern uchar4 __attribute__((overloadable)) rsPackColorTo8888(float3); |
| 18 | extern uchar4 __attribute__((overloadable)) rsPackColorTo8888(float4); |
| 19 | extern float4 rsUnpackColor8888(uchar4); |
| 20 | |
| 21 | extern uchar4 __attribute__((overloadable)) rsPackColorTo565(float r, float g, float b); |
| 22 | extern uchar4 __attribute__((overloadable)) rsPackColorTo565(float3); |
| 23 | extern float4 rsUnpackColor565(uchar4); |
| 24 | |
| 25 | |
| 26 | // Debugging |
| 27 | extern void __attribute__((overloadable))rsDebug(const char *, float); |
| 28 | extern void __attribute__((overloadable))rsDebug(const char *, float2); |
| 29 | extern void __attribute__((overloadable))rsDebug(const char *, float3); |
| 30 | extern void __attribute__((overloadable))rsDebug(const char *, float4); |
| 31 | extern void __attribute__((overloadable))rsDebug(const char *, int); |
| 32 | extern void __attribute__((overloadable))rsDebug(const char *, const void *); |
| 33 | #define RS_DEBUG(a) rsDebug(#a, a) |
| 34 | #define RS_DEBUG_MARKER rsDebug(__FILE__, __LINE__) |
| 35 | |
| 36 | // RS Math |
| 37 | extern int __attribute__((overloadable)) rsRand(int); |
| 38 | extern int __attribute__((overloadable)) rsRand(int, int); |
| 39 | extern float __attribute__((overloadable)) rsRand(float); |
| 40 | extern float __attribute__((overloadable)) rsRand(float, float); |
| 41 | |
| 42 | extern float __attribute__((overloadable)) rsFrac(float); |
| 43 | |
| 44 | // time |
| 45 | extern int32_t rsSecond(); |
| 46 | extern int32_t rsMinute(); |
| 47 | extern int32_t rsHour(); |
| 48 | extern int32_t rsDay(); |
| 49 | extern int32_t rsMonth(); |
| 50 | extern int32_t rsYear(); |
| 51 | extern int64_t rsUptimeMillis(); |
| 52 | extern int64_t rsStartTimeMillis(); |
| 53 | extern int64_t rsElapsedTimeMillis(); |
| 54 | |
| 55 | extern int rsSendToClient(void *data, int cmdID, int len, int waitForSpace); |
| 56 | |
| 57 | extern void rsMatrixLoadIdentity(rs_matrix4x4 *mat); |
| 58 | extern void rsMatrixLoadFloat(rs_matrix4x4 *mat, const float *f); |
| 59 | extern void rsMatrixLoadMat(rs_matrix4x4 *mat, const rs_matrix4x4 *newmat); |
| 60 | extern void rsMatrixLoadRotate(rs_matrix4x4 *mat, float rot, float x, float y, float z); |
| 61 | extern void rsMatrixLoadScale(rs_matrix4x4*mat, float x, float y, float z); |
| 62 | extern void rsMatrixLoadTranslate(rs_matrix4x4 *mat, float x, float y, float z); |
| 63 | extern void rsMatrixLoadMultiply(rs_matrix4x4 *mat, const rs_matrix4x4 *lhs, const rs_matrix4x4 *rhs); |
| 64 | extern void rsMatrixMultiply(rs_matrix4x4 *mat, const rs_matrix4x4 *rhs); |
| 65 | extern void rsMatrixRotate(rs_matrix4x4 *mat, float rot, float x, float y, float z); |
| 66 | extern void rsMatrixScale(rs_matrix4x4 *mat, float x, float y, float z); |
| 67 | extern void rsMatrixTranslate(rs_matrix4x4 *mat, float x, float y, float z); |
| 68 | |
| 69 | |
| 70 | /////////////////////////////////////////////////////////////////// |
| 71 | // non update funcs |
| 72 | |
Jason Sams | 22fa371 | 2010-05-19 17:22:57 -0700 | [diff] [blame] | 73 | /* |
| 74 | extern float3 float3Norm(float3); |
| 75 | extern float float3Length(float3); |
| 76 | extern float3 float3Add(float3 lhs, float3 rhs); |
| 77 | extern float3 float3Sub(float3 lhs, float3 rhs); |
| 78 | extern float3 float3Cross(float3 lhs, float3 rhs); |
| 79 | extern float float3Dot(float3 lhs, float3 rhs); |
| 80 | extern float3 float3Scale(float3 v, float scale); |
| 81 | |
| 82 | extern float4 float4Add(float4 lhs, float4 rhs); |
| 83 | extern float4 float4Sub(float4 lhs, float4 rhs); |
| 84 | extern float4 float4Cross(float4 lhs, float4 rhs); |
| 85 | extern float float4Dot(float4 lhs, float4 rhs); |
| 86 | extern float4 float4Scale(float4 v, float scale); |
| 87 | */ |
| 88 | |
Jason Sams | 717e34a | 2010-03-16 15:35:57 -0700 | [diff] [blame] | 89 | |