diff options
Diffstat (limited to 'libs/rs/scriptc/rs_graphics.rsh')
-rw-r--r-- | libs/rs/scriptc/rs_graphics.rsh | 76 |
1 files changed, 28 insertions, 48 deletions
diff --git a/libs/rs/scriptc/rs_graphics.rsh b/libs/rs/scriptc/rs_graphics.rsh index 70cd562..626f267 100644 --- a/libs/rs/scriptc/rs_graphics.rsh +++ b/libs/rs/scriptc/rs_graphics.rsh @@ -1,65 +1,45 @@ +#include "rs_math.rsh" -extern float2 vec2Rand(float len); +// context +extern void rsgBindProgramFragment(rs_program_fragment); +extern void rsgBindProgramStore(rs_program_store); +extern void rsgBindProgramVertex(rs_program_vertex); +extern void rsgBindProgramRaster(rs_program_raster); -extern float3 float3Norm(float3); -extern float float3Length(float3); -extern float3 float3Add(float3 lhs, float3 rhs); -extern float3 float3Sub(float3 lhs, float3 rhs); -extern float3 float3Cross(float3 lhs, float3 rhs); -extern float float3Dot(float3 lhs, float3 rhs); -extern float3 float3Scale(float3 v, float scale); +extern void rsgBindSampler(rs_program_fragment, int slot, rs_sampler); +extern void rsgBindTexture(rs_program_fragment, int slot, rs_allocation); -extern float4 float4Add(float4 lhs, float4 rhs); -extern float4 float4Sub(float4 lhs, float4 rhs); -extern float4 float4Cross(float4 lhs, float4 rhs); -extern float float4Dot(float4 lhs, float4 rhs); -extern float4 float4Scale(float4 v, float scale); +extern void rsgProgramVertexLoadModelMatrix(const rs_matrix4x4 *); +extern void rsgProgramVertexLoadTextureMatrix(const rs_matrix4x4 *); - // context -extern void bindProgramFragment(rs_program_fragment); -extern void bindProgramStore(rs_program_store); -extern void bindProgramVertex(rs_program_vertex); +extern int rsgGetWidth(); +extern int rsgGetHeight(); -extern void bindSampler(rs_program_fragment, int slot, rs_sampler); -extern void bindSampler(rs_program_fragment, int slot, rs_allocation); +extern void __attribute__((overloadable)) rsgUploadToTexture(rs_allocation); +extern void __attribute__((overloadable)) rsgUploadToTexture(rs_allocation, int mipLevel); +extern void rsgUploadToBufferObject(rs_allocation); +//extern void rsgUploadMesh(rs_mesh); -extern void vpLoadModelMatrix(const float *); -extern void vpLoadTextureMatrix(const float *); +extern void rsgDrawRect(float x1, float y1, float x2, float y2, float z); +extern void rsgDrawQuad(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4); +extern void rsgDrawQuadTexCoords(float x1, float y1, float z1, float u1, float v1, float x2, float y2, float z2, float u2, float v2, float x3, float y3, float z3, float u3, float v3, float x4, float y4, float z4, float u4, float v4); +//extern void rsgDrawSprite(float x, float y, float z, float w, float h); +extern void rsgDrawSpriteScreenspace(float x, float y, float z, float w, float h); +extern void rsgDrawLine(float x1, float y1, float z1, float x2, float y2, float z2); +extern void rsgDrawPoint(float x1, float y1, float z1); +extern void __attribute__((overloadable)) rsgDrawSimpleMesh(rs_mesh ism); +extern void __attribute__((overloadable)) rsgDrawSimpleMesh(rs_mesh ism, int start, int len); +extern void rsgClearColor(float, float, float, float); +extern void rsgClearDepth(float); -// drawing -extern void drawRect(float x1, float y1, float x2, float y2, float z); -extern void drawQuad(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4); -extern void drawQuadTexCoords(float x1, float y1, float z1, float u1, float v1, float x2, float y2, float z2, float u2, float v2, float x3, float y3, float z3, float u3, float v3, float x4, float y4, float z4, float u4, float v4); -extern void drawSprite(float x, float y, float z, float w, float h); -extern void drawSpriteScreenspace(float x, float y, float z, float w, float h); -extern void drawLine(float x1, float y1, float z1, float x2, float y2, float z2); -extern void drawPoint(float x1, float y1, float z1); -extern void drawSimpleMesh(int ism); -extern void drawSimpleMeshRange(int ism, int start, int len); - +/////////////////////////////////////////////////////// // misc -extern void pfClearColor(float, float, float, float); extern void color(float, float, float, float); extern void hsb(float, float, float, float); extern void hsbToRgb(float, float, float, float*); extern int hsbToAbgr(float, float, float, float); -extern void uploadToTexture(int, int); -extern void uploadToBufferObject(int); - -extern int colorFloatRGBAtoUNorm8(float, float, float, float); -extern int colorFloatRGBto565(float, float, float); - -extern int getWidth(); -extern int getHeight(); - -extern int sendToClient(void *data, int cmdID, int len, int waitForSpace); - -extern void debugF(const char *, float); -extern void debugI32(const char *, int); -extern void debugHexI32(const char *, int); - |