GteTexture3Effect.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 
11 #include <Graphics/GteTexture3.h>
13 
14 namespace gte
15 {
16 
18 {
19 public:
20  // Construction.
21  Texture3Effect(std::shared_ptr<ProgramFactory> const& factory,
22  std::shared_ptr<Texture3> const& texture, SamplerState::Filter filter,
23  SamplerState::Mode mode0, SamplerState::Mode mode1,
24  SamplerState::Mode mode2);
25 
26  // Member access.
27  inline void SetPVWMatrix(Matrix4x4<float> const& pvwMatrix);
28  inline Matrix4x4<float> const& GetPVWMatrix() const;
29 
30  // Required to bind and update resources.
31  inline std::shared_ptr<ConstantBuffer> const& GetPVWMatrixConstant() const;
32  inline std::shared_ptr<Texture3> const& GetTexture() const;
33  inline std::shared_ptr<SamplerState> const& GetSampler() const;
34 
35  void SetPVWMatrixConstant(std::shared_ptr<ConstantBuffer> const& pvwMatrix);
36 
37 private:
38  // Vertex shader parameters.
39  std::shared_ptr<ConstantBuffer> mPVWMatrixConstant;
40 
41  // Pixel shader parameters.
42  std::shared_ptr<Texture3> mTexture;
43  std::shared_ptr<SamplerState> mSampler;
44 
45  // Convenience pointer.
47 
48  // Shader source code as strings.
51  static std::string const msHLSLSource;
52  static std::string const* msVSSource[ProgramFactory::PF_NUM_API];
53  static std::string const* msPSSource[ProgramFactory::PF_NUM_API];
54 };
55 
56 
57 inline void Texture3Effect::SetPVWMatrix(Matrix4x4<float> const& pvwMatrix)
58 {
59  *mPVWMatrix = pvwMatrix;
60 }
61 
63 {
64  return *mPVWMatrix;
65 }
66 
67 inline std::shared_ptr<ConstantBuffer> const&
69 {
70  return mPVWMatrixConstant;
71 }
72 
73 inline std::shared_ptr<Texture3> const& Texture3Effect::GetTexture() const
74 {
75  return mTexture;
76 }
77 
78 inline std::shared_ptr<SamplerState> const& Texture3Effect::GetSampler() const
79 {
80  return mSampler;
81 }
82 
83 }
std::shared_ptr< SamplerState > const & GetSampler() const
static std::string const msHLSLSource
void SetPVWMatrix(Matrix4x4< float > const &pvwMatrix)
Matrix4x4< float > * mPVWMatrix
std::shared_ptr< Texture3 > mTexture
GLsizei const GLchar *const * string
Definition: glcorearb.h:809
GLuint texture
Definition: glcorearb.h:410
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glcorearb.h:1292
std::shared_ptr< SamplerState > mSampler
Matrix4x4< float > const & GetPVWMatrix() const
static std::string const msGLSLPSSource
static std::string const msGLSLVSSource
std::shared_ptr< ConstantBuffer > const & GetPVWMatrixConstant() const
std::shared_ptr< ConstantBuffer > mPVWMatrixConstant
#define GTE_IMPEXP
Definition: GTEngineDEF.h:63
std::shared_ptr< Texture3 > const & GetTexture() const


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