From: Mikko Rasa Date: Sun, 11 Apr 2021 20:38:31 +0000 (+0300) Subject: Deprecated InstanceScene and Renderable::get_instance_key X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=0d72f33166794243b3a0a5e4cf8e72035f19b353;p=libs%2Fgl.git Deprecated InstanceScene and Renderable::get_instance_key InstanceArray is a superior way of rendering multiple instances of an object. --- diff --git a/source/render/instancescene.cpp b/source/render/instancescene.cpp index 20ac0f68..c1f10979 100644 --- a/source/render/instancescene.cpp +++ b/source/render/instancescene.cpp @@ -3,6 +3,8 @@ #include "instancescene.h" #include "renderer.h" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + namespace Msp { namespace GL { diff --git a/source/render/instancescene.h b/source/render/instancescene.h index 85ec3794..ae9b637b 100644 --- a/source/render/instancescene.h +++ b/source/render/instancescene.h @@ -3,6 +3,7 @@ #include #include +#include #include #include "scene.h" @@ -14,7 +15,7 @@ A Scene optimized for rendering instanced Renderables, such as ObjectInstances. All Renderables with the same instance key are rendered consecutively; within the same key rendering order is unspecified. */ -class InstanceScene: public Scene +class DEPRECATED InstanceScene: public Scene { private: typedef std::set RenderableSet; diff --git a/source/render/objectinstance.h b/source/render/objectinstance.h index c3128877..c5358b06 100644 --- a/source/render/objectinstance.h +++ b/source/render/objectinstance.h @@ -32,7 +32,7 @@ public: ObjectInstance(const Object &); const Object &get_object() const { return object; } - virtual IntPtr get_instance_key() const { return reinterpret_cast(&object); } + DEPRECATED virtual IntPtr get_instance_key() const { return reinterpret_cast(&object); } virtual const Geometry::BoundingSphere *get_bounding_sphere() const { return object.get_bounding_sphere(); } diff --git a/source/render/renderable.h b/source/render/renderable.h index 8af524fd..30386392 100644 --- a/source/render/renderable.h +++ b/source/render/renderable.h @@ -2,6 +2,7 @@ #define MSP_GL_RENDERABLE_H_ #include +#include #include #include #include "tag.h" @@ -35,7 +36,7 @@ public: /** Returns a key used for grouping Renderables in an InstanceScene. The returned value is treated as opaque. */ - virtual IntPtr get_instance_key() const { return 0; } + DEPRECATED virtual IntPtr get_instance_key() const { return 0; } /** Returns the model matrix of the Renderable. Null is returned if no such matrix exists. The matrix should be in world space for some effects to work