diff options
Diffstat (limited to 'include/swgfx.h')
| -rw-r--r-- | include/swgfx.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/include/swgfx.h b/include/swgfx.h index 005359b..970e3fa 100644 --- a/include/swgfx.h +++ b/include/swgfx.h | |||
| @@ -25,14 +25,18 @@ typedef struct sgVec4 { R x, y, z, w; } sgVec4; | |||
| 25 | 25 | ||
| 26 | typedef sgVec3 sgNormal; | 26 | typedef sgVec3 sgNormal; |
| 27 | 27 | ||
| 28 | typedef struct sgQuadi { sgVec2i p0, p1; } sgQuadi; | 28 | typedef struct sgVert2i { sgVec2i pos; sgVec2 uv; } sgVert2i; |
| 29 | typedef struct sgQuad { sgVec2 p0, p1; } sgQuad; | 29 | typedef struct sgVert2 { sgVec2 pos; sgVec2 uv; } sgVert2; |
| 30 | typedef struct sgTri2 { sgVec2 p0, p1, p2; } sgTri2; | 30 | typedef struct sgVert3 { sgVec3 pos; sgVec2 uv; } sgVert3; |
| 31 | typedef struct sgTri3 { sgVec3 p0, p1, p2; } sgTri3; | 31 | |
| 32 | typedef struct sgQuadi { sgVert2i p0, p1; } sgQuadi; | ||
| 33 | typedef struct sgQuad { sgVert2 p0, p1; } sgQuad; | ||
| 34 | typedef struct sgTri2 { sgVert2 p0, p1, p2; } sgTri2; | ||
| 35 | typedef struct sgTri3 { sgVert3 p0, p1, p2; } sgTri3; | ||
| 32 | 36 | ||
| 33 | typedef uint16_t sgIdx; | 37 | typedef uint16_t sgIdx; |
| 34 | typedef struct sgVert { sgIdx position, normal, texcoord; } sgVert; | 38 | typedef struct sgVertIdx { sgIdx pos, uv, normal; } sgVertIdx; |
| 35 | typedef struct sgTriIdx { sgVert v0, v1, v2; } sgTriIdx; | 39 | typedef struct sgTriIdx { sgVertIdx v0, v1, v2; } sgTriIdx; |
| 36 | 40 | ||
| 37 | // TODO: Should we use real-valued colours? | 41 | // TODO: Should we use real-valued colours? |
| 38 | typedef struct sgPixel { uint8_t r, g, b, a; } sgPixel; | 42 | typedef struct sgPixel { uint8_t r, g, b, a; } sgPixel; |
| @@ -62,7 +66,7 @@ void sgTriangles2 (swgfx*, size_t count, const sgTri2*); | |||
| 62 | void sgTriangleStrip2(swgfx*, size_t count, const sgVec2*); | 66 | void sgTriangleStrip2(swgfx*, size_t count, const sgVec2*); |
| 63 | void sgTriangles (swgfx*, size_t count, const sgTri3*, const sgNormal*); | 67 | void sgTriangles (swgfx*, size_t count, const sgTri3*, const sgNormal*); |
| 64 | void sgTriangleStrip (swgfx*, size_t count, const sgVec3*, const sgNormal*); | 68 | void sgTriangleStrip (swgfx*, size_t count, const sgVec3*, const sgNormal*); |
| 65 | void sgTrianglesIndexed(swgfx*, size_t numIndices, const sgIdx* indices, const sgVec3* positions); | 69 | void sgTrianglesIndexed(swgfx*, size_t numIndices, const sgIdx* indices, const sgVec3* positions, const sgVec2* texcoords); |
| 66 | void sgTrianglesIndexedNonUniform(swgfx*, size_t numTris, const sgTriIdx* tris, const sgVec3* positions); | 70 | void sgTrianglesIndexedNonUniform(swgfx*, size_t numTris, const sgTriIdx* tris, const sgVec3* positions, const sgVec2* texcoords); |
| 67 | 71 | ||
| 68 | void sgCheck(swgfx*); | 72 | void sgCheck(swgfx*); |
