mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
gg: update sokol and stb_truetype
This commit is contained in:
19
vlib/gg/gg.v
19
vlib/gg/gg.v
@@ -74,6 +74,24 @@ pub:
|
||||
|
||||
fn gg_init_sokol_window(user_data voidptr) {
|
||||
mut g := &Context(user_data)
|
||||
mtl_desc := C.sg_mtl_context_desc {
|
||||
device: sapp.metal_get_device()
|
||||
renderpass_descriptor_cb: sapp.metal_get_renderpass_descriptor
|
||||
drawable_cb: sapp.metal_get_drawable
|
||||
}
|
||||
d3d11_desc := C.sg_d3d11_context_desc {
|
||||
device: sapp.d3d11_get_device()
|
||||
device_context: sapp.d3d11_get_device_context()
|
||||
render_target_view_cb: sapp.d3d11_get_render_target_view
|
||||
depth_stencil_view_cb: sapp.d3d11_get_depth_stencil_view
|
||||
}
|
||||
desc := C.sg_desc{
|
||||
context: C.sg_context_desc{
|
||||
metal: mtl_desc
|
||||
d3d11: d3d11_desc
|
||||
}
|
||||
}
|
||||
/*
|
||||
desc := C.sg_desc{
|
||||
mtl_device: sapp.metal_get_device()
|
||||
mtl_renderpass_descriptor_cb: sapp.metal_get_renderpass_descriptor
|
||||
@@ -83,6 +101,7 @@ fn gg_init_sokol_window(user_data voidptr) {
|
||||
d3d11_render_target_view_cb: sapp.d3d11_get_render_target_view
|
||||
d3d11_depth_stencil_view_cb: sapp.d3d11_get_depth_stencil_view
|
||||
}
|
||||
*/
|
||||
gfx.setup(&desc)
|
||||
sgl_desc := C.sgl_desc_t{}
|
||||
sgl.setup(&sgl_desc)
|
||||
|
||||
@@ -6,7 +6,6 @@ pub const (
|
||||
used_import = 1 + fontstash.used_import
|
||||
)
|
||||
|
||||
/*
|
||||
#flag windows -I @VROOT/thirdparty/freetype/include
|
||||
#flag windows -L @VROOT/thirdparty/freetype/win64
|
||||
|
||||
@@ -23,7 +22,11 @@ pub const (
|
||||
#flag darwin -lfreetype
|
||||
|
||||
#flag darwin -lpng -lbz2 -lz
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#flag linux -I.
|
||||
|
||||
|
||||
@@ -8,22 +8,60 @@ pub struct C.sg_desc {
|
||||
pipeline_pool_size int
|
||||
pass_pool_size int
|
||||
context_pool_size int
|
||||
/* GL specific */
|
||||
context C.sg_context_desc
|
||||
/*
|
||||
// GL specific
|
||||
gl_force_gles2 bool
|
||||
/* Metal-specific */
|
||||
// Metal-specific
|
||||
mtl_device voidptr
|
||||
mtl_renderpass_descriptor_cb fn() voidptr
|
||||
mtl_drawable_cb fn() voidptr
|
||||
mtl_global_uniform_buffer_size int
|
||||
mtl_sampler_cache_size int
|
||||
/* D3D11-specific */
|
||||
// D3D11-specific
|
||||
d3d11_device voidptr
|
||||
d3d11_device_context voidptr
|
||||
d3d11_render_target_view_cb fn() voidptr
|
||||
d3d11_depth_stencil_view_cb fn() voidptr
|
||||
*/
|
||||
_end_canary u32
|
||||
}
|
||||
|
||||
|
||||
pub struct C.sg_context_desc {
|
||||
/*
|
||||
sg_pixel_format color_format;
|
||||
sg_pixel_format depth_format;
|
||||
int sample_count;
|
||||
sg_wgpu_context_desc wgpu;
|
||||
*/
|
||||
sample_count int
|
||||
gl C.sg_gl_context_desc
|
||||
metal C.sg_mtl_context_desc
|
||||
d3d11 C.sg_d3d11_context_desc
|
||||
|
||||
color_format PixelFormat
|
||||
depth_format PixelFormat
|
||||
}
|
||||
|
||||
pub struct C.sg_gl_context_desc {
|
||||
gl_force_gles2 bool
|
||||
}
|
||||
|
||||
pub struct C.sg_mtl_context_desc {
|
||||
device voidptr
|
||||
renderpass_descriptor_cb fn() voidptr
|
||||
drawable_cb fn() voidptr
|
||||
}
|
||||
|
||||
pub struct C.sg_d3d11_context_desc {
|
||||
device voidptr
|
||||
device_context voidptr
|
||||
render_target_view_cb fn() voidptr
|
||||
depth_stencil_view_cb fn() voidptr
|
||||
}
|
||||
|
||||
|
||||
pub struct C.sg_pipeline_desc {
|
||||
pub mut:
|
||||
_start_canary u32
|
||||
|
||||
Reference in New Issue
Block a user