Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Burger::Effect Class Reference

Base class for shader effects. More...

Inheritance diagram for Burger::Effect:
Collaboration diagram for Burger::Effect:

Public Member Functions

const Burger::StaticRTTIget_StaticRTTI (void) const noexcept override
 Get the description to the class.
 
 Effect ()
 Standard constructor.
 
virtual ~Effect ()
 Standard destructor.
 
virtual void Release (Display *pDisplay) override
 Release the shaders.
 
D3DPixelShader * GetPixelShader360 (void) const
 Get the pointer to the Xbox 360 Pixel shader instance.
 
D3DVertexShader * GetVertexShader360 (void) const
 Get the pointer to the Xbox 360 Vertex shader instance.
 
D3DDevice * GetDevice360 (void) const
 Get the pointer to the Xbox 360 device instance.
 
uint_t GetProgramID (void) const
 Get the OpenGL program ID for the compiled effect.
 
IDirect3DPixelShader9 * GetPixelShaderDX9 (void) const
 Get the pointer to the DirectX 9 Pixel shader instance.
 
IDirect3DVertexShader9 * GetVertexShaderDX9 (void) const
 Get the pointer to the DirectX 9 Vertex shader instance.
 
IDirect3DDevice9 * GetDeviceDX9 (void) const
 Get the pointer to the DirectX 9 device instance.
 
- Public Member Functions inherited from Burger::DisplayObject
DisplayObjectGetNext (void) const
 Get the next display object in the global linked list.
 
DisplayObjectGetPrevious (void) const
 Get the previous display object in the global linked list.
 
virtual uint_t CheckLoad (Display *pDisplay)=0
 Load data onto the video display card.
 
- Public Member Functions inherited from Burger::ReferenceCounter
const Burger::StaticRTTIget_StaticRTTI (void) const noexcept override
 Get the description to the class.
 
 ReferenceCounter () noexcept
 Sets the reference count to zero.
 
virtual ~ReferenceCounter ()
 Destructor.
 
void AddRef (void) noexcept
 Increase the reference count by 1.
 
void Release (void) noexcept
 Decrease the reference count by 1.
 
- Public Member Functions inherited from Burger::Base
const char * get_class_name (void) const noexcept
 Get the name of the class.
 
virtual ~Base () noexcept=default
 Destructor.
 

Static Public Attributes

static const Burger::StaticRTTI g_StaticRTTI
 The global description of the class.
 
- Static Public Attributes inherited from Burger::DisplayObject
static const Burger::StaticRTTI g_StaticRTTI
 The global description of the class.
 
- Static Public Attributes inherited from Burger::ReferenceCounter
static const Burger::StaticRTTI g_StaticRTTI
 The global description of the class.
 
- Static Public Attributes inherited from Burger::Base
static const Burger::StaticRTTI g_StaticRTTI
 The global description of the class.
 

Protected Member Functions

void ReleaseGL (void)
 Release the OpenGL data.
 
void ReleaseDX9 (void)
 Release the DirectX 9 data.
 
- Protected Member Functions inherited from Burger::DisplayObject
 DisplayObject (void)
 Add this display object to the global linked list.
 
virtual ~DisplayObject ()
 Remove this display object from the global linked list.
 

Protected Attributes

D3DPixelShader * m_pPixelShader
 (Xbox360 only) Pixel shader
 
D3DVertexShader * m_pVertexShader
 (Xbox360 only) Vertex shader
 
D3DDevice * m_pDevice
 (Xbox360 only) parent device
 
union { 
 
   struct { 
 
      IDirect3DPixelShader9 *   m_pPixelShader 
 DirectX9 Pixel shader. More...
 
      IDirect3DVertexShader9 *   m_pVertexShader 
 DirectX9 Vertex shader. More...
 
      IDirect3DDevice9 *   m_pDevice 
 DirectX9 parent device. More...
 
   }   m_DX9 
 DirectX 9 specific data. More...
 
   struct { 
 
      uint_t   m_uProgramID 
 OpenGL Program ID for the compiled shader. More...
 
   }   m_GL 
 OpenGL specific data. More...
 
m_ShaderData 
 Union of vertex/pixel shader data.
 
- Protected Attributes inherited from Burger::DisplayObject
DisplayObjectm_pNextDisplayObject
 Pointer to the next DisplayObject.
 
DisplayObjectm_pPrevDisplayObject
 Pointer to the previous DisplayObject.
 

Private Member Functions

 Effect (const Effect &)=delete
 
Effectoperator= (const Effect &)=delete
 
