Skip to content

Commit 99f07b3

Browse files
re-add cheatsheet_app.h since the event handlers are currently only documented here
1 parent fab2821 commit 99f07b3

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

doc/QuickStart.md

+2
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ Handlers are optional. If you don't care about an event, you can just omit the a
6868
- `oc_on_init()` is called once when your application starts and can be use to initialize your application's resources.
6969
- `oc_on_frame_refresh()` is called when your application needs to render a new frame, typically tied to the refresh rate of the monitor.
7070
71+
For a list of available handlers and their signatures, see the [app cheatsheet](../doc/cheatsheets/cheatsheet_app.h).
72+
7173
7274
## Clock example
7375

doc/cheatsheets/cheatsheet_app.h

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/************************************************************/ /**
2+
*
3+
* @file: cheatsheet_app.h
4+
* @author: Martin Fouilleul
5+
* @date: 05/09/2023
6+
*
7+
*****************************************************************/
8+
9+
//----------------------------------------------------------------
10+
// Handlers (can be defined by your app to respond to events)
11+
//----------------------------------------------------------------
12+
void oc_on_init(void);
13+
void oc_on_mouse_down(oc_mouse_button button);
14+
void oc_on_mouse_up(oc_mouse_button button);
15+
void oc_on_mouse_enter(void);
16+
void oc_on_mouse_leave(void);
17+
void oc_on_mouse_move(f32 x, f32 y, f32 deltaX, f32 deltaY);
18+
void oc_on_mouse_wheel(f32 deltaX, f32 deltaY);
19+
void oc_on_key_down(oc_scan_code scan, oc_key_code key);
20+
void oc_on_key_up(oc_scan_code scan, oc_key_code key);
21+
void oc_on_frame_refresh(void);
22+
void oc_on_resize(u32 width, u32 height);
23+
void oc_on_raw_event(oc_event* event);
24+
void oc_on_terminate(void);
25+
26+
//----------------------------------------------------------------
27+
// Window
28+
//----------------------------------------------------------------
29+
void oc_window_set_title(oc_str8 title);
30+
void oc_window_set_size(oc_vec2 size);
31+
32+
//----------------------------------------------------------------
33+
// Quitting
34+
//----------------------------------------------------------------
35+
void oc_request_quit(void)

doc/mkdocs/docs/QuickStart.md

+2
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ Handlers are optional. If you don't care about an event, you can just omit the a
6868
- `oc_on_init()` is called once when your application starts and can be use to initialize your application's resources.
6969
- `oc_on_frame_refresh()` is called when your application needs to render a new frame, typically tied to the refresh rate of the monitor.
7070
71+
For a list of available handlers and their signatures, see the [app cheatsheet](../doc/cheatsheets/cheatsheet_app.h).
72+
7173
7274
## Clock example
7375

0 commit comments

Comments
 (0)