#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 BM_Font { const Bitmap* bmp; int char_w, char_h; int chars_across; } BM_Font; void init_font( BM_Font* font, const Bitmap* bmp, int char_w, int char_h, int chars_across ); void rfont_char(const BM_Font* font, int x, int y, char c); void rfont_char_col( const BM_Font* font, int x, int y, char c, Colour colour ); void rfont_text( const BM_Font* font, int x, int y, const char* text ); void rfont_text_col( const BM_Font* font, 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 ); void blit( Bitmap* dst, const Bitmap* src, int x, int y, const Rectangle* rect ); void blit_col( Bitmap* dst, const Bitmap* src, int x, int y, const Rectangle* rect, Colour colour ); #endif