2017-08-29 10:12:56 +02:00
|
|
|
namespace rw {
|
|
|
|
|
|
|
|
// Render states
|
|
|
|
|
|
|
|
enum RenderState
|
|
|
|
{
|
2018-07-02 07:01:34 +02:00
|
|
|
TEXTURERASTER,
|
|
|
|
TEXTUREADDRESS,
|
|
|
|
TEXTUREADDRESSU,
|
|
|
|
TEXTUREADDRESSV,
|
|
|
|
TEXTUREFILTER,
|
|
|
|
VERTEXALPHA,
|
2017-08-29 10:12:56 +02:00
|
|
|
SRCBLEND,
|
|
|
|
DESTBLEND,
|
|
|
|
ZTESTENABLE,
|
|
|
|
ZWRITEENABLE,
|
|
|
|
FOGENABLE,
|
|
|
|
FOGCOLOR,
|
2018-01-03 18:02:02 +01:00
|
|
|
CULLMODE,
|
2017-08-29 10:12:56 +02:00
|
|
|
// TODO:
|
|
|
|
// fog type, density ?
|
|
|
|
// ? shademode
|
2020-12-16 15:48:26 +01:00
|
|
|
|
|
|
|
STENCILENABLE,
|
|
|
|
STENCILFAIL,
|
|
|
|
STENCILZFAIL,
|
|
|
|
STENCILPASS,
|
|
|
|
STENCILFUNCTION,
|
|
|
|
STENCILFUNCTIONREF,
|
|
|
|
STENCILFUNCTIONMASK,
|
|
|
|
STENCILFUNCTIONWRITEMASK,
|
2017-08-29 10:12:56 +02:00
|
|
|
|
|
|
|
// platform specific or opaque?
|
|
|
|
ALPHATESTFUNC,
|
2020-04-25 12:16:04 +02:00
|
|
|
ALPHATESTREF,
|
|
|
|
|
|
|
|
// emulation of PS2 GS alpha test
|
|
|
|
// in the mode where it still writes color but nor depth
|
|
|
|
GSALPHATEST,
|
|
|
|
GSALPHATESTREF
|
2017-08-29 10:12:56 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
enum AlphaTestFunc
|
|
|
|
{
|
2020-04-15 09:47:43 +02:00
|
|
|
ALPHAALWAYS,
|
2017-08-29 10:12:56 +02:00
|
|
|
ALPHAGREATEREQUAL,
|
|
|
|
ALPHALESS
|
|
|
|
};
|
|
|
|
|
2020-12-16 15:48:26 +01:00
|
|
|
enum StencilOp
|
|
|
|
{
|
|
|
|
STENCILKEEP = 1,
|
|
|
|
STENCILZERO,
|
|
|
|
STENCILREPLACE,
|
|
|
|
STENCILINCSAT,
|
|
|
|
STENCILDECSAT,
|
|
|
|
STENCILINVERT,
|
|
|
|
STENCILINC,
|
|
|
|
STENCILDEC
|
|
|
|
};
|
|
|
|
|
|
|
|
enum StencilFunc
|
|
|
|
{
|
|
|
|
STENCILNEVER = 1,
|
|
|
|
STENCILLESS,
|
|
|
|
STENCILEQUAL,
|
|
|
|
STENCILLESSEQUAL,
|
|
|
|
STENCILGREATER,
|
|
|
|
STENCILNOTEQUAL,
|
|
|
|
STENCILGREATEREQUAL,
|
|
|
|
STENCILALWAYS
|
|
|
|
};
|
|
|
|
|
2018-01-03 18:02:02 +01:00
|
|
|
enum CullMode
|
|
|
|
{
|
2020-04-15 09:47:43 +02:00
|
|
|
CULLNONE = 1,
|
2018-01-03 18:02:02 +01:00
|
|
|
CULLBACK,
|
|
|
|
CULLFRONT
|
|
|
|
};
|
|
|
|
|
2017-08-29 10:12:56 +02:00
|
|
|
enum BlendFunction
|
|
|
|
{
|
2020-04-15 09:47:43 +02:00
|
|
|
BLENDZERO = 1,
|
2017-08-29 10:12:56 +02:00
|
|
|
BLENDONE,
|
|
|
|
BLENDSRCCOLOR,
|
|
|
|
BLENDINVSRCCOLOR,
|
|
|
|
BLENDSRCALPHA,
|
|
|
|
BLENDINVSRCALPHA,
|
|
|
|
BLENDDESTALPHA,
|
|
|
|
BLENDINVDESTALPHA,
|
|
|
|
BLENDDESTCOLOR,
|
|
|
|
BLENDINVDESTCOLOR,
|
2018-07-13 01:09:45 +02:00
|
|
|
BLENDSRCALPHASAT
|
2017-08-29 10:12:56 +02:00
|
|
|
// TODO: add more perhaps
|
|
|
|
};
|
|
|
|
|
|
|
|
void SetRenderState(int32 state, uint32 value);
|
2018-07-02 07:01:34 +02:00
|
|
|
void SetRenderStatePtr(int32 state, void *value);
|
2017-08-29 10:12:56 +02:00
|
|
|
uint32 GetRenderState(int32 state);
|
2018-07-02 07:01:34 +02:00
|
|
|
void *GetRenderStatePtr(int32 state);
|
2017-08-29 10:12:56 +02:00
|
|
|
|
|
|
|
// Im2D
|
|
|
|
|
|
|
|
namespace im2d {
|
|
|
|
|
|
|
|
float32 GetNearZ(void);
|
|
|
|
float32 GetFarZ(void);
|
2018-12-17 21:23:41 +01:00
|
|
|
void RenderLine(void *verts, int32 numVerts, int32 vert1, int32 vert2);
|
|
|
|
void RenderTriangle(void *verts, int32 numVerts, int32 vert1, int32 vert2, int32 vert3);
|
2017-08-29 10:12:56 +02:00
|
|
|
void RenderIndexedPrimitive(PrimitiveType, void *verts, int32 numVerts, void *indices, int32 numIndices);
|
2018-12-17 21:23:41 +01:00
|
|
|
void RenderPrimitive(PrimitiveType type, void *verts, int32 numVerts);
|
2017-08-29 10:12:56 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// Im3D
|
|
|
|
|
|
|
|
namespace im3d {
|
|
|
|
|
2020-05-06 09:22:29 +02:00
|
|
|
enum TransformFlags
|
|
|
|
{
|
|
|
|
VERTEXUV = 1, // has tex Coords
|
|
|
|
ALLOPAQUE = 2, // no vertex alpha
|
|
|
|
NOCLIP = 4, // don't frustum clip
|
|
|
|
VERTEXXYZ = 8, // has position
|
|
|
|
VERTEXRGBA = 16, // has color
|
|
|
|
EVERYTHING = VERTEXUV|VERTEXXYZ|VERTEXRGBA
|
|
|
|
};
|
|
|
|
|
|
|
|
void Transform(void *vertices, int32 numVertices, Matrix *world, uint32 flags);
|
2020-04-24 19:06:11 +02:00
|
|
|
void RenderPrimitive(PrimitiveType primType);
|
|
|
|
void RenderIndexedPrimitive(PrimitiveType primType, void *indices, int32 numIndices);
|
2017-08-29 10:12:56 +02:00
|
|
|
void End(void);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2017-08-29 14:05:45 +02:00
|
|
|
}
|
|
|
|
|