summaryrefslogtreecommitdiff
path: root/src/contrib/SDL-3.2.20/test/relative_mode.markdown
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2025-08-30 16:53:58 -0700
committer3gg <3gg@shellblade.net>2025-08-30 16:53:58 -0700
commit6aaedb813fa11ba0679c3051bc2eb28646b9506c (patch)
tree34acbfc9840e02cb4753e6306ea7ce978bf8b58e /src/contrib/SDL-3.2.20/test/relative_mode.markdown
parent8f228ade99dd3d4c8da9b78ade1815c9adf85c8f (diff)
Update to SDL3
Diffstat (limited to 'src/contrib/SDL-3.2.20/test/relative_mode.markdown')
-rw-r--r--src/contrib/SDL-3.2.20/test/relative_mode.markdown58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/contrib/SDL-3.2.20/test/relative_mode.markdown b/src/contrib/SDL-3.2.20/test/relative_mode.markdown
new file mode 100644
index 0000000..0a43b6b
--- /dev/null
+++ b/src/contrib/SDL-3.2.20/test/relative_mode.markdown
@@ -0,0 +1,58 @@
1Relative mode testing
2=====================
3
4See test program at the bottom of this file.
5
6Initial tests:
7
8 - When in relative mode, the mouse shouldn't be moveable outside of the window.
9 - When the cursor is outside the window when relative mode is enabled, mouse
10 clicks should not go to whatever app was under the cursor previously.
11 - When alt/cmd-tabbing between a relative mode app and another app, clicks when
12 in the relative mode app should also not go to whatever app was under the
13 cursor previously.
14
15
16Code
17====
18
19 #include <SDL.h>
20
21 int PollEvents()
22 {
23 SDL_Event event;
24 while (SDL_PollEvent(&event))
25 {
26 switch (event.type)
27 {
28 case SDL_EVENT_QUIT:
29 return 1;
30 default:
31 break;
32 }
33 }
34
35 return 0;
36 }
37
38 int main(int argc, char *argv[])
39 {
40 SDL_Window *win;
41
42 SDL_Init(SDL_INIT_VIDEO);
43
44 win = SDL_CreateWindow("Test", 800, 600, 0);
45 SDL_SetWindowRelativeMouseMode(win, true);
46
47 while (1)
48 {
49 if (PollEvents())
50 break;
51 }
52
53 SDL_DestroyWindow(win);
54
55 SDL_Quit();
56
57 return 0;
58 }