VTK
vtkGLSLShaderProgram.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkGLSLShaderProgram.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 /*
16  * Copyright 2003 Sandia Corporation.
17  * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
18  * license for use of this work by or on behalf of the
19  * U.S. Government. Redistribution and use in source and binary forms, with
20  * or without modification, are permitted provided that this Notice and any
21  * statement of authorship are reproduced on all copies.
22  */
23 
38 #ifndef __vtkGLSLShaderProgram_h
39 #define __vtkGLSLShaderProgram_h
40 
41 #include "vtkShaderProgram.h"
42 
43 class vtkGLSLShader;
44 class vtkXMLDataElement;
45 class vtkRenderWindow;
46 
48 {
49 public:
51  static vtkGLSLShaderProgram *New();
52  void PrintSelf(ostream &os, vtkIndent indent);
53 
54  // .Description:
55  // Take shader from its source (file and/or string) and load, compile, and
56  // install in hardware. Also, initialize uniform variables originating from
57  // the following sources: XML material file, vtkProperty, vtkLight,
58  // vtkCamera, and application-specified uniform variables.
59  virtual void Render(vtkActor *actor, vtkRenderer *renderer);
60 
62  virtual void PostRender(vtkActor*, vtkRenderer*);
63 
67  virtual void ReleaseGraphicsResources(vtkWindow *);
68 
70 
71  unsigned int GetProgram()
72  {return this->Program;}
74 
75 protected:
77  virtual ~vtkGLSLShaderProgram();
78 
80  virtual vtkShader* NewShader();
81 
82  virtual void LoadExtensions(vtkRenderWindow*);
83 
84  unsigned int Program;
85  int IsProgram();
86  int IsLinked();
87  int IsAttached(vtkGLSLShader* shader);
88  virtual void Link();
89 
90  vtkSetStringMacro( Info );
91  vtkGetStringMacro( Info );
92  char* Info;
93  void GetProgramInfo();
94  void GetInfoLog();
95 
96 private:
97  vtkGLSLShaderProgram(const vtkGLSLShaderProgram&); // Not Implemented
98  void operator=(const vtkGLSLShaderProgram&); // Not Implemented
99 };
100 #endif //__vtkGLSLShaderProgram_h
GLSL Shader Program.
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:49
Represents an XML element and those nested inside.
abstract specification for renderers
Definition: vtkRenderer.h:69
virtual void ReleaseGraphicsResources(vtkWindow *)
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
a simple class to control print indentation
Definition: vtkIndent.h:37
virtual void PostRender(vtkActor *, vtkRenderer *)
virtual void LoadExtensions(vtkRenderWindow *)
virtual void Render(vtkActor *, vtkRenderer *)=0
virtual vtkShader * NewShader()=0
#define VTK_RENDERING_EXPORT
create a window for renderers to draw into
void PrintSelf(ostream &os, vtkIndent indent)
GLSL Shader.
Definition: vtkGLSLShader.h:87
static vtkObject * New()