1 module gfx.graal;
2 
3 public import gfx.graal.buffer;
4 public import gfx.graal.cmd;
5 public import gfx.graal.device;
6 public import gfx.graal.error;
7 public import gfx.graal.format;
8 public import gfx.graal.image;
9 public import gfx.graal.memory;
10 public import gfx.graal.pipeline;
11 public import gfx.graal.presentation;
12 public import gfx.graal.queue;
13 public import gfx.graal.renderpass;
14 public import gfx.graal.sync;
15 public import gfx.graal.types;
16 
17 import gfx.core.rc : IAtomicRefCounted;
18 import gfx.math : NDC;
19 
20 /// Backend identifier
21 enum Backend
22 {
23     /// Vulkan backend
24     vulkan,
25     /// Open GL 3 backend
26     gl3,
27 }
28 
29 /// Property of the API used to implement a Graal instance.
30 struct ApiProps
31 {
32     /// name of the API
33     string name;
34     /// Normalized Device Coordinates of the backend
35     NDC ndc;
36 }
37 
38 /// Severity of debug message.
39 /// These are flags as performance can be signaled with other severity
40 enum Severity {
41     info            = 0x01,
42     warning         = 0x02,
43     performance     = 0x04,
44     error           = 0x08,
45     debug_          = 0x10,
46 }
47 
48 /// Debug callback type
49 alias DebugCallback = void delegate(Severity severity, string message);
50 
51 /// A backend instance
52 interface Instance : IAtomicRefCounted
53 {
54     /// Backend identifier
55     @property Backend backend();
56 
57     /// Properties of the backend API
58     @property ApiProps apiProps();
59 
60     /// The devices that are installed on the system.
61     PhysicalDevice[] devices();
62 
63     /// Sets the debug callback for the instance and associated devices.
64     /// Must be set before creating devices.
65     /// Depending on backend, it might only be effective if the instance was
66     /// created with the right extensions.
67     void setDebugCallback(DebugCallback callback);
68 }