GteFluid3UpdateState.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 
14 #include <Graphics/GteTexture3.h>
15 
16 namespace gte
17 {
18 
19 class GraphicsEngine;
20 
22 {
23 public:
24  // Construction.
25  Fluid3UpdateState(std::shared_ptr<ProgramFactory> const& factory,
26  int xSize, int ySize, int zSize, int numXThreads, int numYThreads, int numZThreads,
27  std::shared_ptr<ConstantBuffer> const& parameters);
28 
29  // Member access. The texels are (velocity.xyz, density).
30  inline std::shared_ptr<Texture3> const& GetUpdateState() const;
31 
32  // Update the state for the fluid simulation.
33  void Execute(std::shared_ptr<GraphicsEngine> const& engine,
34  std::shared_ptr<Texture3> const& source,
35  std::shared_ptr<Texture3> const& stateTm1,
36  std::shared_ptr<Texture3> const& stateT);
37 
38 private:
39  int mNumXGroups, mNumYGroups, mNumZGroups;
40  std::shared_ptr<ComputeProgram> mComputeUpdateState;
41  std::shared_ptr<SamplerState> mAdvectionSampler;
42  std::shared_ptr<Texture3> mUpdateState;
43 
44  // Shader source code as strings.
45  static std::string const msGLSLSource;
46  static std::string const msHLSLSource;
47  static std::string const* msSource[ProgramFactory::PF_NUM_API];
48 };
49 
50 inline std::shared_ptr<Texture3> const& Fluid3UpdateState::GetUpdateState() const
51 {
52  return mUpdateState;
53 }
54 
55 }
std::shared_ptr< ComputeProgram > mComputeUpdateState
static std::string const msHLSLSource
std::shared_ptr< SamplerState > mAdvectionSampler
std::shared_ptr< Texture3 > mUpdateState
static std::string const msGLSLSource
GLsizei GLsizei GLchar * source
Definition: glcorearb.h:798
GLsizei const GLchar *const * string
Definition: glcorearb.h:809
std::shared_ptr< Texture3 > const & GetUpdateState() const
#define GTE_IMPEXP
Definition: GTEngineDEF.h:63


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