SimpleGL  1.1.0
A framework for platform independent rendering
Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
sgl::DebugReportCallback Class Reference

This class wraps a Vulkan debug report callback. More...

#include <debug_report.hpp>

Public Member Functions

 DebugReportCallback (void)
 Creates a debug report callback. More...
 
 ~DebugReportCallback (void)
 Destroys a debug report callback. More...
 
VkDebugReportCallbackEXT getHandle ()
 Returns the handle of the debug report callback. More...
 
virtual void invoke (std::string messageType, int messageCode, std::string message)
 This function gets called whenever a Vulkan debug report occurs. More...
 

Static Public Member Functions

static DebugReportCallbackgetCurrent ()
 Returns the current debug report callback. More...
 
static void setCurrent (DebugReportCallback *callback)
 Sets the current debug report callback. More...
 
static VkBool32 dispatch (VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char *pLayerPrefix, const char *pMessage, void *pUserData)
 Dispatches the member function. More...
 

Protected Attributes

VkDebugReportCallbackEXT handle
 The handle of the debug report callback. More...
 

Static Protected Attributes

static DebugReportCallbackcurrent = nullptr
 Stores the current instance of the debug report callback. More...
 

Detailed Description

This class wraps a Vulkan debug report callback.

Definition at line 24 of file debug_report.hpp.

Constructor & Destructor Documentation

sgl::DebugReportCallback::DebugReportCallback ( void  )

Creates a debug report callback.

Definition at line 61 of file debug_report.cpp.

sgl::DebugReportCallback::~DebugReportCallback ( void  )

Destroys a debug report callback.

Definition at line 77 of file debug_report.cpp.

Member Function Documentation

VkBool32 sgl::DebugReportCallback::dispatch ( VkDebugReportFlagsEXT  flags,
VkDebugReportObjectTypeEXT  objectType,
uint64_t  object,
size_t  location,
int32_t  messageCode,
const char *  pLayerPrefix,
const char *  pMessage,
void *  pUserData 
)
static

Dispatches the member function.

Parameters
flagsindicates the VkDebugReportFlagBitsEXT that triggered this callback.
objectTypeis a VkDebugReportObjectTypeEXT value specifying the type of object being used or created at the time the event was triggered.
objectis the object where the issue was detected. If objectType is VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, object is undefined.
locationis a component (layer, driver, loader) defined value that indicates the location of the trigger. This is an optional value.
messageCodeis a layer-defined value indicating what test triggered this callback.
pLayerPrefixis a null-terminated string that is an abbreviation of the name of the component making the callback. pLayerPrefix is only valid for the duration of the callback.
pMessageis a null-terminated string detailing the trigger conditions. pMessage is only valid for the duration of the callback.
pUserDatais the user data given when the VkDebugReportCallbackEXT was created.
Returns
a VkBool32, which is interpreted in a layer-specified manner. The application should always return VK_FALSE. The VK_TRUE value is reserved for use in layer development.

Definition at line 33 of file debug_report.cpp.

DebugReportCallback * sgl::DebugReportCallback::getCurrent ( )
static

Returns the current debug report callback.

Returns
The current debug report callback.

Definition at line 22 of file debug_report.cpp.

VkDebugReportCallbackEXT sgl::DebugReportCallback::getHandle ( )

Returns the handle of the debug report callback.

Returns
The handle of the debug report callback.

Definition at line 90 of file debug_report.cpp.

void sgl::DebugReportCallback::invoke ( std::string  messageType,
int  messageCode,
std::string  message 
)
virtual

This function gets called whenever a Vulkan debug report occurs.

Default implementation of the debug report callback.

Parameters
messageTypeThe type of the message.
messageCodeA message code.
messageMessage of the debug report.

Definition at line 95 of file debug_report.cpp.

void sgl::DebugReportCallback::setCurrent ( DebugReportCallback callback)
static

Sets the current debug report callback.

Parameters
callbackThe debug report callback to set.

Definition at line 26 of file debug_report.cpp.

Member Data Documentation

DebugReportCallback * sgl::DebugReportCallback::current = nullptr
staticprotected

Stores the current instance of the debug report callback.

Definition at line 28 of file debug_report.hpp.

VkDebugReportCallbackEXT sgl::DebugReportCallback::handle
protected

The handle of the debug report callback.

Definition at line 31 of file debug_report.hpp.


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