You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: vlib/gg/gg.c.v
+34-34
Original file line number
Diff line number
Diff line change
@@ -49,63 +49,63 @@ pub mut:
49
49
50
50
pubstructConfig {
51
51
pub:
52
-
width int
53
-
height int
54
-
retina bool
55
-
resizable bool
56
-
user_data voidptr
57
-
font_size int
58
-
create_window bool
52
+
width int// desired start width of the window
53
+
height int// desired start height of the window
54
+
retina bool// TODO: implement or deprecate
55
+
resizable bool// TODO: implement or deprecate
56
+
user_data voidptr// a custom pointer to the application data/instance
57
+
font_size int// TODO: implement or deprecate
58
+
create_window bool// TODO: implement or deprecate
59
59
// window_user_ptr voidptr
60
-
window_title string
60
+
window_title string// the desired title of the window
61
61
html5_canvas_name string='canvas'
62
-
borderless_window bool
63
-
always_on_top bool
64
-
bg_color gx.Color
65
-
init_fn FNCb=unsafe { nil }
66
-
frame_fn FNCb=unsafe { nil }
62
+
borderless_window bool// TODO: implement or deprecate
63
+
always_on_top bool// TODO: implement or deprecate
64
+
bg_color gx.Color// The background color of the window. By default, the first thing gg does in ctx.begin(), is clear the whole buffer with that color.
65
+
init_fn FNCb=unsafe { nil }// Called once, after Sokol has finished its setup. Some gg and Sokol functions have to be called *in this* callback, or after this callback, but not before
66
+
frame_fn FNCb=unsafe { nil }// Called once per frame, usually 60 times a second (depends on swap_interval). See also https://dri.freedesktop.org/wiki/ConfigurationOptions/#synchronizationwithverticalrefreshswapintervals
67
67
native_frame_fn FNCb=unsafe { nil }
68
-
cleanup_fn FNCb=unsafe { nil }
69
-
fail_fn FNFail=unsafe { nil }
68
+
cleanup_fn FNCb=unsafe { nil }// Called once, after Sokol determines that the application is finished/closed. Put your app specific cleanup/free actions here.
69
+
fail_fn FNFail=unsafe { nil }// Called once per Sokol error/log message. TODO: currently it does nothing with latest Sokol, reimplement using Sokol's new sapp_logger APIs.
70
70
//
71
-
event_fn FNEvent=unsafe { nil }
72
-
on_event FNEvent2=unsafe { nil }
73
-
quit_fn FNEvent=unsafe { nil }
71
+
event_fn FNEvent=unsafe { nil }// Called once per each user initiated event, received by Sokol/GG.
72
+
on_event FNEvent2=unsafe { nil }// Called once per each user initiated event, received by Sokol/GG. Same as event_fn, just the parameter order is different. TODO: deprecate this, in favor of event_fn
73
+
quit_fn FNEvent=unsafe { nil }// Called when the user closes the app window.
74
74
//
75
-
keydown_fn FNKeyDown=unsafe { nil }
76
-
keyup_fn FNKeyUp=unsafe { nil }
77
-
char_fn FNChar=unsafe { nil }
75
+
keydown_fn FNKeyDown=unsafe { nil }// Called once per key press, no matter how long the key is held down. Note that here you can access the scan code/physical key, but not the logical character.
76
+
keyup_fn FNKeyUp=unsafe { nil }// Called once per key press, when the key is released.
77
+
char_fn FNChar=unsafe { nil }// Called once per character (after the key is pressed down, and then released). Note that you can access the character/utf8 rune here, not just the scan code.
78
78
//
79
-
move_fn FNMove=unsafe { nil }
80
-
click_fn FNClick=unsafe { nil }
81
-
unclick_fn FNUnClick=unsafe { nil }
82
-
leave_fn FNEvent=unsafe { nil }
83
-
enter_fn FNEvent=unsafe { nil }
84
-
resized_fn FNEvent=unsafe { nil }
85
-
scroll_fn FNEvent=unsafe { nil }
79
+
move_fn FNMove=unsafe { nil }// Called while the mouse/touch point is moving.
80
+
click_fn FNClick=unsafe { nil }// Called once when the mouse/touch button is clicked.
81
+
unclick_fn FNUnClick=unsafe { nil }// Called once when the mouse/touch button is released.
82
+
leave_fn FNEvent=unsafe { nil }// Called once when the mouse/touch point leaves the window.
83
+
enter_fn FNEvent=unsafe { nil }// Called once when the mouse/touch point enters again the window.
84
+
resized_fn FNEvent=unsafe { nil }// Called once when the window has changed its size.
85
+
scroll_fn FNEvent=unsafe { nil }// Called while the user is scrolling. The direction of scrolling is indicated by either 1 or -1.
86
86
// wait_events bool // set this to true for UIs, to save power
87
-
fullscreen bool
87
+
fullscreen bool// set this to true, if you want your window to start in fullscreen mode (suitable for games/demos/screensavers)
88
88
scale f32=1.0
89
-
sample_count int
89
+
sample_count int// bigger values usually have performance impact, but can produce smoother/antialiased lines, if you draw lines or polygons (2 is usually good enough)
90
90
swap_interval int=1// 1 = 60fps, 2 = 30fps etc. The preferred swap interval (ignored on some platforms)
91
91
// ved needs this
92
92
// init_text bool
93
93
font_path string
94
94
custom_bold_font_path string
95
-
ui_mode bool// refreshes only on events to save CPU usage
95
+
ui_mode bool// refreshes only on events to save CPU usage
96
96
// font bytes for embedding
97
97
font_bytes_normal []u8
98
98
font_bytes_bold []u8
99
99
font_bytes_mono []u8
100
100
font_bytes_italic []u8
101
-
native_rendering bool// Cocoa on macOS/iOS, GDI+ on Windows
101
+
native_rendering bool// Cocoa on macOS/iOS, GDI+ on Windows
102
102
// drag&drop
103
103
enable_dragndrop bool// enable file dropping (drag'n'drop), default is false
104
104
max_dropped_files int=1// max number of dropped files to process (default: 1)
105
105
max_dropped_file_path_length int=2048// max length in bytes of a dropped UTF-8 file path (default: 2048)
106
106
//
107
-
min_width int
108
-
min_height int
107
+
min_width int// desired minimum width of the window
108
+
min_height int// desired minimum height of the window
0 commit comments