00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkGLSLShaderDeviceAdapter.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 =========================================================================*/ 00025 #ifndef __vtkGLSLShaderDeviceAdapter_h 00026 #define __vtkGLSLShaderDeviceAdapter_h 00027 00028 #include "vtkShaderDeviceAdapter.h" 00029 00030 class VTK_RENDERING_EXPORT vtkGLSLShaderDeviceAdapter : 00031 public vtkShaderDeviceAdapter 00032 { 00033 public: 00034 vtkTypeMacro(vtkGLSLShaderDeviceAdapter, vtkShaderDeviceAdapter); 00035 static vtkGLSLShaderDeviceAdapter *New(); 00036 virtual void PrintSelf(ostream &os, vtkIndent indent); 00037 00038 // Descrition: 00039 // This method is called before rendering. This gives the shader device 00040 // adapter an opportunity to collect information, such as attribute indices 00041 // that it will need while rendering. 00042 virtual void PrepareForRender(); 00043 00045 00056 virtual void SendAttribute(const char* attrname, 00057 int components, 00058 int type, 00059 const void *attribute, 00060 unsigned long offset=0); 00062 00063 //BTX 00064 protected: 00065 vtkGLSLShaderDeviceAdapter(); 00066 ~vtkGLSLShaderDeviceAdapter(); 00067 00068 int GetAttributeLocation(const char* attrName); 00069 00070 friend class vtkGLSLShaderProgram; 00071 00072 private: 00073 vtkGLSLShaderDeviceAdapter(const vtkGLSLShaderDeviceAdapter&); 00074 // Not implemented 00075 void operator=(const vtkGLSLShaderDeviceAdapter&); // Not implemented 00076 00077 class vtkInternal; 00078 vtkInternal* Internal; 00079 //ETX 00080 }; 00081 00082 #endif