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_GLLINERENDERER
00024 #define H_SPK_GLLINERENDERER
00025
00026 #include "RenderingAPIs/OpenGL/SPK_GLRenderer.h"
00027 #include "Extensions/Renderers/SPK_LineRendererInterface.h"
00028
00029 namespace SPK
00030 {
00031 namespace GL
00032 {
00048 class SPK_GL_PREFIX GLLineRenderer : public GLRenderer, public LineRendererInterface
00049 {
00050 SPK_IMPLEMENT_REGISTERABLE(GLLineRenderer)
00051
00052 public :
00053
00055
00057
00063 GLLineRenderer(float length = 1.0f,float width = 1.0f);
00064
00072 static GLLineRenderer* create(float length = 1.0f,float width = 1.0f);
00073
00075
00077
00078 virtual void createBuffers(const Group& group);
00079 virtual void destroyBuffers(const Group& group);
00080
00081 virtual void render(const Group& group);
00082
00083 protected :
00084
00085 virtual bool checkBuffers(const Group& group);
00086
00087 private :
00088
00089
00090 static float* gpuBuffer;
00091 static float* gpuIterator;
00092
00093
00094 static const std::string GPU_BUFFER_NAME;
00095 };
00096
00097
00098 inline GLLineRenderer* GLLineRenderer::create(float length,float width)
00099 {
00100 GLLineRenderer* obj = new GLLineRenderer(length,width);
00101 registerObject(obj);
00102 return obj;
00103 }
00104 }}
00105
00106 #endif