00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00025 #ifndef _Render_H_ 00026 #define _Render_H_ 00027 00028 #include <vector> 00029 00030 #include "Point.h" 00031 #include "Line.h" 00032 00033 namespace GpuQuadraticCurveRender 00034 { 00035 00036 class OpenglGpuProgram; 00037 00046 class Render 00047 { 00048 public: 00050 Render(void); 00051 00053 ~Render(void); 00054 00060 void Initialize(int width, int height); 00061 00065 void Reshape(int width, int height); 00066 00068 void BeginFrame(void); 00069 00074 void SetMaterial(float red, float green, float blue); 00075 00079 void DrawPoints(const std::vector<Point>& points); 00080 00083 void DrawLines(const std::vector<Line>& lines); 00084 00088 void DrawTriangles(const std::vector<Point>& points, const std::vector<int>& indices); 00089 00092 void DrawQuadraticSpline(const std::vector<Point>& points); 00093 00095 void EndFrame(void); 00096 00102 void UnProjectScreenPoint(const Point& screenPoint, double& x, double& y, double& z); 00103 00106 float GetPointSize(void) const; 00107 00108 private: 00110 const float m_depth; 00111 00113 const float m_pointSize; 00114 00116 const std::wstring quadraticVertexShaderFile; 00117 00119 const std::wstring quadraticPixelShaderFile; 00120 00122 OpenglGpuProgram* m_quadraticGpuProgram; 00123 00125 Render(const Render&); 00126 00128 Render& operator=(const Render&); 00129 }; 00130 00131 } 00132 00133 #endif