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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
use crate::platform;
use crate::{Context, Result};
pub fn quit(ctx: &mut Context) {
ctx.running = false;
}
pub fn get_title(ctx: &Context) -> &str {
platform::get_window_title(ctx)
}
pub fn set_title<S>(ctx: &mut Context, title: S)
where
S: AsRef<str>,
{
platform::set_window_title(ctx, title)
}
pub fn get_width(ctx: &Context) -> i32 {
platform::get_window_width(ctx)
}
pub fn set_width(ctx: &mut Context, width: i32) -> Result {
set_size(ctx, width, platform::get_window_height(ctx))
}
pub fn get_height(ctx: &Context) -> i32 {
platform::get_window_height(ctx)
}
pub fn set_height(ctx: &mut Context, height: i32) -> Result {
set_size(ctx, platform::get_window_width(ctx), height)
}
pub fn get_size(ctx: &Context) -> (i32, i32) {
platform::get_window_size(ctx)
}
pub fn set_size(ctx: &mut Context, width: i32, height: i32) -> Result {
platform::set_window_size(ctx, width, height)
}
pub fn set_vsync(ctx: &mut Context, vsync: bool) -> Result {
platform::set_vsync(ctx, vsync)
}
pub fn is_vsync_enabled(ctx: &Context) -> bool {
platform::is_vsync_enabled(ctx)
}
pub fn set_fullscreen(ctx: &mut Context, fullscreen: bool) -> Result {
platform::set_fullscreen(ctx, fullscreen)
}
pub fn is_fullscreen(ctx: &Context) -> bool {
platform::is_fullscreen(ctx)
}
pub fn set_mouse_visible(ctx: &mut Context) -> Result {
platform::set_mouse_visible(ctx, true)
}
pub fn is_mouse_visible(ctx: &Context) -> bool {
platform::is_mouse_visible(ctx)
}