commit e2d28a1

uint  ·  2026-06-13 13:54:10 +0000 UTC
parent 1856687
Rename maus_fb_clear->maus_clear
3 files changed,  +8, -10
M maus.h
M maus.h
+6, -8
 1@@ -115,6 +115,8 @@ typedef struct {
 2 	bool           mouse_buttons[MAUS_MOUSE_BUTTON_LAST];
 3 } Maus;
 4 
 5+/* clear screen with color: `col` */
 6+void maus_clear(Maus* mw, MausColor col);
 7 
 8 /* set text to system clipboard */
 9 void maus_clipboard_set_text(Maus* mw, const char* text);
10@@ -134,9 +136,6 @@ bool maus_create_window(Maus* mw);
11 /* log message to output `fd` and die */
12 void maus_die(const char* fmt, ...);
13 
14-/* paint framebuffer with color: `col` */
15-void maus_fb_clear(Maus* mw, MausColor col);
16-
17 /* get time since arbitrary start point (ns) */
18 uint64_t maus_get_time_ns(void);
19 
20@@ -151,16 +150,15 @@ void maus_log(FILE* fd, const char* fmt, ...);
21    note: can burn cpu cycles */
22 bool maus_event_poll(Maus* mw, MausEvent* ev);
23 
24-/* poll for events then fill `ev` with retrieved events.
25-   returns true if event polled, else false
26-   note: thread goes to sleep until an event arrives */
27+/* poll for events then fill `ev` with retrieved events. returns true if event
28+   polled, else false. note, thread goes to sleep until an event arrives */
29 void maus_event_wait(Maus* mw, MausEvent* ev);
30 
31 /* present the pixelbuffer to the screen */
32 void maus_present(Maus* mw);
33 
34-/* resize window to specified width and height. returns true
35-   on resize success, else false */
36+/* resize window to specified width and height. returns true on resize success,
37+   else false */
38 bool maus_resize(Maus* mw, uint32_t width, uint32_t height);
39 
40 /* cap framerate to targetted fps */
+1, -1
1@@ -502,7 +502,7 @@ bool maus_create_window(Maus* mw)
2 	return true;
3 }
4 
5-void maus_fb_clear(Maus* mw, MausColor col)
6+void maus_clear(Maus* mw, MausColor col)
7 {
8 	uint32_t col_up = MAUS_UNPACK_COL(col);
9 	uint32_t pxs = mw->height * mw->width;
+1, -1
1@@ -102,7 +102,7 @@ int main(void)
2 			resize = false;
3 		}
4 
5-		maus_fb_clear(mw, MAUS_COL_RGBA(255, 255, 255, 255));
6+		maus_clear(mw, MAUS_COL_RGBA(255, 255, 255, 255));
7 
8 		uint32_t red_unpacked = MAUS_UNPACK_COL(red);
9 		if (mx >= 0 && my >= 0 &&