My Project
Loading...
Searching...
No Matches
Engine::D3D11 Class Reference

Wrapper class responsible for initializing and managing Direct3D 11. Handles device creation, swap chain, rendering targets, and draw calls. More...

#include <D3D11.hpp>

Public Member Functions

 D3D11 (IWindow &window)
 Constructs the D3D11 renderer using the provided window.
 D3D11 (const D3D11 &other)=delete
 Disable copy constructor.
D3D11operator= (const D3D11 &other)=delete
 Disable assignment operator.
 ~D3D11 ()=default
 Default destructor.
void Present ()
 Presents the swap chain to the screen (displays the rendered frame).
void ClearBackBuffer (float r, float g, float b) noexcept
 Clears the back buffer with the specified color.
void SetViewProjection (const Maths::Mat4f &vp)
 Updates the view-projection matrix used by the shaders.
ID3D11Device * GetDevice () const noexcept
 Returns the D3D11 device.
ID3D11DeviceContext * GetContext () const noexcept
 Returns the D3D11 device context.
IDXGISwapChain * GetSwapChain () const noexcept
 Returns the swap chain.
ID3D11RenderTargetView * GetRenderTargetView () const noexcept
 Returns the render target view.
void DrawShape (const MeshAsset &mesh, const Material &material)
 Draws a mesh using the provided material.

Detailed Description

Wrapper class responsible for initializing and managing Direct3D 11. Handles device creation, swap chain, rendering targets, and draw calls.

Constructor & Destructor Documentation

◆ D3D11() [1/2]

Engine::D3D11::D3D11 ( IWindow & window)

Constructs the D3D11 renderer using the provided window.

Parameters
windowWindow interface used to retrieve the native handle

◆ D3D11() [2/2]

Engine::D3D11::D3D11 ( const D3D11 & other)
delete

Disable copy constructor.

◆ ~D3D11()

Engine::D3D11::~D3D11 ( )
default

Default destructor.

Member Function Documentation

◆ ClearBackBuffer()

void Engine::D3D11::ClearBackBuffer ( float r,
float g,
float b )
noexcept

Clears the back buffer with the specified color.

Parameters
rRed component
gGreen component
bBlue component

◆ DrawShape()

void Engine::D3D11::DrawShape ( const MeshAsset & mesh,
const Material & material )

Draws a mesh using the provided material.

Parameters
meshMesh asset containing vertex/index buffers
materialMaterial containing textures and parameters

◆ GetContext()

ID3D11DeviceContext * Engine::D3D11::GetContext ( ) const
inlinenoexcept

Returns the D3D11 device context.

◆ GetDevice()

ID3D11Device * Engine::D3D11::GetDevice ( ) const
inlinenoexcept

Returns the D3D11 device.

◆ GetRenderTargetView()

ID3D11RenderTargetView * Engine::D3D11::GetRenderTargetView ( ) const
inlinenoexcept

Returns the render target view.

◆ GetSwapChain()

IDXGISwapChain * Engine::D3D11::GetSwapChain ( ) const
inlinenoexcept

Returns the swap chain.

◆ operator=()

D3D11 & Engine::D3D11::operator= ( const D3D11 & other)
delete

Disable assignment operator.

◆ Present()

void Engine::D3D11::Present ( )

Presents the swap chain to the screen (displays the rendered frame).

◆ SetViewProjection()

void Engine::D3D11::SetViewProjection ( const Maths::Mat4f & vp)

Updates the view-projection matrix used by the shaders.

Parameters
vpViewProjection matrix

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