X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fdeviceinfo.cpp;fp=source%2Fcore%2Fdeviceinfo.cpp;h=54cb88b43182b616b41a569d73c8306092da260c;hb=2d3113a7dbbe4be2f1d1e8980c1c4e42175163da;hp=0000000000000000000000000000000000000000;hpb=c5583e23cc7b064ac28f2b2b6993d1e5fa415d5b;p=libs%2Fgl.git diff --git a/source/core/deviceinfo.cpp b/source/core/deviceinfo.cpp new file mode 100644 index 00000000..54cb88b4 --- /dev/null +++ b/source/core/deviceinfo.cpp @@ -0,0 +1,24 @@ +#include "deviceinfo.h" +#include "gl.h" + +namespace Msp { +namespace GL { + +Limits::Limits() +{ + glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, reinterpret_cast(&max_vertex_attributes)); + glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, reinterpret_cast(&max_texture_bindings)); + glGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, reinterpret_cast(&max_uniform_bindings)); + glGetIntegerv(GL_MAX_CLIP_PLANES, reinterpret_cast(&max_clip_planes)); + glGetIntegerv(GL_MAX_SAMPLES, reinterpret_cast(&max_samples)); + glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, reinterpret_cast(&uniform_buffer_alignment)); +} + +const Limits &Limits::get_global() +{ + static Limits limits; + return limits; +} + +} // namespace GL +} // namespace Msp