From: Mikko Rasa Date: Wed, 24 Sep 2008 16:17:29 +0000 (+0000) Subject: Add virtual destructors to Renderable and Uniform X-Git-Tag: 1.0~4 X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=commitdiff_plain;h=61f90f1680884b02e783d2d419f9326e5d6f397b Add virtual destructors to Renderable and Uniform Convert C-style casts to C++-style --- diff --git a/source/renderable.h b/source/renderable.h index e96ac77a..b83fdb0d 100644 --- a/source/renderable.h +++ b/source/renderable.h @@ -16,7 +16,11 @@ namespace GL { class Renderable { +protected: + Renderable() { } public: + virtual ~Renderable() { } + virtual bool has_pass(const Tag &tag) const =0; virtual void render(const Tag &tag=Tag()) const =0; }; diff --git a/source/uniform.h b/source/uniform.h index 33b80e93..e6b4ca3a 100644 --- a/source/uniform.h +++ b/source/uniform.h @@ -18,6 +18,8 @@ class Uniform protected: Uniform() { } public: + virtual ~Uniform() { } + virtual void apply(int) const =0; }; diff --git a/source/vertexarraybuilder.cpp b/source/vertexarraybuilder.cpp index c64c8ebf..f251632e 100644 --- a/source/vertexarraybuilder.cpp +++ b/source/vertexarraybuilder.cpp @@ -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; - 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(cr*255); + u.c[1]=static_cast(cg*255); + u.c[2]=static_cast(cb*255); + u.c[3]=static_cast(ca*255); *+ptr++=u.f; } else