4a535d3f |
1 | // Created on: 2016-02-19 |
2 | // Created by: Kirill Gavrilov |
3 | // Copyright (c) 2016 OPEN CASCADE SAS |
4 | // |
5 | // This file is part of Open CASCADE Technology software library. |
6 | // |
7 | // This library is free software; you can redistribute it and/or modify it under |
8 | // the terms of the GNU Lesser General Public License version 2.1 as published |
9 | // by the Free Software Foundation, with special exception defined in the file |
10 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
11 | // distribution for complete text of the license and disclaimer of any warranty. |
12 | // |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
15 | |
16 | #ifndef _Graphic3d_ShaderAttribute_HeaderFile |
17 | #define _Graphic3d_ShaderAttribute_HeaderFile |
18 | |
19 | #include <Standard_Transient.hxx> |
20 | #include <TCollection_AsciiString.hxx> |
21 | |
22 | //! Describes custom vertex shader attribute. |
23 | class Graphic3d_ShaderAttribute : public Standard_Transient |
24 | { |
25 | public: |
26 | |
27 | //! Creates new attribute. |
28 | Standard_EXPORT Graphic3d_ShaderAttribute (const TCollection_AsciiString& theName, |
29 | const int theLocation); |
30 | |
31 | //! Destructor. |
32 | Standard_EXPORT virtual ~Graphic3d_ShaderAttribute(); |
33 | |
34 | //! Returns name of shader variable. |
35 | const TCollection_AsciiString& Name() const |
36 | { |
37 | return myName; |
38 | } |
39 | |
40 | //! Returns attribute location to be bound on GLSL program linkage stage. |
41 | int Location() const |
42 | { |
43 | return myLocation; |
44 | } |
45 | |
46 | protected: |
47 | |
48 | TCollection_AsciiString myName; //!< attribute name |
49 | int myLocation; //!< attribute location |
50 | |
51 | public: |
52 | |
53 | DEFINE_STANDARD_RTTIEXT(Graphic3d_ShaderAttribute,Standard_Transient) |
54 | |
55 | }; |
56 | |
57 | DEFINE_STANDARD_HANDLE (Graphic3d_ShaderAttribute, Standard_Transient) |
58 | |
59 | #endif // _Graphic3d_ShaderAttribute_HeaderFile |