00001 #ifndef __FRAGMENTPAINTER_HPP
00002 #define __FRAGMENTPAINTER_HPP
00003
00004 #include <bone/FishField.hpp>
00005
00006 #include <ocean/GLvish/VGLRenderObject.hpp>
00007 #include <ocean/GLvish/BoundingBox.hpp>
00008 #include <ocean/GLvish/Shader.hpp>
00009 #include <GL/FieldBuffer.hpp>
00010 #include <bone/FragmentSelector.hpp>
00011
00012 #include "VertexFieldCollection.hpp"
00013
00014 namespace Wizt
00015 {
00016
00017 using namespace Fiber;
00018 using namespace Eagle;
00019
00045 struct fisheye_API FragmentPainter : public virtual Fish<VObject>,
00046 public VertexFieldCollection
00047 {
00052 TypedSlot<FragmentSelector> MyFragmentSelector;
00053
00054 virtual ~FragmentPainter();
00055
00060 FragmentPainter(VObject*that, const string&fragmentselectorname = "selection", int EL=1);
00061
00066 virtual string FragmentSelectionField() const;
00067
00086 virtual string GLCacheField(const RefPtr<ValuePool>&Context) const;
00087
00113 virtual RefPtr<ValueSet> CacheableVariables(const RefPtr<ValuePool>&Context) const;
00114
00119 virtual RefPtr<VBO::Renderer> createRenderer(VGLRenderContext&Context,
00120 const RefPtr<MemBase>&FieldCoordinates,
00121 const RefPtr<FragmentSelector>&FS) const;
00122
00126 virtual void updateRenderer(VGLRenderContext&Context,
00127 const RefPtr<VBO::Renderer>&R,
00128 const RefPtr<MemBase>&FieldCoordinates,
00129 const RefPtr<FragmentSelector>&FS) const;
00130
00142 virtual void setRendererParameters(VGLRenderContext&Context,
00143 const RefPtr<VBO::Renderer>&theRenderer,
00144 const RefPtr<CreativeArrayBase>&VertexCoordinates,
00145 const RefPtr<GLProgram>&theShaderProgram
00146 ) const;
00147
00148 virtual bool FunctorsAreOlderThan(const Ageable&A, const RefPtr<ValuePool>&Context) const;
00149
00150 virtual void updateFromFunctorsAge(Ageable&A, const RefPtr<ValuePool>&Context) const;
00151
00155 void renderFragments(Fiber::FragmentCluster&FC, VGLRenderContext&Context, const RefPtr<GLProgram>&myProgram) const;
00156 };
00157
00158
00159 }
00160
00161 #endif // __FRAGMENTPAINTER_HPP