]> git.tdb.fi Git - libs/gl.git/blob - source/core/deviceinfo.cpp
Wrap Limits into a DeviceInfo struct
[libs/gl.git] / source / core / deviceinfo.cpp
1 #include <msp/gl/extensions/arb_uniform_buffer_object.h>
2 #include <msp/gl/extensions/arb_vertex_shader.h>
3 #include <msp/gl/extensions/ext_framebuffer_multisample.h>
4 #include <msp/gl/extensions/msp_clipping.h>
5 #include <msp/gl/extensions/nv_fbo_color_attachments.h>
6 #include "deviceinfo.h"
7 #include "gl.h"
8
9 namespace Msp {
10 namespace GL {
11
12 Limits::Limits()
13 {
14         glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, reinterpret_cast<int *>(&max_vertex_attributes));
15         glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, reinterpret_cast<int *>(&max_texture_bindings));
16         glGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, reinterpret_cast<int *>(&max_uniform_bindings));
17         glGetIntegerv(GL_MAX_CLIP_PLANES, reinterpret_cast<int *>(&max_clip_planes));
18         glGetIntegerv(GL_MAX_SAMPLES, reinterpret_cast<int *>(&max_samples));
19         glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, reinterpret_cast<int *>(&uniform_buffer_alignment));
20         glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS, reinterpret_cast<int *>(&max_color_attachments));
21 }
22
23
24 const DeviceInfo &DeviceInfo::get_global()
25 {
26         static DeviceInfo info;
27         return info;
28 }
29
30 } // namespace GL
31 } // namespace Msp