# Khaotic Engine Reborn: skybox_shader_class Class Reference

Loading...
Searching...
No Matches
skybox_shader_class Class Reference

## Public Member Functions

| skybox_shader_class (const skybox_shader_class &)
bool | Initialize (ID3D11Device *, HWND)
void | Shutdown ()
bool | Render (ID3D11DeviceContext *, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView *, XMFLOAT4, XMFLOAT4, XMFLOAT3, float)

## Detailed Description

Definition at line 11 of file skybox_shader_class.h.

## Constructor & Destructor Documentation

## skybox_shader_class() [1/2]

skybox_shader_class::skybox_shader_class | ( |  | ) |

Definition at line 7 of file skybox_shader_class.cpp.

{
m_vertexShader = 0;
m_pixelShader = 0;
m_layout = 0;
m_sampleState = 0;
m_matrixBuffer = 0;
m_cameraBuffer = 0;
m_sunlightBuffer = 0;
m_sunlightColorBuffer = 0;
m_sunlightPositionBuffer = 0;
}

## skybox_shader_class() [2/2]

skybox_shader_class::skybox_shader_class | ( | const skybox_shader_class & | other | ) |

Definition at line 21 of file skybox_shader_class.cpp.

{
}

## ~skybox_shader_class()

skybox_shader_class::~skybox_shader_class | ( |  | ) |

Definition at line 26 of file skybox_shader_class.cpp.

{
}

## Member Function Documentation

## Initialize()

bool skybox_shader_class::Initialize | ( | ID3D11Device * | device,
|  | HWND | hwnd )

Definition at line 31 of file skybox_shader_class.cpp.

{
Logger::Get().Log("Initializing LightShaderClass", __FILE__, __LINE__, Logger::LogLevel::Initialize);
wchar_t vsFilename[128];
wchar_t psFilename[128];
int error;
bool result;
// Set the filename of the vertex shader.
error = wcscpy_s(vsFilename, 128, L"src/hlsl/skybox.vs");
if (error != 0)
{
Logger::Get().Log("Failed to copy string", __FILE__, __LINE__, Logger::LogLevel::Error);
return false;
}
// Set the filename of the pixel shader.
error = wcscpy_s(psFilename, 128, L"src/hlsl/skybox.ps");
if (error != 0)
{
Logger::Get().Log("Failed to copy string", __FILE__, __LINE__, Logger::LogLevel::Error);
return false;
}
// Initialize the vertex and pixel shaders.
result = InitializeShader(device, hwnd, vsFilename, psFilename);
if (!result)
{
Logger::Get().Log("Failed to initialize shader", __FILE__, __LINE__, Logger::LogLevel::Error);
return false;
}
Logger::Get().Log("skybox_shader_class initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize);
return true;
}

## Render()

bool skybox_shader_class::Render | ( | ID3D11DeviceContext * | deviceContext,
|  | int | indexCount,
|  | XMMATRIX | worldMatrix,
|  | XMMATRIX | viewMatrix,
|  | XMMATRIX | projectionMatrix,
|  | ID3D11ShaderResourceView * | texture,
|  | XMFLOAT4 | diffuseColor,
|  | XMFLOAT4 | ambientColor,
|  | XMFLOAT3 | sunDirection,
|  | float | sunIntensity )

Definition at line 77 of file skybox_shader_class.cpp.

{
bool result;
// Set the shader parameters that it will use for rendering.
result = SetShaderParameters(deviceContext, worldMatrix, viewMatrix, projectionMatrix, texture, diffuseColor, ambientColor, sunDirection, sunIntensity);
if (!result)
{
Logger::Get().Log("Failed to set shader parameters", __FILE__, __LINE__, Logger::LogLevel::Error);
return false;
}
// Now render the prepared buffers with the shader.
RenderShader(deviceContext, indexCount);
return true;
}

## Shutdown()

void skybox_shader_class::Shutdown | ( |  | ) |

Definition at line 69 of file skybox_shader_class.cpp.

{
// Shutdown the vertex and pixel shaders as well as the related objects.
ShutdownShader();
return;
}

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

- enginecustom/src/inc/shader/skybox_shader_class.h
- enginecustom/src/src/shader/skybox_shader_class.cpp