All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
glslProgram.h
1 //
2 // Copyright 2017 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 
26 
27 
28 #ifndef __PX_VP20_GLSL_PROGRAM_H__
29 #define __PX_VP20_GLSL_PROGRAM_H__
30 
31 #include "pxr/pxr.h"
32 #include "px_vp20/api.h"
33 #include "pxr/imaging/garch/gl.h"
34 
35 #include <string>
36 
37 
38 PXR_NAMESPACE_OPEN_SCOPE
39 
40 
47 {
48  public:
49  PX_VP20_API
51  PX_VP20_API
52  virtual ~PxrMayaGLSLProgram();
53 
55  PX_VP20_API
56  bool CompileShader(const GLenum type, const std::string& source);
57 
59  PX_VP20_API
60  bool Link();
61 
63  PX_VP20_API
64  bool Validate() const;
65 
67  GLuint GetProgramId() const {
68  return mProgramId;
69  };
70 
71  private:
72  GLuint mProgramId;
73 };
74 
75 
76 PXR_NAMESPACE_CLOSE_SCOPE
77 
78 
79 #endif // __PX_VP20_GLSL_PROGRAM_H__
PX_VP20_API bool CompileShader(const GLenum type, const std::string &source)
Compile a shader of type type with the given source.
PX_VP20_API bool Validate() const
Validate whether this program is valid in the current context.
GLuint GetProgramId() const
Get the ID of the OpenGL program object.
Definition: glslProgram.h:67
A convenience class that abstracts away the OpenGL API details of compiling and linking GLSL shaders ...
Definition: glslProgram.h:46
PX_VP20_API bool Link()
Link the compiled shaders together.