]> git.tdb.fi Git - libs/gl.git/blob - source/core/device.cpp
Fix reflection of image types from Spir-V modules
[libs/gl.git] / source / core / device.cpp
1 #include "device.h"
2 #include "error.h"
3
4 namespace Msp {
5 namespace GL {
6
7 Device *Device::current = 0;
8
9 Device::Device(Graphics::Window &w, const DeviceOptions &o):
10         DeviceBackend(w, o)
11 {
12         current = this;
13
14         info.api = get_backend_api();
15         fill_info();
16 }
17
18 Device::~Device()
19 {
20         if(this==current)
21                 current = 0;
22 }
23
24 Device &Device::get_current()
25 {
26         if(!current)
27                 throw invalid_operation("no current device");
28         return *current;
29 }
30
31 } // namespace GL
32 } // namespace Msp