]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/vertexsetup.cpp
Move backend information into Device
[libs/gl.git] / source / core / vertexsetup.cpp
index 4fd589a9698bfe8a1616a4d097902a984e4f9c49..61bf032c0fcaecae0ffac46fef15c95f86e95952 100644 (file)
@@ -1,4 +1,4 @@
-#include "deviceinfo.h"
+#include "device.h"
 #include "error.h"
 #include "vertexarray.h"
 #include "vertexsetup.h"
@@ -8,14 +8,6 @@ using namespace std;
 namespace Msp {
 namespace GL {
 
-VertexSetup::VertexSetup():
-       dirty(0),
-       vertex_array(0),
-       inst_array(0),
-       index_buffer(0),
-       index_type(UNSIGNED_SHORT)
-{ }
-
 void VertexSetup::set_format(const VertexFormat &vfmt)
 {
        if(!verify_format(vfmt))
@@ -31,9 +23,9 @@ void VertexSetup::set_format(const VertexFormat &vfmt)
 void VertexSetup::set_format_instanced(const VertexFormat &vfmt, const VertexFormat &ifmt)
 {
        if(!verify_format(vfmt) || !verify_format(ifmt))
-               throw invalid_argument("VertexSetup::set_format");
+               throw invalid_argument("VertexSetup::set_format_instanced");
        if(!vertex_format.empty())
-               throw invalid_operation("VertexSetup::set_format");
+               throw invalid_operation("VertexSetup::set_format_instanced");
 
        require_format(vfmt, false);
        require_format(ifmt, true);
@@ -80,7 +72,7 @@ bool VertexSetup::verify_format(const VertexFormat &fmt)
        if(fmt.empty())
                return false;
 
-       static unsigned max_attribs = DeviceInfo::get_global().limits.max_vertex_attributes;
+       static unsigned max_attribs = Device::get_current().get_info().limits.max_vertex_attributes;
        return all_of(fmt.begin(), fmt.end(), [](VertexAttribute a){ return get_attribute_semantic(a)<max_attribs; });
 }