VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 00005 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00006 All rights reserved. 00007 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00008 00009 This software is distributed WITHOUT ANY WARRANTY; without even 00010 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00011 PURPOSE. See the above copyright notice for more information. 00012 00013 =========================================================================*/ 00014 #ifndef vtkglVertexArrayObject_h 00015 #define vtkglVertexArrayObject_h 00016 00017 #include "vtkRenderingOpenGL2Module.h" 00018 #include <string> // For API. 00019 00020 class vtkShaderProgram; 00021 00022 namespace vtkgl 00023 { 00024 class BufferObject; 00025 00037 class VTKRENDERINGOPENGL2_EXPORT VertexArrayObject 00038 { 00039 public: 00040 VertexArrayObject(); 00041 ~VertexArrayObject(); 00042 00043 void Bind(); 00044 00045 void Release(); 00046 00047 void ReleaseGraphicsResources(); 00048 00049 void ShaderProgramChanged(); 00050 00051 bool AddAttributeArray(vtkShaderProgram *program, BufferObject &buffer, 00052 const std::string &name, int offset, size_t stride, 00053 int elementType, int elementTupleSize, bool normalize) 00054 { 00055 return this->AddAttributeArrayWithDivisor(program, buffer, name, 00056 offset,stride,elementType, elementTupleSize, normalize, 0, false); 00057 } 00058 00059 bool AddAttributeArrayWithDivisor(vtkShaderProgram *program, BufferObject &buffer, 00060 const std::string &name, int offset, size_t stride, 00061 int elementType, int elementTupleSize, bool normalize, 00062 int divisor, bool isMatrix); 00063 00064 bool AddAttributeMatrixWithDivisor(vtkShaderProgram *program, BufferObject &buffer, 00065 const std::string &name, int offset, size_t stride, 00066 int elementType, int elementTupleSize, bool normalize, 00067 int divisor); 00068 00069 bool RemoveAttributeArray(const std::string &name); 00070 00071 // Force this VAO to emulate a vertex aray object even if 00072 // the system supports VAOs. This can be useful in cases where 00073 // the vertex array object does not handle all extensions. 00074 void SetForceEmulation(bool val); 00075 00076 private: 00077 class Private; 00078 Private *d; 00079 }; 00080 00081 } // End of vtkgl namespace 00082 00083 #endif // vtkglVertexArrayObject_h 00084 00085 // VTK-HeaderTest-Exclude: vtkglVertexArrayObject.h