commit 210774a
uint
·
2026-08-03 20:33:07 +0000 UTC
parent 58abd0b
basic-window: add scroll tests
1 files changed,
+12,
-1
+12,
-1
1@@ -14,6 +14,7 @@ int current_char = 0;
2 bool resize = false;
3 int rszw;
4 int rszh;
5+MausColor white = {255, 255, 255, 255};
6
7 void handle_ev(Maus* mw, MausEvent* ev)
8 {
9@@ -59,6 +60,16 @@ void handle_ev(Maus* mw, MausEvent* ev)
10 break;
11 }
12 case MAUS_EV_MOUSE_BUTTON: {
13+ if (ev->mouse.button.button == MAUS_MOUSE_BUTTON_SCROLL_UP) {
14+ white.r += 5;
15+ white.g += 5;
16+ white.b += 5;
17+ }
18+ else if (ev->mouse.button.button == MAUS_MOUSE_BUTTON_SCROLL_DOWN) {
19+ white.r -= 5;
20+ white.g -= 5;
21+ white.b -= 5;
22+ }
23 mb1_pressed =
24 mw->mouse_buttons[MAUS_MOUSE_BUTTON_LEFT] ?
25 true : false;
26@@ -104,7 +115,7 @@ int main(void)
27 resize = false;
28 }
29
30- maus_clear(mw, MAUS_COL_RGBA(255, 255, 255, 255));
31+ maus_clear(mw, white);
32
33 uint32_t red_unpacked = MAUS_UNPACK_COL(red);
34 if (mx >= 0 && my >= 0 &&