diff options
author | Marvin Borner | 2020-08-23 15:49:22 +0200 |
---|---|---|
committer | Marvin Borner | 2020-08-23 15:49:22 +0200 |
commit | c2cccf6f2ef4f6f8c828074e68be2d95255a89b5 (patch) | |
tree | e04d17c13c872e976ff09a066f42a5eaf9e437ea /libgui/inc | |
parent | b1faf9042c5104d7dafc7d880817def934086ddb (diff) |
Added bmp loading and other stuff
Diffstat (limited to 'libgui/inc')
-rw-r--r-- | libgui/inc/bmp.h | 39 | ||||
-rw-r--r-- | libgui/inc/gui.h | 4 |
2 files changed, 43 insertions, 0 deletions
diff --git a/libgui/inc/bmp.h b/libgui/inc/bmp.h new file mode 100644 index 0000000..909bc92 --- /dev/null +++ b/libgui/inc/bmp.h @@ -0,0 +1,39 @@ +// MIT License, Copyright (c) 2020 Marvin Borner + +#ifndef BMP_H +#define BMP_H + +#include <def.h> + +struct bmp_header { + u8 signature[2]; + u32 size; + u32 reserved; + u32 offset; +} __attribute__((packed)); + +struct bmp_info { + u32 size; + u32 width; + u32 height; + u16 planes; + u16 bpp; + u32 compression; + u32 compressed_size; + u32 x_pixel_meter; + u32 y_pixel_meter; + u32 colors; + u32 important_colors; +}; + +struct bmp { + u32 width; + u32 height; + u8 *data; + u32 bpp; + u32 pitch; +}; + +struct bmp *bmp_load(char *path); + +#endif diff --git a/libgui/inc/gui.h b/libgui/inc/gui.h index 5f35372..467496a 100644 --- a/libgui/inc/gui.h +++ b/libgui/inc/gui.h @@ -21,9 +21,13 @@ struct window { int y; u16 width; u16 height; + struct vbe *vbe; u8 *fb; }; +void gui_draw_rectangle(struct window *win, int x1, int y1, int x2, int y2, const u32 color[3]); +void gui_fill(struct window *win, const u32 color[3]); +void gui_load_wallpaper(struct vbe *vbe, char *path); void gui_init(char *font_path); /** |