- /*
- * Greate the quad geometry.
- * Quad geometry is shared by multiple kind of Renderer, so implement it in the factory-cache.
+ /**
+ * Create the grid geometry.
+ * @param[in] gridSize The size of the grid.
+ * @return The created grid geometry.
+ */
+ static Geometry CreateGridGeometry( Uint16Pair gridSize );
+
+public:
+
+ /**
+ * @brief Request renderer from the url
+ *
+ * @return The cached renderer if exist in the cache. Otherwise an empty handle is returned.
+ */
+ Renderer GetRenderer( const std::string& key ) const;
+
+ /**
+ * @brief Cache the renderer based on the given key.
+ *
+ * If the key already exists in the cache, then the cache will save an additional renderer to the cache.
+ * RemoveRenderer will then need to be called twice to remove both items from the cache.
+ *
+ * @param[in] key The key to use for caching
+ * @param[in] renderer The Renderer to be cached
+ */
+ void SaveRenderer( const std::string& key, Renderer& renderer );
+
+ /**
+ * @brief Cleans the renderer cache by removing the renderer from the cache based on the given key if there are no longer any references to it
+ *
+ * @param[in] key The key used for caching
+ *
+ * @return True if the renderer is no longer used anywhere, false otherwise
+ */
+ bool CleanRendererCache( const std::string& key );
+
+ /**
+ * @brief Cache the debug renderer