37 lines
1.0 KiB
C++
37 lines
1.0 KiB
C++
#pragma once
|
|
|
|
#include <gz-util/exceptions.hpp>
|
|
|
|
#include <vulkan/vulkan_core.h>
|
|
|
|
#include <exception>
|
|
#include <string>
|
|
|
|
namespace gz {
|
|
/**
|
|
* @brief An error that has something to with vulkan
|
|
*/
|
|
class VkException : public Exception {
|
|
public:
|
|
VkException(const std::string& what) : Exception(what) {};
|
|
VkException(const std::string&& what, const std::string&& functionName)
|
|
: Exception(std::move(what), std::move(functionName)) {};
|
|
};
|
|
|
|
/**
|
|
* @brief A user error that has something to do with vulkan
|
|
* @details
|
|
* This error comes may come from bad function parameters
|
|
*/
|
|
class VkUserError : public VkException {
|
|
public:
|
|
VkUserError(const std::string&& what, const std::string&& functionName)
|
|
: VkException(std::move(what), std::move(functionName)) {};
|
|
};
|
|
|
|
/**
|
|
* @brief Return a VkException with a formatted string
|
|
*/
|
|
VkException getVkException(VkResult result, std::string&& what="", std::string&& functionName="");
|
|
}
|