Replaced some C casts with C++ style casts
This commit is contained in:
parent
471f592610
commit
381f568b07
3 changed files with 12 additions and 15 deletions
|
|
@ -38,9 +38,6 @@ namespace vkDebug
|
|||
const char* pMsg,
|
||||
void* pUserData)
|
||||
{
|
||||
// Message text passed in by validation layer
|
||||
std::string text(pMsg);
|
||||
|
||||
// Select prefix depending on flags passed to the callback
|
||||
// Note that multiple flags may be set for a single validation message
|
||||
std::string prefix("");
|
||||
|
|
@ -88,9 +85,9 @@ namespace vkDebug
|
|||
|
||||
void setupDebugging(VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportCallbackEXT callBack)
|
||||
{
|
||||
CreateDebugReportCallback = (PFN_vkCreateDebugReportCallbackEXT)vkGetInstanceProcAddr(instance, "vkCreateDebugReportCallbackEXT");
|
||||
DestroyDebugReportCallback = (PFN_vkDestroyDebugReportCallbackEXT)vkGetInstanceProcAddr(instance, "vkDestroyDebugReportCallbackEXT");
|
||||
dbgBreakCallback = (PFN_vkDebugReportMessageEXT)vkGetInstanceProcAddr(instance, "vkDebugReportMessageEXT");
|
||||
CreateDebugReportCallback = reinterpret_cast<PFN_vkCreateDebugReportCallbackEXT>(vkGetInstanceProcAddr(instance, "vkCreateDebugReportCallbackEXT"));
|
||||
DestroyDebugReportCallback = reinterpret_cast<PFN_vkDestroyDebugReportCallbackEXT>(vkGetInstanceProcAddr(instance, "vkDestroyDebugReportCallbackEXT"));
|
||||
dbgBreakCallback = reinterpret_cast<PFN_vkDebugReportMessageEXT>(vkGetInstanceProcAddr(instance, "vkDebugReportMessageEXT"));
|
||||
|
||||
VkDebugReportCallbackCreateInfoEXT dbgCreateInfo = {};
|
||||
dbgCreateInfo.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT;
|
||||
|
|
@ -125,11 +122,11 @@ namespace vkDebug
|
|||
|
||||
void setup(VkDevice device)
|
||||
{
|
||||
pfnDebugMarkerSetObjectTag = (PFN_vkDebugMarkerSetObjectTagEXT)vkGetDeviceProcAddr(device, "vkDebugMarkerSetObjectTagEXT");
|
||||
pfnDebugMarkerSetObjectName = (PFN_vkDebugMarkerSetObjectNameEXT)vkGetDeviceProcAddr(device, "vkDebugMarkerSetObjectNameEXT");
|
||||
pfnCmdDebugMarkerBegin = (PFN_vkCmdDebugMarkerBeginEXT)vkGetDeviceProcAddr(device, "vkCmdDebugMarkerBeginEXT");
|
||||
pfnCmdDebugMarkerEnd = (PFN_vkCmdDebugMarkerEndEXT)vkGetDeviceProcAddr(device, "vkCmdDebugMarkerEndEXT");
|
||||
pfnCmdDebugMarkerInsert = (PFN_vkCmdDebugMarkerInsertEXT)vkGetDeviceProcAddr(device, "vkCmdDebugMarkerInsertEXT");
|
||||
pfnDebugMarkerSetObjectTag = reinterpret_cast<PFN_vkDebugMarkerSetObjectTagEXT>(vkGetDeviceProcAddr(device, "vkDebugMarkerSetObjectTagEXT"));
|
||||
pfnDebugMarkerSetObjectName = reinterpret_cast<PFN_vkDebugMarkerSetObjectNameEXT>(vkGetDeviceProcAddr(device, "vkDebugMarkerSetObjectNameEXT"));
|
||||
pfnCmdDebugMarkerBegin = reinterpret_cast<PFN_vkCmdDebugMarkerBeginEXT>(vkGetDeviceProcAddr(device, "vkCmdDebugMarkerBeginEXT"));
|
||||
pfnCmdDebugMarkerEnd = reinterpret_cast<PFN_vkCmdDebugMarkerEndEXT>(vkGetDeviceProcAddr(device, "vkCmdDebugMarkerEndEXT"));
|
||||
pfnCmdDebugMarkerInsert = reinterpret_cast<PFN_vkCmdDebugMarkerInsertEXT>(vkGetDeviceProcAddr(device, "vkCmdDebugMarkerInsertEXT"));
|
||||
|
||||
// Set flag if at least one function pointer is present
|
||||
active = (pfnDebugMarkerSetObjectName != VK_NULL_HANDLE);
|
||||
|
|
|
|||
|
|
@ -1145,7 +1145,7 @@ void VulkanExampleBase::handleMessages(HWND hWnd, UINT uMsg, WPARAM wParam, LPAR
|
|||
#elif defined(__ANDROID__)
|
||||
int32_t VulkanExampleBase::handleAppInput(struct android_app* app, AInputEvent* event)
|
||||
{
|
||||
VulkanExampleBase* vulkanExample = (VulkanExampleBase*)app->userData;
|
||||
VulkanExampleBase* vulkanExample = reinterpret_cast<VulkanExampleBase*>(app->userData);
|
||||
if (AInputEvent_getType(event) == AINPUT_EVENT_TYPE_MOTION)
|
||||
{
|
||||
if (AInputEvent_getSource(event) == AINPUT_SOURCE_JOYSTICK)
|
||||
|
|
@ -1207,7 +1207,7 @@ int32_t VulkanExampleBase::handleAppInput(struct android_app* app, AInputEvent*
|
|||
void VulkanExampleBase::handleAppCommand(android_app * app, int32_t cmd)
|
||||
{
|
||||
assert(app->userData != NULL);
|
||||
VulkanExampleBase* vulkanExample = (VulkanExampleBase*)app->userData;
|
||||
VulkanExampleBase* vulkanExample = reinterpret_cast<VulkanExampleBase*>(app->userData);
|
||||
switch (cmd)
|
||||
{
|
||||
case APP_CMD_SAVE_STATE:
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
// Macro to get a procedure address based on a vulkan instance
|
||||
#define GET_INSTANCE_PROC_ADDR(inst, entrypoint) \
|
||||
{ \
|
||||
fp##entrypoint = (PFN_vk##entrypoint) vkGetInstanceProcAddr(inst, "vk"#entrypoint); \
|
||||
fp##entrypoint = reinterpret_cast<PFN_vk##entrypoint>(vkGetInstanceProcAddr(inst, "vk"#entrypoint)); \
|
||||
if (fp##entrypoint == NULL) \
|
||||
{ \
|
||||
exit(1); \
|
||||
|
|
@ -43,7 +43,7 @@
|
|||
// Macro to get a procedure address based on a vulkan device
|
||||
#define GET_DEVICE_PROC_ADDR(dev, entrypoint) \
|
||||
{ \
|
||||
fp##entrypoint = (PFN_vk##entrypoint) vkGetDeviceProcAddr(dev, "vk"#entrypoint); \
|
||||
fp##entrypoint = reinterpret_cast<PFN_vk##entrypoint>(vkGetDeviceProcAddr(dev, "vk"#entrypoint)); \
|
||||
if (fp##entrypoint == NULL) \
|
||||
{ \
|
||||
exit(1); \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue