V-Gears 0
Free Final Fantasy VII engine.
ParticleRendererFactory.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2022 The V-Gears Team
3 *
4 * This file is part of V-Gears
5 *
6 * V-Gears is free software: you can redistribute it and/or modify it under
7 * terms of the GNU General Public License as published by the Free Software
8 * Foundation, version 3.0 (GPLv3) of the License.
9 *
10 * V-Gears is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#pragma once
17
18#include "ParticleRenderer.h"
19
24
25 public:
26
31
36
42 virtual Ogre::String GetRendererType() const = 0;
43
50
57 if (renderer != NULL) delete renderer;
58 };
59
60 protected:
61
68 template <class T>
70 ParticleRenderer* particle_renderer = new T();
71 particle_renderer->SetRendererType(GetRendererType());
72 return particle_renderer;
73 };
74};
A particle renderer factory.
Definition: ParticleRendererFactory.h:23
virtual ~ParticleRendererFactory()
Destructor.
Definition: ParticleRendererFactory.h:35
ParticleRenderer * _createRenderer()
Creates a particle renderer.
Definition: ParticleRendererFactory.h:69
virtual Ogre::String GetRendererType() const =0
Retrieves the renderer type.
void DestroyRenderer(ParticleRenderer *renderer)
Destroys a renderer.
Definition: ParticleRendererFactory.h:56
ParticleRendererFactory()
Constructor.
Definition: ParticleRendererFactory.h:30
virtual ParticleRenderer * CreateRenderer()=0
Creates a rendered.
A particle renderer.
Definition: ParticleRenderer.h:28
void SetRendererType(Ogre::String renderer_type)
Sets the renderer type.
Definition: ParticleRenderer.cpp:35
Ogre::String String
Definition: TypeDefine.h:37