]> git.tdb.fi Git - libs/gl.git/commitdiff
Fix compilation on 64-bit platforms
authorMikko Rasa <tdb@tdb.fi>
Fri, 4 Dec 2009 07:00:37 +0000 (07:00 +0000)
committerMikko Rasa <tdb@tdb.fi>
Fri, 4 Dec 2009 07:00:37 +0000 (07:00 +0000)
Set init_done in get_version

source/extension.cpp
source/object.cpp
source/technique.cpp
source/vertexformat.cpp

index ba7dd4020d4ce9164a39e525ae520073b9fbe1cc..6383cd3cee75a524853c1646f193e6795677a2f4 100644 (file)
@@ -76,6 +76,8 @@ const Version &get_gl_version()
                        init_version_1_2();
                if(combined>=0x103)
                        init_version_1_3();
+
+               init_done = true;
        }
 
        return version;
index 2026e3d58f3d0b658ed4b3bdba7fe9d211d6ffd1..a23aa433b92a8a2611b938af84342c9fce082400 100644 (file)
@@ -111,7 +111,7 @@ void Object::finish_render(const ObjectPass *pass) const
 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);
 }
@@ -169,7 +169,7 @@ void Object::Loader::shader_texture(const string &n)
        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");
 
index 4d2377a350549e50641c0e045cc6e88f7e8c6374..74cd6c311be0699e10760922452c702507458e58 100644 (file)
@@ -119,7 +119,7 @@ void Technique::Loader::shader(const string &n)
 
 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)));
index 91084bcc273e0bff6524746b22372a10d7b88eee..b9bd7b9402414f16ad3b0c70d11a835b12ef9c3f 100644 (file)
@@ -10,6 +10,8 @@ Distributed under the LGPL
 #include "except.h"
 #include "vertexformat.h"
 
+using namespace std;
+
 namespace Msp {
 namespace GL {
 
@@ -102,16 +104,16 @@ uint get_stride(const VertexFormat &f)
        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);
@@ -162,11 +164,11 @@ std::istream &operator>>(std::istream &in, VertexFormat &f)
 
                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;
        }