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


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