1 /++
2 + Machine generated D bindings for Sokol library.
3 + 
4 +     Source header: sokol_letterbox.h
5 +     Module: sokol.letterbox
6 + 
7 +     Do not edit manually; regenerate using gen_d.py.
8 +/
9 module sokol.letterbox;
10 
11 /++
12 + Defines a 'safe border' in pixels. Used as nested struct
13 +     in slbx_letterbox_desc.
14 +/
15 extern(C) struct Border {
16     int left = 0;
17     int right = 0;
18     int top = 0;
19     int bottom = 0;
20 }
21 /++
22 + Anchor the content to a side. The default is to center the content.
23 +     Used in slbx_letterbox_desc.
24 +/
25 enum Anchor {
26     Center = 0,
27     Top,
28     Bottom,
29     Left,
30     Right,
31 }
32 /++
33 + The content letterbox description. Used as input to the
34 +     slbx_letterbox() function.
35 +/
36 extern(C) struct LetterboxDesc {
37     float content_aspect_ratio = 0.0f;
38     Anchor anchor = Anchor.Center;
39     Border border = {};
40 }
41 /++
42 + The resulting viewport. Return value of slbx_letterbox()
43 +/
44 extern(C) struct Viewport {
45     int x = 0;
46     int y = 0;
47     int width = 0;
48     int height = 0;
49 }
50 /++
51 + compute viewport for 'letterboxing' fixed-aspect content in a variable-aspect framebuffer
52 +/
53 extern(C) Viewport slbx_letterbox(int width, int height, const LetterboxDesc* desc) @system @nogc nothrow pure;
54 Viewport letterbox(int width, int height, scope ref LetterboxDesc desc) @trusted @nogc nothrow pure {
55     return slbx_letterbox(width, height, &desc);
56 }