VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkGLSLShaderDeviceAdapter2.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00022 #ifndef __vtkGLSLShaderDeviceAdapter2_h 00023 #define __vtkGLSLShaderDeviceAdapter2_h 00024 00025 #include "vtkShaderDeviceAdapter2.h" 00026 00027 class vtkShaderProgram2; 00028 00029 class VTK_RENDERING_EXPORT vtkGLSLShaderDeviceAdapter2 00030 : public vtkShaderDeviceAdapter2 00031 { 00032 public: 00033 vtkTypeMacro(vtkGLSLShaderDeviceAdapter2, vtkShaderDeviceAdapter2); 00034 static vtkGLSLShaderDeviceAdapter2 *New(); 00035 virtual void PrintSelf(ostream &os, vtkIndent indent); 00036 00037 // Descrition: 00038 // This method is called before rendering. This gives the shader device 00039 // adapter an opportunity to collect information, such as attribute indices 00040 // that it will need while rendering. 00041 virtual void PrepareForRender(); 00042 00044 00055 virtual void SendAttribute(const char* attrname, 00056 int components, 00057 int type, 00058 const void *attribute, 00059 unsigned long offset=0); 00061 00062 //BTX 00064 00066 void SetShaderProgram(vtkShaderProgram2 *program); 00067 vtkGetObjectMacro(ShaderProgram, vtkShaderProgram2); 00069 00070 protected: 00071 vtkGLSLShaderDeviceAdapter2(); 00072 ~vtkGLSLShaderDeviceAdapter2(); 00073 00074 int GetAttributeLocation(const char* attrName); 00075 00076 vtkShaderProgram2 *ShaderProgram; 00077 00078 private: 00079 vtkGLSLShaderDeviceAdapter2(const vtkGLSLShaderDeviceAdapter2&); 00080 // Not implemented 00081 void operator=(const vtkGLSLShaderDeviceAdapter2&); // Not implemented 00082 00083 class vtkInternal; 00084 vtkInternal* Internal; 00085 //ETX 00086 }; 00087 00088 #endif