X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fdevice.h;h=8c7e92a99f0144e6d4e0f8052314239d90913191;hb=560b11de262a6cae2c71d744598bf3fd435ab14f;hp=6a6a76080fed875ec165622ef5b194b5a3539586;hpb=f0414f06fc2463e9765c9492dce60e0468dceb3c;p=libs%2Fgl.git diff --git a/source/core/device.h b/source/core/device.h index 6a6a7608..8c7e92a9 100644 --- a/source/core/device.h +++ b/source/core/device.h @@ -2,11 +2,40 @@ #define MSP_GL_DEVICE_H_ #include +#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_storage_texture_bindings = 8; + 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,13 +44,17 @@ class Device: public DeviceBackend friend DeviceBackend; private: + DeviceInfo info; + static Device *current; public: - Device(Graphics::Window &, const DeviceOptions & = DeviceOptions()); + Device(Graphics::Window &); + Device(Graphics::Window &, const DeviceOptions &); ~Device(); using DeviceBackend::get_context; + const DeviceInfo &get_info() const { return info; } static Device &get_current(); };