GteConstantColorEffect.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.1 (2016/11/13)
7 
8 #pragma once
9 
12 
13 namespace gte
14 {
15 
17 {
18 public:
19  // Construction.
20  ConstantColorEffect(std::shared_ptr<ProgramFactory> const& factory, Vector4<float> const& color);
21 
22  // Member access.
23  inline void SetPVWMatrix(Matrix4x4<float> const& pvwMatrix);
24  inline Matrix4x4<float> const& GetPVWMatrix() const;
25 
26  // Required to bind and update resources.
27  inline std::shared_ptr<ConstantBuffer> const& GetPVWMatrixConstant() const;
28  inline std::shared_ptr<ConstantBuffer> const& GetColorConstant() const;
29 
30  void SetPVWMatrixConstant(std::shared_ptr<ConstantBuffer> const& pvwMatrix);
31 
32 private:
33  // Vertex shader parameters.
34  std::shared_ptr<ConstantBuffer> mPVWMatrixConstant;
35  std::shared_ptr<ConstantBuffer> mColorConstant;
36 
37  // Convenience pointers.
40 
41  // Shader source code as strings.
44  static std::string const msHLSLSource;
45  static std::string const* msVSSource[ProgramFactory::PF_NUM_API];
46  static std::string const* msPSSource[ProgramFactory::PF_NUM_API];
47 };
48 
49 
51 {
52  *mPVWMatrix = pvwMatrix;
53 }
54 
56 {
57  return *mPVWMatrix;
58 }
59 
60 inline std::shared_ptr<ConstantBuffer> const& ConstantColorEffect::GetPVWMatrixConstant() const
61 {
62  return mPVWMatrixConstant;
63 }
64 
65 inline std::shared_ptr<ConstantBuffer> const& ConstantColorEffect::GetColorConstant() const
66 {
67  return mColorConstant;
68 }
69 
70 }
GLuint color
Definition: glcorearb.h:1256
static std::string const msGLSLVSSource
std::shared_ptr< ConstantBuffer > mPVWMatrixConstant
Matrix4x4< float > * mPVWMatrix
std::shared_ptr< ConstantBuffer > mColorConstant
GLsizei const GLchar *const * string
Definition: glcorearb.h:809
static std::string const msGLSLPSSource
std::shared_ptr< ConstantBuffer > const & GetPVWMatrixConstant() const
Matrix4x4< float > const & GetPVWMatrix() const
void SetPVWMatrix(Matrix4x4< float > const &pvwMatrix)
std::shared_ptr< ConstantBuffer > const & GetColorConstant() const
static std::string const msHLSLSource
#define GTE_IMPEXP
Definition: GTEngineDEF.h:63


geometric_tools_engine
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 03:59:59