Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
gte::OverlayEffect Class Reference

#include <GteOverlayEffect.h>

Classes

struct  Vertex
 

Public Member Functions

bool Contains (int x, int y) const
 
std::shared_ptr< VisualEffect > const & GetEffect () const
 
std::shared_ptr< IndexBuffer > const & GetIndexBuffer () const
 
std::array< int, 4 > GetOverlayRectangle () const
 
std::shared_ptr< VisualProgram > const & GetProgram () const
 
std::array< int, 4 > GetTextureRectangle () const
 
std::shared_ptr< VertexBuffer > const & GetVertexBuffer () const
 
 OverlayEffect (std::shared_ptr< ProgramFactory > const &factory, int windowWidth, int windowHeight, int textureWidth, int textureHeight, SamplerState::Filter filter, SamplerState::Mode mode0, SamplerState::Mode mode1, bool useColorPShader)
 
 OverlayEffect (std::shared_ptr< ProgramFactory > const &factory, int windowWidth, int windowHeight, int textureWidth, int textureHeight, std::string const &psSource)
 
void SetOverlayRectangle (std::array< int, 4 > const &rectangle)
 
void SetRectangles (std::array< int, 4 > const &overlayRectangle, std::array< int, 4 > const &textureRectangle)
 
void SetTexture (std::shared_ptr< Texture2 > const &texture)
 
void SetTexture (std::string const &textureName, std::shared_ptr< Texture2 > const &texture)
 
void SetTextureRectangle (std::array< int, 4 > const &rectangle)
 

Protected Member Functions

void Initialize (int windowWidth, int windowHeight, int textureWidth, int textureHeight)
 
void UpdateVertexBuffer ()
 

Protected Attributes

std::shared_ptr< VisualEffectmEffect
 
int mFactoryAPI
 
std::shared_ptr< IndexBuffermIBuffer
 
float mInvTextureHeight
 
float mInvTextureWidth
 
std::array< int, 4 > mOverlayRectangle
 
std::shared_ptr< VisualProgrammProgram
 
std::array< int, 4 > mTextureRectangle
 
std::shared_ptr< VertexBuffermVBuffer
 
float mWindowHeight
 
float mWindowWidth
 

Static Protected Attributes

static std::string const msGLSLPSColorSource
 
static std::string const msGLSLPSGraySource
 
static std::string const msGLSLVSSource
 
static std::string const msHLSLPSColorSource
 
static std::string const msHLSLPSGraySource
 
static std::string const msHLSLVSSource
 
static std::string const * msPSColorSource [ProgramFactory::PF_NUM_API]
 
static std::string const * msPSGraySource [ProgramFactory::PF_NUM_API]
 
static std::string const * msVSSource [ProgramFactory::PF_NUM_API]
 

Detailed Description

Definition at line 21 of file GteOverlayEffect.h.

Constructor & Destructor Documentation

OverlayEffect::OverlayEffect ( std::shared_ptr< ProgramFactory > const &  factory,
int  windowWidth,
int  windowHeight,
int  textureWidth,
int  textureHeight,
SamplerState::Filter  filter,
SamplerState::Mode  mode0,
SamplerState::Mode  mode1,
bool  useColorPShader 
)

Definition at line 13 of file GteOverlayEffect.cpp.

OverlayEffect::OverlayEffect ( std::shared_ptr< ProgramFactory > const &  factory,
int  windowWidth,
int  windowHeight,
int  textureWidth,
int  textureHeight,
std::string const &  psSource 
)

Definition at line 40 of file GteOverlayEffect.cpp.

Member Function Documentation

bool OverlayEffect::Contains ( int  x,
int  y 
) const

Definition at line 71 of file GteOverlayEffect.cpp.

std::shared_ptr< VisualEffect > const & gte::OverlayEffect::GetEffect ( ) const
inline

Definition at line 152 of file GteOverlayEffect.h.

std::shared_ptr< IndexBuffer > const & gte::OverlayEffect::GetIndexBuffer ( ) const
inline

Definition at line 146 of file GteOverlayEffect.h.

std::array< int, 4 > gte::OverlayEffect::GetOverlayRectangle ( ) const
inline

