mirror of
https://github.com/JannisHeydemann/BoredOS.git
synced 2026-05-30 02:16:58 +00:00
BrewOS 1.31 > BrewOS 1.40 Brewkernel 2.3.0 Alpha > Brewkernel 2.3.1 Beta This update is a feature focused update. It features loads of quality of life and major UX improvements. New features: -Drag and drop for files and applications (shortcuts for apps can be made by dragging an app from the start menu into the desktop) -Customizable desktop (auto align, snap to grid -Recycle bin (rm in the CMD skips this)
42 lines
1.1 KiB
C
42 lines
1.1 KiB
C
#ifndef GRAPHICS_H
|
|
#define GRAPHICS_H
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
#include "limine.h"
|
|
|
|
// Dirty rectangle structure
|
|
typedef struct {
|
|
int x, y, w, h;
|
|
bool active;
|
|
} DirtyRect;
|
|
|
|
void graphics_init(struct limine_framebuffer *fb);
|
|
void put_pixel(int x, int y, uint32_t color);
|
|
void draw_rect(int x, int y, int w, int h, uint32_t color);
|
|
void draw_char(int x, int y, char c, uint32_t color);
|
|
void draw_string(int x, int y, const char *s, uint32_t color);
|
|
void draw_desktop_background(void);
|
|
void graphics_set_bg_color(uint32_t color);
|
|
void graphics_set_bg_pattern(const uint32_t *pattern); // 128x128 pattern
|
|
|
|
// Get screen dimensions
|
|
int get_screen_width(void);
|
|
int get_screen_height(void);
|
|
|
|
// Dirty rectangle management
|
|
void graphics_mark_dirty(int x, int y, int w, int h);
|
|
void graphics_mark_screen_dirty(void);
|
|
DirtyRect graphics_get_dirty_rect(void);
|
|
void graphics_clear_dirty(void);
|
|
|
|
// Double buffering
|
|
void graphics_flip_buffer(void);
|
|
void graphics_clear_back_buffer(uint32_t color);
|
|
|
|
// Clipping
|
|
void graphics_set_clipping(int x, int y, int w, int h);
|
|
void graphics_clear_clipping(void);
|
|
|
|
#endif
|