]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/device.h
Move backend information into Device
[libs/gl.git] / source / core / device.h
index 6a6a76080fed875ec165622ef5b194b5a3539586..2b75e4c81a9d9613ee478fc64ac1e99c4aac3517 100644 (file)
@@ -2,11 +2,39 @@
 #define MSP_GL_DEVICE_H_
 
 #include <msp/graphics/window.h>
+#include "backend.h"
 #include "device_backend.h"
+#include "glsl/features.h"
 
 namespace Msp {
 namespace GL {
 
+/**
+Contains information about various limits imposed by the graphics device.
+*/
+struct DeviceLimits
+{
+       unsigned max_clip_planes = 6;
+       unsigned max_vertex_attributes = 16;
+       unsigned max_texture_bindings = 16;
+       unsigned max_color_attachments = 8;
+       unsigned max_samples = 4;
+       unsigned max_uniform_bindings = 24;
+       unsigned uniform_buffer_alignment = 256;
+       float max_anisotropy = 1.0f;
+};
+
+/**
+Contains information about a graphics device.
+*/
+struct DeviceInfo
+{
+       GraphicsApi api;
+       Version api_version;
+       DeviceLimits limits;
+       SL::Features glsl_features;
+};
+
 /**
 Represents a graphics device.  An instance must be created to use the library.
 */
@@ -15,6 +43,8 @@ class Device: public DeviceBackend
        friend DeviceBackend;
 
 private:
+       DeviceInfo info;
+
        static Device *current;
 
 public:
@@ -22,6 +52,7 @@ public:
        ~Device();
 
        using DeviceBackend::get_context;
+       const DeviceInfo &get_info() const { return info; }
 
        static Device &get_current();
 };