 Effect (Effect &&)=delete
 
Effectoperator= (Effect &&)=delete
 

Additional Inherited Members

- Static Public Member Functions inherited from Burger::DisplayObject
static DisplayObjectGetFirstObject (void)
 Get the first display object in the global linked list.
 
static void ReleaseAll (Display *pDisplay)
 Release all display objects.
 
- Static Protected Attributes inherited from Burger::DisplayObject
static DisplayObjectg_pHead = NULL
 Global pointer to the linked list of display objects.
 

Detailed Description

Base class for shader effects.


This base class has default members and functions to connect a vertex and pixel shader using a cross platform API with this class performing the functions to implement the class using whatever is the native API.

Note
On Windows platforms, this is a union with data for DirectX 9, DirectX 11 and OpenGL
See also
Display

Constructor & Destructor Documentation

◆ Effect() [1/3]

Burger::Effect::Effect ( const Effect & )
privatedelete

◆ Effect() [2/3]

Burger::Effect::Effect ( Effect && )
privatedelete

◆ Effect() [3/3]

Burger::Effect::Effect ( )

Standard constructor.


Only initializes member variables to NULL.

◆ ~Effect()

Burger::Effect::~Effect ( )
virtual

Standard destructor.


Calls Release(Display *) to release all allocated resources

Member Function Documentation

◆ get_StaticRTTI()

const Burger::StaticRTTI * Burger::Effect::get_StaticRTTI ( void ) const
overridevirtualnoexcept

Get the description to the class.


This virtual function will pull the pointer to the StaticRTTI instance that has the name of the class. Due to it being virtual, it will be the name of the most derived class.

Returns
Pointer to a global, read only instance of StaticRTTI for the true class

Reimplemented from Burger::DisplayObject.

Reimplemented in Burger::Effect2D, Burger::Effect2DDX9, Burger::Effect2DOpenGL, Burger::EffectPositionColorTexture, Burger::EffectPositionColorTextureDX9, Burger::EffectPositionColorTextureOpenGL, Burger::EffectPositionTexture, Burger::EffectPositionTextureDX9, Burger::EffectPositionTextureOpenGL, Burger::Shader2DCColor, Burger::Shader2DCColorDX9, Burger::Shader2DCColorOpenGL, Burger::Shader2DColorVertex, Burger::Shader2DColorVertexDX9, and Burger::Shader2DColorVertexOpenGL.

◆ GetDevice360()

D3DDevice * Burger::Effect::GetDevice360 ( void ) const
inline

Get the pointer to the Xbox 360 device instance.


Note
This is only available on Xbox 360
Returns
NULL if no device is used, a valid D3DDevice if CheckLoad() was called

◆ GetDeviceDX9()

IDirect3DDevice9 * Burger::Effect::GetDeviceDX9 ( void ) const
inline

Get the pointer to the DirectX 9 device instance.


Note
This is only available on Windows
Returns
NULL if no device is used, a valid IDirect3DDevice9 if CheckLoad() was called

◆ GetPixelShader360()

D3DPixelShader * Burger::Effect::GetPixelShader360 ( void ) const
inline

Get the pointer to the Xbox 360 Pixel shader instance.


Note
This is only available on Xbox 360
Returns
NULL if no pixel shader is used, a valid D3DPixelShader if CheckLoad() was called

◆ GetPixelShaderDX9()

IDirect3DPixelShader9 * Burger::Effect::GetPixelShaderDX9 ( void ) const
inline

Get the pointer to the DirectX 9 Pixel shader instance.


Note
This is only available on Windows
Returns
NULL if no pixel shader is used, a valid IDirect3DPixelShader9 if CheckLoad() was called

◆ GetProgramID()

uint_t Burger::Effect::GetProgramID ( void ) const
inline

Get the OpenGL program ID for the compiled effect.


Returns
Zero if no effect was compiled, non-zero if CheckLoad() was called

◆ GetVertexShader360()

D3DVertexShader * Burger::Effect::GetVertexShader360 ( void ) const
inline

Get the pointer to the Xbox 360 Vertex shader instance.


Note
This is only available on Xbox 360
Returns
NULL if no vertex shader is used, a valid D3DVertexShader if CheckLoad() was called

◆ GetVertexShaderDX9()

IDirect3DVertexShader9 * Burger::Effect::GetVertexShaderDX9 ( void ) const
inline

Get the pointer to the DirectX 9 Vertex shader instance.


Note
This is only available on Windows
Returns
NULL if no vertex shader is used, a valid IDirect3DVertexShader9 if CheckLoad() was called

◆ operator=() [1/2]

Effect & Burger::Effect::operator= ( const Effect & )
privatedelete

◆ operator=() [2/2]

Effect & Burger::Effect::operator= ( Effect && )
privatedelete

◆ Release()

void Burger::Effect::Release ( Display * pDisplay)
overridevirtual

◆ ReleaseDX9()

void BURGER_API Burger::Effect::ReleaseDX9 ( void )
protected

Release the DirectX 9 data.


For DirectX 9 shaders, Release(Display *) calls this function to perform the actual work

Note
This is only available on Windows

◆ ReleaseGL()

void BURGER_API Burger::Effect::ReleaseGL ( void )
protected

Release the OpenGL data.


For OpenGL shaders, Release(Display *) calls this function to perform the actual work

Note
This is only available on Windows

Member Data Documentation

◆ g_StaticRTTI

const Burger::StaticRTTI Burger::Effect::g_StaticRTTI
static

The global description of the class.


This record contains the name of this class and a reference to the parent

◆ [struct]

struct { ... } Burger::Effect::m_DX9

DirectX 9 specific data.

◆ [struct]

struct { ... } Burger::Effect::m_GL

OpenGL specific data.

◆ m_pDevice [1/2]

D3DDevice* Burger::Effect::m_pDevice
protected

(Xbox360 only) parent device

◆ m_pDevice [2/2]

IDirect3DDevice9* Burger::Effect::m_pDevice

DirectX9 parent device.

◆ m_pPixelShader [1/2]

D3DPixelShader* Burger::Effect::m_pPixelShader
protected

(Xbox360 only) Pixel shader

◆ m_pPixelShader [2/2]

IDirect3DPixelShader9* Burger::Effect::m_pPixelShader

DirectX9 Pixel shader.

◆ m_pVertexShader [1/2]

D3DVertexShader* Burger::Effect::m_pVertexShader
protected

(Xbox360 only) Vertex shader

◆ m_pVertexShader [2/2]

IDirect3DVertexShader9* Burger::Effect::m_pVertexShader

DirectX9 Vertex shader.

◆ [union]

union { ... } Burger::Effect::m_ShaderData

Union of vertex/pixel shader data.

◆ m_uProgramID

uint_t Burger::Effect::m_uProgramID

OpenGL Program ID for the compiled shader.