Definition at line 123 of file GteOverlayEffect.h.

std::shared_ptr< VisualProgram > const & gte::OverlayEffect::GetProgram ( ) const
inline

Definition at line 134 of file GteOverlayEffect.h.

std::array< int, 4 > gte::OverlayEffect::GetTextureRectangle ( ) const
inline

Definition at line 128 of file GteOverlayEffect.h.

std::shared_ptr< VertexBuffer > const & gte::OverlayEffect::GetVertexBuffer ( ) const
inline

Definition at line 140 of file GteOverlayEffect.h.

void OverlayEffect::Initialize ( int  windowWidth,
int  windowHeight,
int  textureWidth,
int  textureHeight 
)
protected

Definition at line 100 of file GteOverlayEffect.cpp.

void gte::OverlayEffect::SetOverlayRectangle ( std::array< int, 4 > const &  rectangle)
inline

Definition at line 116 of file GteOverlayEffect.h.

void OverlayEffect::SetRectangles ( std::array< int, 4 > const &  overlayRectangle,
std::array< int, 4 > const &  textureRectangle 
)

Definition at line 63 of file GteOverlayEffect.cpp.

void OverlayEffect::SetTexture ( std::shared_ptr< Texture2 > const &  texture)

Definition at line 79 of file GteOverlayEffect.cpp.

void OverlayEffect::SetTexture ( std::string const &  textureName,
std::shared_ptr< Texture2 > const &  texture 
)

Definition at line 91 of file GteOverlayEffect.cpp.

void OverlayEffect::SetTextureRectangle ( std::array< int, 4 > const &  rectangle)

Definition at line 57 of file GteOverlayEffect.cpp.

void OverlayEffect::UpdateVertexBuffer ( )
protected

Definition at line 144 of file GteOverlayEffect.cpp.

Member Data Documentation

std::shared_ptr<VisualEffect> gte::OverlayEffect::mEffect
protected

Definition at line 101 of file GteOverlayEffect.h.

int gte::OverlayEffect::mFactoryAPI
protected

Definition at line 95 of file GteOverlayEffect.h.

std::shared_ptr<IndexBuffer> gte::OverlayEffect::mIBuffer
protected

Definition at line 99 of file GteOverlayEffect.h.

float gte::OverlayEffect::mInvTextureHeight
protected

Definition at line 94 of file GteOverlayEffect.h.

float gte::OverlayEffect::mInvTextureWidth
protected

Definition at line 94 of file GteOverlayEffect.h.

std::array<int,4> gte::OverlayEffect::mOverlayRectangle
protected

Definition at line 96 of file GteOverlayEffect.h.

std::shared_ptr<VisualProgram> gte::OverlayEffect::mProgram
protected

Definition at line 100 of file GteOverlayEffect.h.

std::string const OverlayEffect::msGLSLPSColorSource
staticprotected
Initial value:
=
"uniform sampler2D imageSampler;\n"
"\n"
"layout(location = 0) in vec2 vertexTCoord;\n"
"layout(location = 0) out vec4 pixelColor;\n"
"\n"
"void main()\n"
"{\n"
" pixelColor = texture(imageSampler, vertexTCoord);\n"
"}\n"

Definition at line 105 of file GteOverlayEffect.h.

std::string const OverlayEffect::msGLSLPSGraySource
staticprotected
Initial value:
=
"uniform sampler2D imageSampler;\n"
"\n"
"layout(location = 0) in vec2 vertexTCoord;\n"
"layout(location = 0) out vec4 pixelColor;\n"
"\n"
"void main()\n"
"{\n"
" float gray = texture(imageSampler, vertexTCoord).r;\n"
" pixelColor = vec4(gray, gray, gray, 1.0f);\n"
"}\n"

Definition at line 106 of file GteOverlayEffect.h.

