mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
gg: minor fixes
This commit is contained in:
@@ -9,6 +9,7 @@ import sokol
|
||||
import sokol.sapp
|
||||
import sokol.sgl
|
||||
import sokol.gfx
|
||||
import gg.ft
|
||||
|
||||
type FNvoidptr1 fn(voidptr)
|
||||
type FNvoidptr2 fn(voidptr,voidptr)
|
||||
@@ -26,6 +27,7 @@ pub:
|
||||
create_window bool
|
||||
// window_user_ptr voidptr
|
||||
window_title string
|
||||
borderless_window bool
|
||||
always_on_top bool
|
||||
scale f32 = 1.0
|
||||
bg_color gx.Color
|
||||
@@ -34,7 +36,8 @@ pub:
|
||||
event_fn FNvoidptr2 = voidptr(0)
|
||||
cleanup_fn FNvoidptr1 = voidptr(0)
|
||||
fail_fn FNFail = voidptr(0)
|
||||
wait_events bool = false // set this to true for UIs, to save power
|
||||
wait_events bool // set this to true for UIs, to save power
|
||||
font_path string
|
||||
}
|
||||
|
||||
pub struct GG {
|
||||
@@ -47,6 +50,8 @@ pub mut:
|
||||
config Config
|
||||
}
|
||||
|
||||
pub struct Size { pub: width int height int }
|
||||
|
||||
fn gg_init_sokol_window(user_data voidptr) {
|
||||
mut g := &GG(user_data)
|
||||
desc := C.sg_desc{
|
||||
@@ -186,6 +191,7 @@ pub fn (gg &GG) end() {
|
||||
gfx.end_pass()
|
||||
gfx.commit()
|
||||
if gg.config.wait_events {
|
||||
//println('gg: waiting')
|
||||
wait_events()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,13 +2,13 @@ module sapp
|
||||
|
||||
pub struct C.sapp_desc {
|
||||
pub:
|
||||
init_cb fn() /* these are the user-provided callbacks without user data */
|
||||
init_cb fn() // these are the user-provided callbacks without user data
|
||||
frame_cb fn()
|
||||
cleanup_cb fn()
|
||||
event_cb fn(&C.sapp_event) //&sapp_event)
|
||||
fail_cb fn(byteptr)
|
||||
|
||||
user_data voidptr /* these are the user-provided callbacks with user data */
|
||||
user_data voidptr // these are the user-provided callbacks with user data
|
||||
init_userdata_cb fn(voidptr)
|
||||
frame_userdata_cb fn(voidptr)
|
||||
cleanup_userdata_cb fn(voidptr)
|
||||
|
||||
Reference in New Issue
Block a user