Rework tracing system and enum creators
- Rework tracing system, now using "{}" for formatting instead of the
standard %s,%d,%f formatting that C++ uses.
- Rework enums creators to not take in namespace
- Fix single use CommandBuffers sometimes failing due to indexing them
with the current frame in flight
- Add DropEvent to Window
This commit is contained in:
@@ -6,23 +6,20 @@
|
||||
#define CP_STRINGIFY(x) #x
|
||||
#define CP_TO_STRING(x) CP_STRINGIFY(x)
|
||||
|
||||
#define CP_ENUM_CREATOR(NameSpace, EnumName, EnumList) \
|
||||
namespace NameSpace \
|
||||
{ \
|
||||
enum class EnumName \
|
||||
{ \
|
||||
EnumList \
|
||||
}; \
|
||||
static const std::string& ToString(EnumName enumName) \
|
||||
{ \
|
||||
static std::vector<std::string> enumNames = Copium::EnumPrinter::GetEnumNames(CP_TO_STRING(#EnumList)); \
|
||||
return enumNames[(int)enumName]; \
|
||||
} \
|
||||
\
|
||||
static std::ostream& operator<<(std::ostream& ostream, EnumName enumName) \
|
||||
{ \
|
||||
return ostream << ToString(enumName); \
|
||||
} \
|
||||
#define CP_ENUM_CREATOR(EnumName, ...) \
|
||||
enum class EnumName \
|
||||
{ \
|
||||
__VA_ARGS__ \
|
||||
}; \
|
||||
static const std::string& ToString(EnumName enumName) \
|
||||
{ \
|
||||
static std::vector<std::string> enumNames = Copium::EnumPrinter::GetEnumNames(CP_TO_STRING(#__VA_ARGS__)); \
|
||||
return enumNames[(int)enumName]; \
|
||||
} \
|
||||
\
|
||||
static std::ostream& operator<<(std::ostream& ostream, EnumName enumName) \
|
||||
{ \
|
||||
return ostream << ToString(enumName); \
|
||||
}
|
||||
|
||||
namespace Copium
|
||||
|
||||
Reference in New Issue
Block a user