std::string const OverlayEffect::msGLSLVSSource
staticprotected
Initial value:
=
"layout(location = 0) in vec3 modelPosition;\n"
"layout(location = 1) in vec2 modelTCoord;\n"
"layout(location = 0) out vec2 vertexTCoord;\n"
"\n"
"void main()\n"
"{\n"
" vertexTCoord = modelTCoord;\n"
" gl_Position.x = 2.0f*modelPosition.x - 1.0f;\n"
" gl_Position.y = -2.0f*modelPosition.y + 1.0f;\n"
" gl_Position.z = -1.0f;\n"
" gl_Position.w = 1.0f;\n"
"}\n"

Definition at line 104 of file GteOverlayEffect.h.

std::string const OverlayEffect::msHLSLPSColorSource
staticprotected
Initial value:
=
"Texture2D<float4> imageTexture;\n"
"SamplerState imageSampler;\n"
"\n"
"struct PS_INPUT\n"
"{\n"
" float2 vertexTCoord : TEXCOORD0;\n"
"};\n"
"\n"
"struct PS_OUTPUT\n"
"{\n"
" float4 pixelColor0 : SV_TARGET0;\n"
"};\n"
"\n"
"PS_OUTPUT PSMain(PS_INPUT input)\n"
"{\n"
" PS_OUTPUT output;\n"
" output.pixelColor0 = imageTexture.Sample(imageSampler, input.vertexTCoord);\n"
" return output;\n"
"}\n"

Definition at line 108 of file GteOverlayEffect.h.

std::string const OverlayEffect::msHLSLPSGraySource
staticprotected
Initial value:
=
"Texture2D<float> imageTexture;\n"
"SamplerState imageSampler;\n"
"\n"
"struct PS_INPUT\n"
"{\n"
" float2 vertexTCoord : TEXCOORD0;\n"
"};\n"
"\n"
"struct PS_OUTPUT\n"
"{\n"
" float4 pixelColor0 : SV_TARGET0;\n"
"};\n"
"\n"
"PS_OUTPUT PSMain(PS_INPUT input)\n"
"{\n"
" PS_OUTPUT output;\n"
" float gray = imageTexture.Sample(imageSampler, input.vertexTCoord);\n"
" output.pixelColor0 = float4(gray, gray, gray, 1.0f);\n"
" return output;\n"
"}\n"

Definition at line 109 of file GteOverlayEffect.h.

std::string const OverlayEffect::msHLSLVSSource
staticprotected
Initial value:
=
"struct VS_INPUT\n"
"{\n"
" float2 modelPosition : POSITION;\n"
" float2 modelTCoord : TEXCOORD0;\n"
"};\n"
"\n"
"struct VS_OUTPUT\n"
"{\n"
" float2 vertexTCoord : TEXCOORD0;\n"
" float4 clipPosition : SV_POSITION;\n"
"};\n"
"\n"
"VS_OUTPUT VSMain (VS_INPUT input)\n"
"{\n"
" VS_OUTPUT output;\n"
" output.clipPosition.x = 2.0f*input.modelPosition.x - 1.0f;\n"
" output.clipPosition.y = -2.0f*input.modelPosition.y + 1.0f;\n"
" output.clipPosition.z = 0.0f;\n"
" output.clipPosition.w = 1.0f;\n"
" output.vertexTCoord = input.modelTCoord;\n"
" return output;\n"
"}\n"

Definition at line 107 of file GteOverlayEffect.h.

std::string const * OverlayEffect::msPSColorSource
staticprotected
Initial value:

Definition at line 111 of file GteOverlayEffect.h.

std::string const * OverlayEffect::msPSGraySource
staticprotected
Initial value:

Definition at line 112 of file GteOverlayEffect.h.

std::string const * OverlayEffect::msVSSource
staticprotected
Initial value:

Definition at line 110 of file GteOverlayEffect.h.

std::array<int,4> gte::OverlayEffect::mTextureRectangle
protected

Definition at line 97 of file GteOverlayEffect.h.

std::shared_ptr<VertexBuffer> gte::OverlayEffect::mVBuffer
protected

Definition at line 98 of file GteOverlayEffect.h.

float gte::OverlayEffect::mWindowHeight
protected

Definition at line 93 of file GteOverlayEffect.h.

float gte::OverlayEffect::mWindowWidth
protected

Definition at line 93 of file GteOverlayEffect.h.


The documentation for this class was generated from the following files:


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