summaryrefslogtreecommitdiff
path: root/Gfx.h
blob: 3bcd790801af7b6abc2005ee351b242c7726c8f9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#ifndef GFX_H__
#define GFX_H__

/* *************************************
 *  Includes
 * *************************************/

/* *************************************
 *  Defines
 * *************************************/

/* *************************************
 *  Structs and enums
 * *************************************/

enum tScreenResolution
{
    X_SCREEN_RESOLUTION = 84,
    Y_SCREEN_RESOLUTION = 48
};

enum tColour
{
    GFX_WHITE,
    GFX_BLACK,
    GFX_INVERT,
    GFX_GRAY
};

enum tMirror
{
    GFX_NOFLIP,
    GFX_FLIPH,
    GFX_FLIPV,
    GFX_FLIPHV = (GFX_FLIPH | GFX_FLIPV)
};

enum tRotation
{
    GFX_NOROT,
    GFX_ROTCCW,
    GFX_ROTCW
};

/* *************************************
 *  Global prototypes
 * *************************************/

void    GfxDrawSprite(TYPE_SPRITE* ptrSprite);
void    GfxDrawCircle(uint16_t x, uint16_t y, uint8_t radius, int8_t color);
void    GfxDrawFillCircle(uint16_t x, uint16_t y, uint8_t radius, int8_t color);
void    GfxDrawRectangle(uint8_t x, uint8_t y, uint8_t w, uint8_t h, int8_t color);
void    GfxFillRectangle(uint8_t x, uint8_t y, uint8_t w, uint8_t h, int8_t color);
void    GfxDrawLine(uint8_t x0, uint8_t x1, uint8_t y0, uint8_t y1, uint8_t color);
bool    GfxRefreshNeeded(void);
void    GfxShowKeyboard(char* str, uint8_t length);
uint8_t GfxGetWidthFromSpriteData(const uint8_t* sprData);
uint8_t GfxGetHeightFromSpriteData(const uint8_t* sprData);
bool    GfxIsSpriteInsideScreenArea(TYPE_SPRITE* spr);
void    GfxClearScreen(void);
#ifdef __cplusplus
void    GfxPrintText_Flash(const __FlashStringHelper * str);
#endif /* cplusplus. */
void    GfxPrintText(const char* str, uint8_t x, uint8_t y);
void    GfxPrintTextFont(const char* str, const uint8_t* font, uint8_t x, uint8_t y);
void    GfxInit(void);

#ifdef __cplusplus
}
#endif /* cplusplus. */

#endif /* GFX_H__. */