H3D API  2.4.1
X3DProgrammableShaderObject.h
Go to the documentation of this file.
1 // Copyright 2004-2019, SenseGraphics AB
3 //
4 // This file is part of H3D API.
5 //
6 // H3D API is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
10 //
11 // H3D API is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with H3D API; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 //
20 // A commercial license is also available. Please contact us at
21 // www.sensegraphics.com for more information.
22 //
23 //
27 //
29 #ifndef __X3DPROGRAMMABLESHADEROBJECT_H__
30 #define __X3DPROGRAMMABLESHADEROBJECT_H__
31 
33 #include <H3D/RefCountMField.h>
34 #include <H3D/FieldTemplates.h>
35 
36 namespace H3D {
63  class H3DAPI_API X3DProgrammableShaderObject:
64  public H3DDynamicFieldsObject {
65  public:
68 
70  virtual bool addField( const string &name,
71  const Field::AccessType &access,
72  Field *field );
73 
75  virtual bool removeField ( const string& _name );
76 
78  virtual void clearFields();
79 
81  virtual ~X3DProgrammableShaderObject();
82 
84  static bool use_bindless_textures;
85 
86  protected:
87 
90  class UpdateTextures : public AutoUpdate< Field > {
91  public:
92  virtual ~UpdateTextures ();
93  void clearField ( Field& _field );
94 
95  protected:
96  virtual void update();
97 
98  typedef std::map < Field*, NodeVector > FieldToNodes;
99  FieldToNodes fields_to_textures;
100  };
101 
102  H3DUniquePtr < UpdateTextures > update_textures;
103 
106  };
107 }
108 
109 #endif
Contains different templates to modify field behaviour.
Header file for H3DDynamicFieldsObject.
Contains the RefCountMField class.
The Field class.
Definition: Field.h:46
AccessType
The different access types that a field can have.
Definition: Field.h:53
This abstract interface class is the base class for all classes that specify arbitrary fields.
Definition: H3DDynamicFieldsObject.h:128
For bindless textures handle the updating of the textures list of all shader fields that contain the ...
Definition: X3DProgrammableShaderObject.h:90
This abstract node type is the base type for all node types that specify arbitrary fields for interfa...
Definition: X3DProgrammableShaderObject.h:64
static bool use_bindless_textures
True if we should use bindless textures.
Definition: X3DProgrammableShaderObject.h:84
static bool use_bindless_textures_set
True if use_bindless_textures has already be set once.
Definition: X3DProgrammableShaderObject.h:105
H3D API namespace.
Definition: Anchor.h:38
The AutoUpdate field is a template to force the BaseField to update itself as soon as an event is rec...
Definition: FieldTemplates.h:130
The H3DNodeDatabase contains a mapping between a name of a Node and the constructor for the Node with...
Definition: H3DNodeDatabase.h:194