1 module gfx.graal.error;
2 
3 import std.format;
4 
5 
6 class GfxException : Exception
7 {
8     this (in string msg, in string reason) {
9         super(msg.length ?
10             format("Gfx error: %s. Reason: %s", msg, reason) :
11             format("Gfx error: %s", reason)
12         );
13     }
14 }
15 class OutOfDeviceMemoryException : GfxException
16 {
17     this (in string msg) {
18         super(msg, "Out of device memory");
19     }
20 }
21 class OutOfHostMemoryException : GfxException
22 {
23     this (in string msg) {
24         super(msg, "Out of host memory");
25     }
26 }
27 class InitializationFailedException : GfxException
28 {
29     this (in string msg) {
30         super(msg, "Initialization failed");
31     }
32 }
33 class MemoryMapFailedException : GfxException
34 {
35     this (in string msg) {
36         super(msg, "Memory map failed");
37     }
38 }
39 class DeviceLostException : GfxException
40 {
41     this (in string msg) {
42         super(msg, "Device lost");
43     }
44 }
45 class ExtensionNotPresentException : GfxException
46 {
47     this (in string msg) {
48         super(msg, "Extension not present");
49     }
50 }
51 class FeatureNotPresentException : GfxException
52 {
53     this (in string msg) {
54         super(msg, "Feature not present");
55     }
56 }
57 class LayerNotPresentException : GfxException
58 {
59     this (in string msg) {
60         super(msg, "Layer not present");
61     }
62 }
63 class IncompatibleDriverException : GfxException
64 {
65     this (in string msg) {
66         super(msg, "Incompatible driver");
67     }
68 }
69 class TooManyObjectsException : GfxException
70 {
71     this (in string msg) {
72         super(msg, "Too many objects");
73     }
74 }
75 class FormatNotSupportedException : GfxException
76 {
77     this (in string msg) {
78         super(msg, "Format not supported");
79     }
80 }
81 class SurfaceLostException : GfxException
82 {
83     this (in string msg) {
84         super(msg, "Surface lost");
85     }
86 }
87 class OutOfDateException : GfxException
88 {
89     this (in string msg) {
90         super(msg, "Out of date");
91     }
92 }
93 class IncompatibleDisplayException : GfxException
94 {
95     this (in string msg) {
96         super(msg, "Incompatible display");
97     }
98 }
99 class NativeWindowInUseException : GfxException
100 {
101     this (in string msg) {
102         super(msg, "Native window in use");
103     }
104 }
105 class ValidationFailedException : GfxException
106 {
107     this (in string msg) {
108         super(msg, "Validation failed");
109     }
110 }