PixelBullet  0.0.1
A C++ game engine
Loading...
Searching...
No Matches
pixelbullet::Graphics Class Reference

Module that manages the Vulkan instance_, Surface, Window and the renderpass structure. More...

#include <graphics.h>

Public Types

enum class  PrepareFrameOutcome { Skipped , Rebuilt , Ready }
 
enum class  RenderFrameOutcome { Skipped , Rendered }
 
enum class  FrameOutcome { Skipped , Rebuilt , Rendered }
 

Public Member Functions

 Graphics (const ApplicationSpecification &specification, Window &window)
 
PrepareFrameOutcome PrepareFrame ()
 
RenderFrameOutcome RenderPreparedFrame ()
 
FrameOutcome Update ()
 
void WaitIdle () const
 
void CaptureScreenshot (const std::filesystem::path &filename, std::size_t id=0) const
 
RendererGetRenderer () const
 
void SetRenderer (std::unique_ptr< Renderer > &&renderer)
 
const RenderDeviceGetRenderDevice () const
 
RenderDeviceGetRenderDevice ()
 
const RenderStageGetRenderStage (uint32_t index) const
 
const DescriptorGetAttachment (const std::string &name) const
 
const RenderTarget2DGetRenderTarget (const std::string &name) const
 
void SetFramebufferResized (std::size_t id)
 
const WindowGetWindow () const
 
WindowGetWindow ()
 

Static Public Member Functions

static std::string StringifyResultVk (VkResult result)
 
static void CheckVk (VkResult result)
 

Friends

class RenderDevice
 
class RenderDevice::InternalAccess
 

Detailed Description

Module that manages the Vulkan instance_, Surface, Window and the renderpass structure.

Member Function Documentation

◆ CaptureScreenshot()

void pixelbullet::Graphics::CaptureScreenshot ( const std::filesystem::path & filename,
std::size_t id = 0 ) const

Takes a screenshot of the current image of the display and saves it into a image file.

Parameters
filenameThe file to save the screenshot as.

◆ GetRenderer()

Renderer * pixelbullet::Graphics::GetRenderer ( ) const
inline

Gets the current renderer.

Returns
The renderer.

◆ SetRenderer()

void pixelbullet::Graphics::SetRenderer ( std::unique_ptr< Renderer > && renderer)

Sets the current renderer to a new renderer.

Parameters
rendererThe new renderer.

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