mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
examples: add port of simple triangle sokol sample (#13298)
This commit is contained in:
@@ -20,6 +20,7 @@ pub fn create_desc() gfx.Desc {
|
||||
render_target_view_cb: d3d11_get_render_target_view
|
||||
depth_stencil_view_cb: d3d11_get_depth_stencil_view
|
||||
}
|
||||
|
||||
return gfx.Desc{
|
||||
context: gfx.ContextDesc{
|
||||
metal: metal_desc
|
||||
@@ -48,6 +49,24 @@ pub fn height() int {
|
||||
return C.sapp_height()
|
||||
}
|
||||
|
||||
// color_format gets default framebuffer color pixel format
|
||||
[inline]
|
||||
pub fn color_format() int {
|
||||
return C.sapp_color_format()
|
||||
}
|
||||
|
||||
// depth_format gets default framebuffer depth pixel format
|
||||
[inline]
|
||||
pub fn depth_format() int {
|
||||
return C.sapp_depth_format()
|
||||
}
|
||||
|
||||
// sample_count gets default framebuffer sample count
|
||||
[inline]
|
||||
pub fn sample_count() int {
|
||||
return C.sapp_sample_count()
|
||||
}
|
||||
|
||||
// returns true when high_dpi was requested and actually running in a high-dpi scenario
|
||||
[inline]
|
||||
pub fn high_dpi() bool {
|
||||
|
@@ -11,6 +11,15 @@ fn C.sapp_widthf() f32
|
||||
fn C.sapp_height() int
|
||||
fn C.sapp_heightf() f32
|
||||
|
||||
// get default framebuffer color pixel format
|
||||
fn C.sapp_color_format() int
|
||||
|
||||
// get default framebuffer depth pixel format
|
||||
fn C.sapp_depth_format() int
|
||||
|
||||
// get default framebuffer sample count
|
||||
fn C.sapp_sample_count() int
|
||||
|
||||
// returns true when high_dpi was requested and actually running in a high-dpi scenario
|
||||
fn C.sapp_high_dpi() bool
|
||||
|
||||
|
Reference in New Issue
Block a user