--- /dev/null
+#include <string.h>
+#include "icon.h"
+#include "fs.h"
+#include "meshgen.h"
+#include "mesh.h"
+
+IconRenderer::~IconRenderer()
+{
+}
+
+bool IconRenderer::init()
+{
+ return true;
+}
+
+void IconRenderer::shutdown()
+{
+}
+
+
+// Shapes icon renderer
+enum {
+ SHAPE_SPHERE,
+ SHAPE_BOX,
+ SHAPE_TORUS,
+ SHAPE_CONE,
+ NUM_SHAPES
+};
+
+struct ShapesIconsPriv {
+ Mesh *shape[NUM_SHAPES];
+};
+
+ShapesIcons::ShapesIcons()
+{
+ priv = new ShapesIconsPriv;
+ memset(priv, 0, sizeof *priv);
+}
+
+ShapesIcons::~ShapesIcons()
+{
+ shutdown();
+ delete priv;
+}
+
+bool ShapesIcons::init()
+{
+ for(int i=0; i<NUM_SHAPES; i++) {
+ priv->shape[i] = new Mesh;
+ }
+
+ gen_geosphere(priv->shape[SHAPE_SPHERE], 1.0, 2);
+ gen_box(priv->shape[SHAPE_BOX], 1, 1, 1);
+ gen_torus(priv->shape[SHAPE_TORUS], 0.9, 0.2, 16, 8);
+ gen_cone(priv->shape[SHAPE_CONE], 0.8, 1.0, 8, 2);
+
+ return true;
+}
+
+void ShapesIcons::shutdown()
+{
+ for(int i=0; i<NUM_SHAPES; i++) {
+ delete priv->shape[i];
+ }
+}
+
+void ShapesIcons::draw(FSNode *node) const
+{
+}
--- /dev/null
+#ifndef ICON_H_
+#define ICON_H_
+
+class FSNode;
+
+class IconRenderer {
+public:
+ virtual ~IconRenderer();
+
+ virtual bool init();
+ virtual void shutdown();
+
+ virtual void draw(FSNode *node) const = 0;
+};
+
+struct ShapesIconsPriv;
+
+class ShapesIcons : public IconRenderer {
+private:
+ ShapesIconsPriv *priv;
+
+public:
+ ShapesIcons();
+ ~ShapesIcons();
+
+ bool init();
+ void shutdown();
+
+ void draw(FSNode *node) const;
+};
+
+#endif // ICON_H_