00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00021
00022
00023 #ifndef H_SPK_GLPOINTRENDERER
00024 #define H_SPK_GLPOINTRENDERER
00025
00026 #include "RenderingAPIs/OpenGL/SPK_GLRenderer.h"
00027 #include "RenderingAPIs/OpenGL/SPK_GLExtHandler.h"
00028 #include "Extensions/Renderers/SPK_PointRendererInterface.h"
00029
00030 namespace SPK
00031 {
00032 namespace GL
00033 {
00056 class SPK_GL_PREFIX GLPointRenderer : public GLRenderer,
00057 public PointRendererInterface,
00058 public GLExtHandler
00059 {
00060
00061 SPK_IMPLEMENT_REGISTERABLE(GLPointRenderer)
00062
00063 public :
00064
00066
00068
00073 GLPointRenderer(float size = 1.0f);
00074
00081 static GLPointRenderer* create(float size = 1.0f);
00082
00084
00086
00087 virtual bool setType(PointType type);
00088
00096 void setTexture(GLuint textureIndex);
00097
00109 bool enableWorldSize(bool worldSizeEnabled);
00110
00112
00114
00119 GLuint getTexture() const;
00120
00125 bool isWorldSizeEnabled() const;
00126
00128
00130
00131 virtual void render(const Group& group);
00132
00133 private :
00134
00135 GLuint textureIndex;
00136 bool worldSize;
00137 };
00138
00139
00140 inline GLPointRenderer* GLPointRenderer::create(float size)
00141 {
00142 GLPointRenderer* obj = new GLPointRenderer(size);
00143 registerObject(obj);
00144 return obj;
00145 }
00146
00147 inline void GLPointRenderer::setTexture(GLuint textureIndex)
00148 {
00149 this->textureIndex = textureIndex;
00150 }
00151
00152 inline GLuint GLPointRenderer::getTexture() const
00153 {
00154 return textureIndex;
00155 }
00156
00157 inline bool GLPointRenderer::isWorldSizeEnabled() const
00158 {
00159 return worldSize;
00160 }
00161 }}
00162
00163 #endif