Add basic framebuffer support (probably not working right yet?)
Possibly (probably) calculating wrong pixel values, addresses.
This commit is contained in:
27
include/framebuffer.h
Normal file
27
include/framebuffer.h
Normal file
@ -0,0 +1,27 @@
|
||||
#ifndef FRAMEBUFFER_H
|
||||
#define FRAMEBUFFER_H
|
||||
|
||||
// 1, 2, and 4 bit color are currently unsupported
|
||||
//#define FB_COLOR_DEPTH_1 1
|
||||
//#define FB_COLOR_DEPTH_2 2
|
||||
//#define FB_COLOR_DEPTH_4 4
|
||||
#define FB_COLOR_DEPTH_8 8
|
||||
#define FB_COLOR_DEPTH_16 16
|
||||
#define FB_COLOR_DEPTH_24 24
|
||||
|
||||
struct fbdev {
|
||||
unsigned int pixelwidth, pixelheight;
|
||||
unsigned int color_depth;
|
||||
void *fbaddr; //start address of the frame buffer in memory
|
||||
void *device_ptr; //passed into device
|
||||
};
|
||||
|
||||
struct fb {
|
||||
unsigned int width, height;
|
||||
unsigned int color_depth;
|
||||
struct fbdev *device;
|
||||
};
|
||||
|
||||
int fb_write_pixel(struct fb *f, unsigned int x, unsigned int y, unsigned int r, unsigned int g, unsigned int b);
|
||||
|
||||
#endif /* FRAMEBUFFER_H */
|
Reference in New Issue
Block a user