23 lines
565 B
C
23 lines
565 B
C
#pragma once
|
|
#include <stdint.h>
|
|
#include <stddef.h>
|
|
#include <multiboot.h>
|
|
|
|
typedef struct {
|
|
uint32_t width;
|
|
uint32_t height;
|
|
uint32_t bpp;
|
|
uint32_t pitch;
|
|
void *addr;
|
|
void *buffer;
|
|
size_t size;
|
|
} gfx_context;
|
|
|
|
extern gfx_context kernel_fb;
|
|
|
|
#define RGB(r, g, b) (((uint32_t) (r<<16) + (g<<8) + (b)))
|
|
|
|
void putpixel(gfx_context *ctx, uint64_t x, uint64_t y, uint32_t clr);
|
|
gfx_context *framebuffer_make_subcontext(gfx_context *ctx, uint64_t x, uint64_t y, uint64_t width, uint64_t height);
|
|
|
|
void framebuffer_init(struct fbinfo *fbinfo); |