diff options
Diffstat (limited to 'include/swgfx.h')
| -rw-r--r-- | include/swgfx.h | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/include/swgfx.h b/include/swgfx.h index 94eb359..005359b 100644 --- a/include/swgfx.h +++ b/include/swgfx.h | |||
| @@ -39,13 +39,13 @@ typedef struct sgPixel { uint8_t r, g, b, a; } sgPixel; | |||
| 39 | 39 | ||
| 40 | typedef struct swgfx swgfx; | 40 | typedef struct swgfx swgfx; |
| 41 | 41 | ||
| 42 | swgfx* sgNew(); | 42 | size_t sgMem(int width, int height); // Get memory requirements. |
| 43 | swgfx* sgNew(int width, int height, void* mem); | ||
| 43 | void sgDel(swgfx**); | 44 | void sgDel(swgfx**); |
| 44 | 45 | ||
| 45 | // TODO: Write client app first, then implement the functions below in the C file. | 46 | // TODO: Write client app first, then implement the functions below in the C file. |
| 46 | 47 | ||
| 47 | void sgColourBuffer(swgfx*, sgVec2i dimensions, sgPixel* buffer); | 48 | void sgPresent(swgfx*, sgVec2i dimensions, sgPixel* screen); |
| 48 | void sgPresent (swgfx*, sgVec2i dimensions, sgPixel* screen); | ||
| 49 | 49 | ||
| 50 | void sgModelId (swgfx*); | 50 | void sgModelId (swgfx*); |
| 51 | void sgModel (swgfx*, sgVec3 position, sgVec3 right, sgVec3 up, sgVec3 forward); | 51 | void sgModel (swgfx*, sgVec3 position, sgVec3 right, sgVec3 up, sgVec3 forward); |
| @@ -66,11 +66,3 @@ void sgTrianglesIndexed(swgfx*, size_t numIndices, const sgIdx* indices, const s | |||
| 66 | void sgTrianglesIndexedNonUniform(swgfx*, size_t numTris, const sgTriIdx* tris, const sgVec3* positions); | 66 | void sgTrianglesIndexedNonUniform(swgfx*, size_t numTris, const sgTriIdx* tris, const sgVec3* positions); |
| 67 | 67 | ||
| 68 | void sgCheck(swgfx*); | 68 | void sgCheck(swgfx*); |
| 69 | |||
| 70 | // Memory | ||
| 71 | #define SG_ALIGN 64 | ||
| 72 | #define SG_ALIGN_PTR(P) ((uintptr_t)(P) & (~(SG_ALIGN-1))) | ||
| 73 | #define SG_ALIGN_ALLOC(COUNT, TYPE) (TYPE*)sgAlloc(1, COUNT * sizeof(TYPE)) | ||
| 74 | #define SG_FREE(PP) sgFree((void**)PP) | ||
| 75 | void* sgAlloc(size_t count, size_t size); | ||
| 76 | void sgFree(void**); | ||
