Blowbox 2017
A 3D Game Engine by Riko Ophorst using DirectX 12
Public Member Functions | Private Attributes | List of all members
blowbox::Shader Class Reference

#include <shader.h>

Public Member Functions

 Shader ()
 
 ~Shader ()
 
void Create (TextFile *shader_file, const ShaderType &shader_type)
 
const ShaderTypeGetShaderType () const
 
const D3D12_SHADER_BYTECODE & GetShaderByteCode () const
 
const void * GetShaderBinary () const
 
UINT GetShaderBinaryLength () const
 
const ID3DBlob * GetShaderBlob () const
 

Private Attributes

TextFileshader_file_
 
ShaderType shader_type_
 
ID3DBlob * shader_blob_
 
D3D12_SHADER_BYTECODE shader_byte_code_
 

Detailed Description

Wraps Shader objects.

Provided a TextFile, this class can compile a shader for you and make it usable throughout the rest of the engine. Call Shader::Create() and it will automatically be available for use to you.

Constructor & Destructor Documentation

blowbox::Shader::Shader ( )

Constructs a Shader.

blowbox::Shader::~Shader ( )

Destructs a Shader.

Member Function Documentation

void blowbox::Shader::Create ( TextFile shader_file,
const ShaderType shader_type 
)

Creates the actual Shader.

Parameters
[in]shader_fileThe file in which the plain-text shader code is stored.
[in]shader_typeThe type of shader that should be created out of the shader_file.
const void * blowbox::Shader::GetShaderBinary ( ) const
Returns
The raw binary for this Shader.
UINT blowbox::Shader::GetShaderBinaryLength ( ) const
Returns
The length of the raw binary for this Shader.
const ID3DBlob * blowbox::Shader::GetShaderBlob ( ) const
Returns
The underlying ID3DBlob in which this Shader is stored.
const D3D12_SHADER_BYTECODE & blowbox::Shader::GetShaderByteCode ( ) const
Returns
The bytecode for this Shader.
const ShaderType & blowbox::Shader::GetShaderType ( ) const
Returns
The type of this Shader.

Member Data Documentation

ID3DBlob* blowbox::Shader::shader_blob_
private

The underlying ID3DBlob where the Shader binary is stored in.

D3D12_SHADER_BYTECODE blowbox::Shader::shader_byte_code_
private

A D3D12 compatible shader byte code object for this Shader.

TextFile* blowbox::Shader::shader_file_
private

The TextFile that was used to compile this Shader.

ShaderType blowbox::Shader::shader_type_
private

The type of Shader this is.


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