![]() |
Blamite Game Engine - blam!
00296.01.12.21.0102.blamite
The core library for the Blamite Game Engine.
|
Namespace containing functions exclusive to DirectX. More...
Namespaces | |
D2D | |
Namespace containing functions relating to Direct2D. | |
Drawing | |
Namespace containing functions to handle the drawing of Direct2D primitives. | |
Utils | |
Namespace containing various utilities related to rendering. | |
WIC | |
Namespace containing functions relating to the Windows Imaging Component (WIC). | |
Functions | |
BLAM ID3D11Device * | GetD3DDevice () |
Retrieves the current Direct3D device. More... | |
BLAM ID3D11DeviceContext * | GetD3DContext () |
Retrieves the current Direct3D context. More... | |
BLAM IDXGISwapChain * | GetDXGISwapChain () |
Retrieves the current DXGI Swap Chain. More... | |
BLAM ID3D11RenderTargetView * | GetD3DRenderTargetView () |
Retrieves the current Direct3D Render Target. More... | |
BLAM DXGI_SWAP_CHAIN_DESC | GetSwapChainDesc () |
Retrieves the current Direct3D Swap Chain description. More... | |
BLAM HRESULT | Initialize (HWND hWnd) |
Initializes DirectX 11. More... | |
BLAM void | Cleanup () |
Cleans up all DirectX data. More... | |
BLAM HRESULT | HandleWindowResize (LPARAM lParam) |
Handles a window resize event. More... | |
BLAM bool * | RenderTargetClearing () |
Retrieves whether or not to enable render target clearing. More... | |
BLAM void | RenderLoop (bool debug) |
Renders everything to the screen. More... | |
BLAM void | ShutdownRenderThread () |
Instructs the rendering thread to stop running. More... | |
BLAM void | RenderThread (bool debug) |
Instructs the engine to start rendering on a separate thread. More... | |
BLAM bool | HasRenderThreadStopped () |
Determines whether or not the render thread has finished stopping. More... | |
BLAM void | SetClearColor (ImVec4 color) |
Changes the color to used to clear the render target. More... | |
BLAM ImVec4 * | GetClearColor () |
Retrieves the current color used to clear the render target. More... | |
BLAM HRESULT | UpdateResolution (int x, int y) |
Changes the DirectX render target resolution. More... | |
BLAM ID3D11Texture2D ** | GetLastFrameTexture () |
Retrieves the last frame that was rendered. More... | |
BLAM HRESULT | GetLastFrameTextureAlt (ID3D11Texture2D *texture) |
Retrieves the last frame that was rendered. More... | |
BLAM void | ScreenshotDone () |
Informs DirectX that the screenshot has finished being captured. More... | |
BLAM HRESULT | GetLastFrameHResult () |
Unused. More... | |
BLAM void | DisplayDetailedCrashScreen (const char *expression, const char *file, int line, std::string details) |
Displays a detailed engine crash screen. More... | |
BLAM void | DisplayBasicCrashScreen () |
Displays a basic engine crash screen. More... | |
BLAM void | DisplaySignalCrashScreen (int signal) |
Displays a signal-based engine crash screen. More... | |
Namespace containing functions exclusive to DirectX.
void BlamRendering::DirectX::Cleanup | ( | ) |
void BlamRendering::DirectX::DisplayBasicCrashScreen | ( | ) |
Displays a basic engine crash screen.
After being displayed, the engine will try to upload files to Sentry and then exit.
void BlamRendering::DirectX::DisplayDetailedCrashScreen | ( | const char * | expression, |
const char * | file, | ||
int | line, | ||
std::string | details | ||
) |
Displays a detailed engine crash screen.
After being displayed, the engine will try to upload files to Sentry and then exit.
expression | - The expression that caused the assertion failure. |
file | - The file that caused the assertion failure. |
line | - The line number in the file that caused the failure. |
details | - Additional details regarding the crash. |
void BlamRendering::DirectX::DisplaySignalCrashScreen | ( | int | signal | ) |
Displays a signal-based engine crash screen.
After being displayed, the engine will try to upload files to Sentry and then exit.
ImVec4 * BlamRendering::DirectX::GetClearColor | ( | ) |
Retrieves the current color used to clear the render target.
ID3D11DeviceContext * BlamRendering::DirectX::GetD3DContext | ( | ) |
Retrieves the current Direct3D context.
ID3D11Device * BlamRendering::DirectX::GetD3DDevice | ( | ) |
Retrieves the current Direct3D device.
ID3D11RenderTargetView * BlamRendering::DirectX::GetD3DRenderTargetView | ( | ) |
Retrieves the current Direct3D Render Target.
IDXGISwapChain * BlamRendering::DirectX::GetDXGISwapChain | ( | ) |
Retrieves the current DXGI Swap Chain.
The swap chain contains two buffers, that alternate back and forth between being written to and being presented onscreen. While one buffer is being displayed, the other is written to. When the buffer being written is finished being modified, it is displayed - and the other buffer starts being written to.
HRESULT BlamRendering::DirectX::GetLastFrameHResult | ( | ) |
Unused.
ID3D11Texture2D ** BlamRendering::DirectX::GetLastFrameTexture | ( | ) |
Retrieves the last frame that was rendered.
HRESULT BlamRendering::DirectX::GetLastFrameTextureAlt | ( | ID3D11Texture2D * | texture | ) |
Retrieves the last frame that was rendered.
DXGI_SWAP_CHAIN_DESC BlamRendering::DirectX::GetSwapChainDesc | ( | ) |
Retrieves the current Direct3D Swap Chain description.
HRESULT BlamRendering::DirectX::HandleWindowResize | ( | LPARAM | lParam | ) |
Handles a window resize event.
This function will resize the DirectX render target to match the window size upon resizing.
lParam | - The LPARAM from the WM_RESIZE message. Contains the new information for the window size. |
S_OK
if the render target was resized successfully, otherwise will return an error code. bool BlamRendering::DirectX::HasRenderThreadStopped | ( | ) |
Determines whether or not the render thread has finished stopping.
This should always be checked against before beginning DirectX shutdown, otherwise resources will be disposed while still in use.
HRESULT BlamRendering::DirectX::Initialize | ( | HWND | hWnd | ) |
Initializes DirectX 11.
This function will call all needed functions to load Direct3D, Direct2D, and the Windows Imaging Component. As such, calling those initialize functions directly is not required.
hWnd | - The window handle for DirectX to render to. |
S_OK
if DirectX initialized successfully, otherwise will return an error code. void BlamRendering::DirectX::RenderLoop | ( | bool | debug | ) |
Renders everything to the screen.
debug | - Legcay parameter enabling or disabling the crash screen display. |
bool * BlamRendering::DirectX::RenderTargetClearing | ( | ) |
Retrieves whether or not to enable render target clearing.
void BlamRendering::DirectX::RenderThread | ( | bool | debug | ) |
Instructs the engine to start rendering on a separate thread.
This function replaecs the BlamRendering::DirectX::RenderLoop function entirely.
while()
loop, and will block the thread it is called on until BlamRendering::DirectX::ShutdownRenderThread is called.debug | - Legcay parameter enabling or disabling the crash screen display. |
void BlamRendering::DirectX::ScreenshotDone | ( | ) |
Informs DirectX that the screenshot has finished being captured.
For screenshots, the entire rendering process must be halted to avoid the saved screenshot being incomplete. This function is used at the end of the screenshot function to unlock the render loop.
void BlamRendering::DirectX::SetClearColor | ( | ImVec4 | color | ) |
Changes the color to used to clear the render target.
color | - The new color to use for render target clearing. |
void BlamRendering::DirectX::ShutdownRenderThread | ( | ) |
Instructs the rendering thread to stop running.
false
, a boolean which is used in a while loop for the thread. HRESULT BlamRendering::DirectX::UpdateResolution | ( | int | x, |
int | y | ||
) |
Changes the DirectX render target resolution.
x | - The new width to render the screen at. |
y | - The new height to render the screen at. |
S_OK
if the resolution was updated, otherwise will contain an error code.