diff options
Diffstat (limited to 'render.h')
| -rw-r--r-- | render.h | 79 | 
1 files changed, 79 insertions, 0 deletions
diff --git a/render.h b/render.h new file mode 100644 index 0000000..d63297e --- /dev/null +++ b/render.h @@ -0,0 +1,79 @@ +#ifndef render_h +#define render_h + +#include "config.h" +#include "rect.h" + +typedef struct { +	unsigned char r, g, b, a; +} Colour; + +Colour make_colour(unsigned rgb, unsigned char a); +Colour make_black(); +Colour make_white(); + +typedef struct { +	Colour* pixels; +	int w, h; +} Bitmap; + +void init_bitmap( +	Bitmap* bitmap, +	Colour* pixels, +	int w, +	int h +); + +typedef struct { +	Bitmap* bmp; +	int char_w, char_h; +	int chars_across; +} BM_Font; + +void init_font( +	BM_Font* font, +	Bitmap* bmp, +	int char_w, +	int char_h, +	int chars_across +); + +void rfont_char(int x, int y, char c); +void rfont_char_col(int x, int y, char c, Colour colour); +void rfont_text( +	int x, +	int y, +	const char* text +); +void rfont_text_col( +	int x, +	int y, +	const char* text, +	Colour colour +); + +void init_renderer(); + +void renderer_begin_frame(); + +Colour* get_render_pixels(); + +extern int sprite_camera_x; +extern int sprite_camera_y; + +void render_bitmap( +	const Bitmap* bitmap, +	int x, +	int y, +	const Rectangle* rect +); + +void render_bitmap_col( +	const Bitmap* bitmap, +	int x, +	int y, +	const Rectangle* rect, +	Colour colour +); + +#endif  |