• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

dox/Rendering/vtkGLSLShader.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkGLSLShader.h,v $
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 =========================================================================*/
00015 /*
00016  * Copyright 2003 Sandia Corporation.
00017  * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00018  * license for use of this work by or on behalf of the
00019  * U.S. Government. Redistribution and use in source and binary forms, with
00020  * or without modification, are permitted provided that this Notice and any
00021  * statement of authorship are reproduced on all copies.
00022  */
00023 
00073 #ifndef __vtkGLSLShader_h
00074 #define __vtkGLSLShader_h
00075 
00076 #include "vtkShader.h"
00077 
00078 class vtkActor;
00079 class vtkRenderer;
00080 class vtkProperty;
00081 class vtkLight;
00082 class vtkCamera;
00083 class vtkRenderWindow;
00084 
00085 // Manages all shaders defined in the XML file
00086 // especially the part about sending things to the card
00087 class VTK_RENDERING_EXPORT vtkGLSLShader : public vtkShader
00088 {
00089 public:
00090   static vtkGLSLShader *New();
00091   vtkTypeRevisionMacro(vtkGLSLShader, vtkShader);
00092   void PrintSelf(ostream &os, vtkIndent indent);
00093   
00098   virtual int Compile();
00099 
00101   unsigned int GetHandle() { return this->Shader; }
00102 
00104 
00106   vtkSetMacro( Program, unsigned int );
00107   vtkGetMacro( Program, unsigned int );
00109 
00113   virtual void ReleaseGraphicsResources(vtkWindow *);
00114 protected:
00115   vtkGLSLShader();
00116   virtual ~vtkGLSLShader();
00117 
00118   // These are GLuints.
00119   unsigned int Program;
00120   unsigned int Shader;
00121 
00122   int IsShader();
00123   int IsCompiled();
00124 
00126   void LoadShader();
00127 
00129 
00130   virtual void SetUniformParameter(const char* name, int numValues, const int* value);
00131   virtual void SetUniformParameter(const char* name, int numValues, const float* value);
00132   virtual void SetUniformParameter(const char* name, int numValues, const double* value);
00134 
00136 
00137   virtual void SetMatrixParameter(const char* name, int numValues, 
00138     int order, const float* value);
00139   virtual void SetMatrixParameter(const char* name, int numValues, 
00140     int order, const double* value);
00141   virtual void SetMatrixParameter(const char* name, const char* state_matix_type,
00142     const char* transform_type);
00144 
00145   virtual void SetSamplerParameter(const char* name, vtkTexture* texture,
00146                                    int textureIndex);
00147 private:
00148   vtkGLSLShader(const vtkGLSLShader&); // Not Implemented
00149   void operator=(const vtkGLSLShader&); // Not Implemented
00150 
00151   int GetUniformLocation( const char* name );
00152 };
00153 #endif //__vtkGLSLShader_h

Generated by  doxygen 1.7.1