]> git.tdb.fi Git - libs/gl.git/blob - source/core/deviceinfo.cpp
Store implementation limits in a central struct
[libs/gl.git] / source / core / deviceinfo.cpp
1 #include "deviceinfo.h"
2 #include "gl.h"
3
4 namespace Msp {
5 namespace GL {
6
7 Limits::Limits()
8 {
9         glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, reinterpret_cast<int *>(&max_vertex_attributes));
10         glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, reinterpret_cast<int *>(&max_texture_bindings));
11         glGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, reinterpret_cast<int *>(&max_uniform_bindings));
12         glGetIntegerv(GL_MAX_CLIP_PLANES, reinterpret_cast<int *>(&max_clip_planes));
13         glGetIntegerv(GL_MAX_SAMPLES, reinterpret_cast<int *>(&max_samples));
14         glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, reinterpret_cast<int *>(&uniform_buffer_alignment));
15 }
16
17 const Limits &Limits::get_global()
18 {
19         static Limits limits;
20         return limits;
21 }
22
23 } // namespace GL
24 } // namespace Msp