Fling Engine  0.00.1
Fling Engine is a game engine written in Vulkan
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
Fling::Instance Class Reference

The instance is a representation of this application graphics instance in Vulkan. More...

#include <Instance.h>

Inherits Fling::NonCopyable.

Public Member Functions

 Instance ()
 
 ~Instance ()
 
const VkInstance & GetRawVkInstance () const
 
bool IsValidationEnabled () const
 
UINT32 EnabledValidationLayerCount () const
 
const std::vector< const char * > & GetEnabledValidationLayers () const
 
const std::vector< const char * > & GetEnabledExtensions () const
 

Private Member Functions

void CreateInstance ()
 Create the VkInstance of this object and application information. More...
 
std::vector< const char * > GetRequiredExtensions ()
 
bool CheckValidationLayerSupport ()
 
VkResult CreateDebugUtilsMessengerEXT (VkInstance instance, const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDebugUtilsMessengerEXT *pDebugMessenger)
 
void DestroyDebugUtilsMessengerEXT (VkInstance instance, VkDebugUtilsMessengerEXT debugMessenger, const VkAllocationCallbacks *pAllocator)
 
void SetupDebugMessages ()
 Create a debug message callback from vulkan and allow us to log errors from it. More...
 
- Private Member Functions inherited from Fling::NonCopyable
 NonCopyable (const NonCopyable &)=delete
 
 NonCopyable (NonCopyable &&)=default
 
NonCopyableoperator= (const NonCopyable &)=delete
 
NonCopyableoperator= (NonCopyable &&)=default
 
 NonCopyable ()=default
 
virtual ~NonCopyable ()=default
 

Static Private Member Functions

static VKAPI_ATTR VkBool32 VKAPI_CALL DebugCallback (VkDebugUtilsMessageSeverityFlagBitsEXT t_messageSeverity, VkDebugUtilsMessageTypeFlagsEXT t_messageType, const VkDebugUtilsMessengerCallbackDataEXT *t_CallbackData, void *t_UserData)
 

Private Attributes

VkInstance m_Instance = VK_NULL_HANDLE
 The Vulkan instance. More...
 
VkDebugUtilsMessengerEXT m_DebugMessenger = VK_NULL_HANDLE
 Debug message handler for Vulkan. More...
 
UINT8 m_EnableValidationLayers: 1
 If this instance has validation layers enabled. More...
 
const std::vector< const char * > m_ValidationLayers
 The validation layers that we want to look for on this instance. More...
 
const std::vector< const char * > m_DeviceExtensions
 Device extension support for the swap chain. More...
 

Detailed Description

The instance is a representation of this application graphics instance in Vulkan.

Constructor & Destructor Documentation

◆ Instance()

Fling::Instance::Instance ( )
explicit

◆ ~Instance()

Fling::Instance::~Instance ( )

Member Function Documentation

◆ CheckValidationLayerSupport()

bool Fling::Instance::CheckValidationLayerSupport ( )
private

◆ CreateDebugUtilsMessengerEXT()

VkResult Fling::Instance::CreateDebugUtilsMessengerEXT ( VkInstance  instance,
const VkDebugUtilsMessengerCreateInfoEXT *  pCreateInfo,
const VkAllocationCallbacks *  pAllocator,
VkDebugUtilsMessengerEXT *  pDebugMessenger 
)
private

◆ CreateInstance()

void Fling::Instance::CreateInstance ( )
private

Create the VkInstance of this object and application information.

◆ DebugCallback()

VKAPI_ATTR VkBool32 VKAPI_CALL Fling::Instance::DebugCallback ( VkDebugUtilsMessageSeverityFlagBitsEXT  t_messageSeverity,
VkDebugUtilsMessageTypeFlagsEXT  t_messageType,
const VkDebugUtilsMessengerCallbackDataEXT *  t_CallbackData,
void *  t_UserData 
)
staticprivate

◆ DestroyDebugUtilsMessengerEXT()

void Fling::Instance::DestroyDebugUtilsMessengerEXT ( VkInstance  instance,
VkDebugUtilsMessengerEXT  debugMessenger,
const VkAllocationCallbacks *  pAllocator 
)
private

◆ EnabledValidationLayerCount()

UINT32 Fling::Instance::EnabledValidationLayerCount ( ) const
inline

◆ GetEnabledExtensions()

const std::vector<const char*>& Fling::Instance::GetEnabledExtensions ( ) const
inline

◆ GetEnabledValidationLayers()

const std::vector<const char*>& Fling::Instance::GetEnabledValidationLayers ( ) const
inline

◆ GetRawVkInstance()

const VkInstance& Fling::Instance::GetRawVkInstance ( ) const
inline

◆ GetRequiredExtensions()

std::vector< const char * > Fling::Instance::GetRequiredExtensions ( )
private

◆ IsValidationEnabled()

bool Fling::Instance::IsValidationEnabled ( ) const
inline

◆ SetupDebugMessages()

void Fling::Instance::SetupDebugMessages ( )
private

Create a debug message callback from vulkan and allow us to log errors from it.

See also
Instance::DebugCallback

Field Documentation

◆ m_DebugMessenger

VkDebugUtilsMessengerEXT Fling::Instance::m_DebugMessenger = VK_NULL_HANDLE
private

Debug message handler for Vulkan.

◆ m_DeviceExtensions

const std::vector<const char*> Fling::Instance::m_DeviceExtensions
private
Initial value:
=
{
VK_KHR_SWAPCHAIN_EXTENSION_NAME
}

Device extension support for the swap chain.

◆ m_EnableValidationLayers

UINT8 Fling::Instance::m_EnableValidationLayers
private

If this instance has validation layers enabled.

This is read from the config file. Default to false if no config

◆ m_Instance

VkInstance Fling::Instance::m_Instance = VK_NULL_HANDLE
private

The Vulkan instance.

◆ m_ValidationLayers

const std::vector<const char*> Fling::Instance::m_ValidationLayers
private
Initial value:
=
{
"VK_LAYER_LUNARG_standard_validation"
}

The validation layers that we want to look for on this instance.


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