LineSetRenderer.hpp

00001 #ifndef __fiberGL_LineSetRenderer_HPP
00002 #define __fiberGL_LineSetRenderer_HPP
00003 
00004 #include <GLvish/VBO.hpp>
00005 #include <GLvish/IndexBuffer.hpp>
00006 #include <GLvish/Shader.hpp>
00007 #include <fish/fiber/grid/Grid.hpp>
00008 
00009 #include "fishGLDllApi.h"
00010 
00011 namespace GL
00012 {
00013         using namespace MemCore;
00014 
00015 
00022 struct  LineSetRenderer : Wizt::VBO::Renderer
00023 {
00024         WeakPtr<Fiber::Grid>    MyGrid;
00025 
00026         int     WhichOneOnly,
00027                 nLines;
00028         
00029         bool    DontUseIndexBuffer;
00030 
00031         enum    DrawMode
00032         {
00033                 AsLineStrip = 0x1,
00034                 AsPoints    = 0x2,
00035                 AsLinesAndPoints = AsPoints | AsLineStrip
00036         };
00037 
00038         DrawMode        myDrawMode;
00039 
00040         RefPtr<Wizt::IndexBufferObject> IBO;
00041 
00042         const RefPtr<Fiber::FragmentID> frag;
00043 
00047         LineSetRenderer(const WeakPtr<Fiber::Grid>&RenderableGrid, DrawMode theDrawMode = AsLineStrip, const RefPtr<Fiber::FragmentID>& f = NullPtr() );
00048 
00052         LineSetRenderer(const WeakPtr<Fiber::Grid>&RenderableGrid, Wizt::GeometryShader::InputType);
00053 
00054         bool    drawElements(DrawMode Mode = AsLineStrip);
00055 
00056         override bool draw();
00057 };
00058 
00059 } // GL
00060 
00061 #endif // __fiberGL_LineSetRenderer_HPP
00062 
00063 
00064