#include <map>
+#ifdef __APPLE__
+#include <OpenGL/gl.h>
+#else
#include <GL/gl.h>
+#endif
#include <vtkSmartPointer.h>
#define MAPPER_SUPERCLASS vtkMesaPolyDataMapper
#endif
-#ifndef GL_ARB_shader_objects
-typedef GLuint GLhandleARB;
-#endif
-
+#include "VTKViewer_OpenGLHelper.h"
//----------------------------------------------------------------------------
//! OpenGL Point Sprites PolyData Mapper.
//! Implement superclass render method.
virtual void RenderPiece( vtkRenderer*, vtkActor* );
-
//! Draw method for OpenGL.
+#ifndef VTK_OPENGL2
virtual int Draw( vtkRenderer*, vtkActor* );
+#else
+ virtual void RenderPieceDraw( vtkRenderer*, vtkActor* );
+#endif
protected:
VTKViewer_PolyDataMapper();
void InitTextures();
//! Initializing of the Vertex Shader.
- void InitShader();
+ int InitShader();
+
+ void InternalDraw(vtkRenderer*, vtkActor*);
private:
int ExtensionsInitialized;
GLuint PointSpriteTexture;
vtkSmartPointer<vtkImageData> ImageData;
-
- GLhandleARB VertexProgram;
+
+ VTKViewer_OpenGLHelper OpenGLHelper;
+ GLhandleARB PointProgram;
+#ifdef VTK_OPENGL2
+ GLhandleARB VertexShader;
+ GLhandleARB FragmentShader;
+ GLuint VertexArrayObject;
+#endif
+
+ struct Locations {
+ static const GLint INVALID_LOCATION = -1;
+
+ GLint ModelViewProjection;
+ GLint Projection;
+ GLint GeneralPointSize;
+ GLint PointSprite;
+
+ Locations()
+ : ModelViewProjection (INVALID_LOCATION),
+ Projection (INVALID_LOCATION),
+ GeneralPointSize (INVALID_LOCATION),
+ PointSprite (INVALID_LOCATION)
+ {
+ //
+ }
+ } myLocations;
bool MarkerEnabled;
- bool BallEnabled;
+ bool BallEnabled;
double BallScale;
VTK::MarkerType MarkerType;
VTK::MarkerScale MarkerScale;