GteVisualProgram.h
Go to the documentation of this file.
1 // David Eberly, Geometric Tools, Redmond WA 98052
2 // Copyright (c) 1998-2017
3 // Distributed under the Boost Software License, Version 1.0.
4 // http://www.boost.org/LICENSE_1_0.txt
5 // http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
6 // File Version: 3.0.0 (2016/06/19)
7 
8 #pragma once
9 
13 
14 namespace gte
15 {
16 
18 {
19 public:
20  // HLSL uses the class as is. GLSL derives from the class to store
21  // the shader and program handles.
22  virtual ~VisualProgram();
23  VisualProgram();
24 
25  // Member access.
26  inline std::shared_ptr<VertexShader> const& GetVShader() const;
27  inline std::shared_ptr<PixelShader> const& GetPShader() const;
28  inline std::shared_ptr<GeometryShader> const& GetGShader() const;
29 
30 public:
31  // INTERNAL USE ONLY. These are used during factory creation of shaders
32  // and programs. The graphics engines need only const-access to the
33  // shader objects.
34  inline void SetVShader(std::shared_ptr<VertexShader> const& shader);
35  inline void SetPShader(std::shared_ptr<PixelShader> const& shader);
36  inline void SetGShader(std::shared_ptr<GeometryShader> const& shader);
37 
38 private:
39  std::shared_ptr<VertexShader> mVShader;
40  std::shared_ptr<PixelShader> mPShader;
41  std::shared_ptr<GeometryShader> mGShader;
42 };
43 
44 
45 inline std::shared_ptr<VertexShader> const& VisualProgram::GetVShader() const
46 {
47  return mVShader;
48 }
49 
50 inline std::shared_ptr<PixelShader> const& VisualProgram::GetPShader() const
51 {
52  return mPShader;
53 }
54 
55 inline std::shared_ptr<GeometryShader> const& VisualProgram::GetGShader()
56  const
57 {
58  return mGShader;
59 }
60 
62  std::shared_ptr<VertexShader> const& shader)
63 {
64  mVShader = shader;
65 }
66 
68  std::shared_ptr<PixelShader> const& shader)
69 {
70  mPShader = shader;
71 }
72 
74  std::shared_ptr<GeometryShader> const& shader)
75 {
76  mGShader = shader;
77 }
78 
79 
80 }
void SetPShader(std::shared_ptr< PixelShader > const &shader)
void SetGShader(std::shared_ptr< GeometryShader > const &shader)
std::shared_ptr< PixelShader > mPShader
void SetVShader(std::shared_ptr< VertexShader > const &shader)
std::shared_ptr< VertexShader > const & GetVShader() const
GLuint shader
Definition: glcorearb.h:780
std::shared_ptr< VertexShader > mVShader
std::shared_ptr< GeometryShader > mGShader
std::shared_ptr< PixelShader > const & GetPShader() const
#define GTE_IMPEXP
Definition: GTEngineDEF.h:63
std::shared_ptr< GeometryShader > const & GetGShader() const


geometric_tools_engine
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 04:00:02