-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmouse.hpp
35 lines (26 loc) · 894 Bytes
/
mouse.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef INCLUDED_MOUSE_HPP
#define INCLUDED_MOUSE_HPP
#include "graphics.hpp"
#include "hid_app.hpp"
struct VGAMouse : public MouseReceiver {
VGAGraphics *graphics;
volatile int mouse_x = 0, mouse_y = 0;
int mouse_x_old = 0, mouse_y_old = 0;
bool mouse_visible = false;
bool mouse_moved = false;
uint8_t mask[256], color[256], save[256];
VGAMouse(VGAGraphics *g);
void save_background(int x, int y, uint8_t *p);
void save_background(int x, int y);
void restore_background(int x, int y, uint8_t *p);
void restore_background(int x, int y);
void draw_pointer(int x, int y, uint8_t *mask, uint8_t *color);
void draw_pointer(int x, int y);
void move_mouse(int x, int y);
void hide_mouse();
void draw_mouse();
virtual void report_mouse_moved(int x, int y) {
move_mouse(x, y);
}
};
#endif