#include <algorithm>
+#include <msp/io/print.h>
#include <msp/strings/format.h>
#include <msp/strings/lexicalcast.h>
#include <msp/strings/utils.h>
#include "error.h"
-#include "misc.h"
#include "vertexformat.h"
-#include <msp/gl/extensions/arb_vertex_shader.h>
using namespace std;
else if(attr<GENERIC1 || attr>GENERIC4)
throw invalid_argument("make_indexed_attribute");
- static int max_attribs = -1;
- if(max_attribs<0)
- max_attribs = get_i(GL_MAX_VERTEX_ATTRIBS);
-
- if(static_cast<int>((base>>3)+index)>=max_attribs)
+ if(static_cast<int>((base>>3)+index)>=31)
throw out_of_range("make_indexed_attribute");
return static_cast<VertexAttribute>(base+index*8);
else if(str=="TANGENT3")
a = TANGENT3;
else if(str=="BINORMAL3")
- a = BINORMAL3;
+ {
+ IO::print(IO::cerr, "BINORMAL3 attribute is deprecated\n");
+ a = make_indexed_attribute(GENERIC3, 5);
+ }
else if(!convert_attribute(str, "VERTEX", 2, 4, a, VERTEX2) &&
!convert_attribute(str, "GROUP", 1, 4, a, GROUP1) &&
!convert_attribute(str, "WEIGHT", 1, 4, a, WEIGHT1) &&