SleakEngine 1.0.0
C++23 multi-backend game engine
Loading...
Searching...
No Matches
Sleak::RenderEngine::DirectX11Shader Class Reference

D3D11 vertex+pixel shader pair, compiled from HLSL and paired with an input layout. More...

#include <DirectX11Shader.hpp>

Inheritance diagram for Sleak::RenderEngine::DirectX11Shader:

Public Member Functions

 DirectX11Shader (ID3D11Device *device)
 ~DirectX11Shader () override
void bind () override
 Binds this program as the active shader for subsequent draws.
bool compile (const std::string &shaderPath) override
 Compiles the combined-path convention (vs_main/ps_main entry points) from a single HLSL file.
bool compile (const std::string &vertPath, const std::string &fragPath) override
 Compiles separate vertex and pixel shader HLSL files.
ID3D11InputLayout * createInputLayout ()
 Builds the input layout matching DefaultLayout or SkinnedLayout from the vertex shader bytecode.
ID3D11InputLayout * getInputLayout () const
ID3DBlob * getVertexShaderBlob () const
Public Member Functions inherited from Sleak::RenderEngine::Shader
virtual ~Shader ()=default

Detailed Description

D3D11 vertex+pixel shader pair, compiled from HLSL and paired with an input layout.

Definition at line 19 of file DirectX11Shader.hpp.

Constructor & Destructor Documentation

◆ DirectX11Shader()

Sleak::RenderEngine::DirectX11Shader::DirectX11Shader ( ID3D11Device * device)

Definition at line 15 of file DirectX11Shader.cpp.

◆ ~DirectX11Shader()

Sleak::RenderEngine::DirectX11Shader::~DirectX11Shader ( )
override

Definition at line 20 of file DirectX11Shader.cpp.

Member Function Documentation

◆ bind()

void Sleak::RenderEngine::DirectX11Shader::bind ( )
overridevirtual

Binds this program as the active shader for subsequent draws.

Implements Sleak::RenderEngine::Shader.

Definition at line 61 of file DirectX11Shader.cpp.

◆ compile() [1/2]

bool Sleak::RenderEngine::DirectX11Shader::compile ( const std::string & shaderPath)
overridevirtual

Compiles the combined-path convention (vs_main/ps_main entry points) from a single HLSL file.

Implements Sleak::RenderEngine::Shader.

Definition at line 24 of file DirectX11Shader.cpp.

◆ compile() [2/2]

bool Sleak::RenderEngine::DirectX11Shader::compile ( const std::string & vertPath,
const std::string & fragPath )
overridevirtual

Compiles separate vertex and pixel shader HLSL files.

Implements Sleak::RenderEngine::Shader.

Definition at line 42 of file DirectX11Shader.cpp.

◆ createInputLayout()

ID3D11InputLayout * Sleak::RenderEngine::DirectX11Shader::createInputLayout ( )

Builds the input layout matching DefaultLayout or SkinnedLayout from the vertex shader bytecode.

Definition at line 76 of file DirectX11Shader.cpp.

◆ getInputLayout()

ID3D11InputLayout * Sleak::RenderEngine::DirectX11Shader::getInputLayout ( ) const
inline

Definition at line 34 of file DirectX11Shader.hpp.

◆ getVertexShaderBlob()

ID3DBlob * Sleak::RenderEngine::DirectX11Shader::getVertexShaderBlob ( ) const

Definition at line 72 of file DirectX11Shader.cpp.