void Object::render_instance(const ObjectInstance &inst, const Tag &tag) const
{
inst.setup_render(tag);
- unsigned lod=min(inst.get_level_of_detail(), meshes.size()-1);
+ unsigned lod=min<unsigned>(inst.get_level_of_detail(), meshes.size()-1);
meshes[lod]->draw();
inst.finish_render(tag);
}
if(!obj.technique)
throw InvalidState("Can't specify shader textures without a Technique");
- unsigned eqsign=n.find('=');
+ string::size_type eqsign=n.find('=');
if(eqsign==string::npos)
throw InvalidParameterValue("Must specify texture slot name");
void Technique::Loader::shader_texture(const string &n)
{
- unsigned eqsign=n.find('=');
+ string::size_type eqsign=n.find('=');
if(eqsign!=string::npos)
{
tech.textures.push_back(coll.get<Texture>(n.substr(eqsign+1)));
#include "except.h"
#include "vertexformat.h"
+using namespace std;
+
namespace Msp {
namespace GL {
return stride;
}
-std::istream &operator>>(std::istream &in, VertexFormat &f)
+istream &operator>>(istream &in, VertexFormat &f)
{
- std::string str;
+ string str;
in>>str;
unsigned start=0;
while(1)
{
- unsigned underscore=str.find('_', start);
+ string::size_type underscore=str.find('_', start);
bool fail=false;
if(!str.compare(start, underscore-start, "VERTEX2"))
f=(f,VERTEX2);
if(fail)
{
- in.setstate(std::ios_base::failbit);
+ in.setstate(ios_base::failbit);
break;
}
- if(underscore==std::string::npos)
+ if(underscore==string::npos)
break;
start=underscore+1;
}