]> git.tdb.fi Git - libs/gl.git/commitdiff
Add virtual destructors to Renderable and Uniform
authorMikko Rasa <tdb@tdb.fi>
Wed, 24 Sep 2008 16:17:29 +0000 (16:17 +0000)
committerMikko Rasa <tdb@tdb.fi>
Wed, 24 Sep 2008 16:17:29 +0000 (16:17 +0000)
Convert C-style casts to C++-style

source/renderable.h
source/uniform.h
source/vertexarraybuilder.cpp

index e96ac77a853a96b9de09a30baa41096f70f3eef8..b83fdb0dfc59747400d63434372299188015cec1 100644 (file)
@@ -16,7 +16,11 @@ namespace GL {
 
 class Renderable
 {
 
 class Renderable
 {
+protected:
+       Renderable() { }
 public:
 public:
+       virtual ~Renderable() { }
+
        virtual bool has_pass(const Tag &tag) const =0;
        virtual void render(const Tag &tag=Tag()) const =0;
 };
        virtual bool has_pass(const Tag &tag) const =0;
        virtual void render(const Tag &tag=Tag()) const =0;
 };
index 33b80e938287b5ea70017b1a67b0e5b1609ce34d..e6b4ca3a0ffa1dd7c97a2959d44dcd929aa9fa79 100644 (file)
@@ -18,6 +18,8 @@ class Uniform
 protected:
        Uniform() { }
 public:
 protected:
        Uniform() { }
 public:
+       virtual ~Uniform() { }
+
        virtual void apply(int) const =0;
 };
 
        virtual void apply(int) const =0;
 };
 
index c64c8ebfc882fca127b9771b2d1818af9ddeabaa..f251632e9dfcaffce572aef546d056ee33d2b661 100644 (file)
@@ -49,10 +49,10 @@ void VertexArrayBuilder::vertex_(float x, float y, float z, float w)
                        if(size==1)
                        {
                                union { ubyte c[4]; float f; } u;
                        if(size==1)
                        {
                                union { ubyte c[4]; float f; } u;
-                               u.c[0]=(ubyte)(cr*255);
-                               u.c[1]=(ubyte)(cg*255);
-                               u.c[2]=(ubyte)(cb*255);
-                               u.c[3]=(ubyte)(ca*255);
+                               u.c[0]=static_cast<ubyte>(cr*255);
+                               u.c[1]=static_cast<ubyte>(cg*255);
+                               u.c[2]=static_cast<ubyte>(cb*255);
+                               u.c[3]=static_cast<ubyte>(ca*255);
                                *+ptr++=u.f;
                        }
                        else
                                *+ptr++=u.f;
                        }
                        else