Start utilities for drawing
This commit is contained in:
parent
8f684d091f
commit
ae55d0fbca
3 changed files with 128 additions and 1 deletions
37
mw_utility.h
Normal file
37
mw_utility.h
Normal file
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* (c) 2011 Siegen, Germany by Nils Faerber <nils.faerber@kernelconcepts.de>
|
||||
*
|
||||
* license LGPL
|
||||
*/
|
||||
|
||||
#ifndef _MW_UTILITY_H
|
||||
#define _MW_UTILITY_H
|
||||
|
||||
typedef struct {
|
||||
unsigned int res_x;
|
||||
unsigned int res_y;
|
||||
unsigned char bpp;
|
||||
void *pbuf;
|
||||
} mw_buffer;
|
||||
|
||||
typedef enum {
|
||||
MW_BLACK = 0,
|
||||
MW_WHITE,
|
||||
} mw_color;
|
||||
|
||||
mw_buffer *mw_alloc_pbuffer(unsigned int res_x, unsigned int res_y, unsigned int bpp);
|
||||
|
||||
void mw_free_pbuffer(mw_buffer *mwbuf);
|
||||
|
||||
void mw_dump_mw_buffer(mw_buffer *mwbuf);
|
||||
|
||||
|
||||
/* clear/fill entire buffer with color */
|
||||
void mw_buf_clear(mw_buffer *mwbuf, mw_color clr);
|
||||
|
||||
/* draw a single pixel */
|
||||
void mw_buf_draw_pixel(mw_buffer *mwbuf, unsigned int x, unsigned int y, mw_color clr);
|
||||
|
||||
|
||||
#endif
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue