Revision 332
worked out things
graph.h | ||
---|---|---|
40 | 40 |
#define SET_BLU(n) (((n)&0xFF) ) |
41 | 41 |
#define SET_RGB(r,g,b) (SET_RED(r) | SET_GRE(g) | SET_BLU(b)) |
42 | 42 |
|
43 |
// PUBLIC GET |
|
43 |
/** |
|
44 |
* @brief Initialize graphics. |
|
45 |
* @param mode Graphics mode to use |
|
46 |
* @return SUCCESS if operation was successful, other value otherwise |
|
47 |
*/ |
|
48 |
int (graph_init)(uint16_t mode); |
|
49 |
|
|
50 |
/** |
|
51 |
* @brief Cleanup graphics. |
|
52 |
* @return SUCCESS if operation was successful, other value otherwise |
|
53 |
*/ |
|
54 |
int (graph_cleanup)(void); |
|
55 |
|
|
56 |
/** |
|
57 |
* @brief Get screen X-resolution. |
|
58 |
* @return Screen X-resolution |
|
59 |
*/ |
|
44 | 60 |
uint16_t (graph_get_XRes) (void); |
61 |
/** |
|
62 |
* @brief Get screen Y-resolution. |
|
63 |
* @return Screen Y-resolution |
|
64 |
*/ |
|
45 | 65 |
uint16_t (graph_get_YRes) (void); |
66 |
/** |
|
67 |
* @brief Get number of bytes per pixel. |
|
68 |
* |
|
69 |
* That is, the number of bytes needed to encode the color of a pixel. |
|
70 |
* @return Number of bytes per pixel |
|
71 |
*/ |
|
46 | 72 |
uint16_t (graph_get_bytes_pixel) (void); |
47 | 73 |
|
48 |
// INIT |
|
49 |
int (graph_init)(uint16_t mode); |
|
50 |
|
|
51 |
// CLEANUP |
|
52 |
int (graph_cleanup)(void); |
|
53 |
|
|
54 |
// PIXEL DRAWING |
|
55 |
int (graph_set_pixel) (uint16_t x, uint16_t y, uint32_t color); |
|
74 |
/** |
|
75 |
* @brief Draw pixel with color. |
|
76 |
* @param x X-position of pixel to draw |
|
77 |
* @param y Y-position of pixel to draw |
|
78 |
* @param color Color that will be used to draw the pixel |
|
79 |
* @return SUCCESS if operation was successful, other value otherwise |
|
80 |
*/ |
|
81 |
void (graph_set_pixel) (uint16_t x, uint16_t y, uint32_t color); |
|
82 |
/** |
|
83 |
* @brief Draw pixel with color using position. |
|
84 |
* |
|
85 |
* Position is calculated from y*WIDTH+x. |
|
86 |
* @param pos Position |
|
87 |
* @param color Color that will be used to draw the pixel |
|
88 |
*/ |
|
56 | 89 |
void (graph_set_pixel_pos) (unsigned pos , uint32_t color); |
57 | 90 |
|
58 | 91 |
// SCREEN |
Also available in: Unified diff