diff options
| author | Franklin Wei <frankhwei536@gmail.com> | 2015-03-01 14:20:47 -0500 |
|---|---|---|
| committer | Franklin Wei <frankhwei536@gmail.com> | 2015-03-01 14:20:47 -0500 |
| commit | c7252588ebb95f97631e9470778c69afa00c35b5 (patch) | |
| tree | 06d760878e18f6cddbe4305cddd4d5dfa74529f8 /drivers/include/gfx.h | |
| parent | b8f54e63d2b8f8007c580adf2a6034c98a0f2eaa (diff) | |
| download | kappa-c7252588ebb95f97631e9470778c69afa00c35b5.zip kappa-c7252588ebb95f97631e9470778c69afa00c35b5.tar.gz kappa-c7252588ebb95f97631e9470778c69afa00c35b5.tar.bz2 kappa-c7252588ebb95f97631e9470778c69afa00c35b5.tar.xz | |
Huge restructure
Diffstat (limited to 'drivers/include/gfx.h')
| -rw-r--r-- | drivers/include/gfx.h | 105 |
1 files changed, 0 insertions, 105 deletions
diff --git a/drivers/include/gfx.h b/drivers/include/gfx.h deleted file mode 100644 index 5e97100..0000000 --- a/drivers/include/gfx.h +++ /dev/null @@ -1,105 +0,0 @@ -#ifndef _GFX_H_ -#define _GFX_H_ - -#include <stdbool.h> -#include <stdint.h> - -enum vga_color_t { - VGA_BLACK = 0, - VGA_BLUE = 1, - VGA_GREEN = 2, - VGA_CYAN = 3, - VGA_RED = 4, - VGA_MAGENTA = 5, - VGA_BROWN = 6, - VGA_LIGHT_GRAY = 7, - VGA_DARK_GRAY = 8, - VGA_LIGHT_BLUE = 9, - VGA_LIGHT_GREEN = 10, - VGA_LIGHT_CYAN = 11, - VGA_LIGHT_RED = 12, - VGA_LIGHT_MAGENTA = 13, - VGA_LIGHT_BROWN = 14, - VGA_WHITE = 15 -}; - -#define VGA_WIDTH 80 -#define VGA_HEIGHT 25 - -#define VGA_MAKE_COLOR(fg, bg) (fg | bg << 4) -#define VGA_MAKE_ENTRY(ch, col) (((uint16_t)ch)|((uint16_t)col<<8)) -#define VGA_RGBPACK(r, g, b) ((r << 16)|(g << 8)|(b << 0)) - -#define GFX_WHITE 0xFFFFFF -#define GFX_BLACK 0x000000 - -struct vbe_info_t; - -bool gfx_init(struct vbe_info_t *vbe_mode_info); - -extern void (*gfx_drawpixel)(int x, int y); - -/* transparent background */ -void gfx_drawchar(int x, int y, int ch); - -/* fills the background with bgcolor */ -void gfx_drawchar_bg(int x, int y, int ch); - -void gfx_putchar(int ch); - -void gfx_puts(const char* str); - -/* this function can be different from resolution to resolution */ -extern void (*gfx_clear)(void); - -void gfx_reset(void); - -void gfx_set_foreground(uint32_t); - -uint32_t gfx_get_foreground(void); - -void gfx_set_background(uint32_t); - -uint32_t gfx_get_background(void); - -void (*gfx_hline)(int x1, int x2, int y); - -void (*gfx_vline)(int y1, int y2, int x); - -void gfx_fillrect(int x1, int y1, int w, int h); - -void gfx_drawline(int x1, int y1, int x2, int y2); - -/* these circle algorithms are very fast */ -void gfx_drawcircle(int cx, int cy, int rad); - -void gfx_fillcircle(int cx, int cy, int rad); - -void gfx_filltriangle(int x1, int y1, int x2, int y2, int x3, int y3); - -extern const uint16_t *gfx_width, *gfx_height; - -/* this is _BYTES_ per pixel, NOT BITS per pixel! */ -extern const uint8_t *gfx_bpp; - -struct bitmap_t { - unsigned int w, h; - unsigned int bpp; - uint8_t *data; -}; - -void gfx_bitmap(int x, int y, const struct bitmap_t*); - -void gfx_drawrect(int x, int y, int w, int h); - -void gfx_set_doublebuffer(bool); - -bool gfx_get_doublebuffer(void); - -/* don't call this wo/ double buffering! */ -void gfx_update(void); - -void gfx_putsxy(int, int, const char*); - -void gfx_putsxy_bg(int, int, const char*); -#endif |