mirror of
https://github.com/narzoul/DDrawCompat
synced 2024-12-30 08:55:36 +01:00
Additional debug info for HWND and HDC parameters
This commit is contained in:
parent
8e456eafcb
commit
8c286d21bd
@ -27,6 +27,20 @@ std::ostream& operator<<(std::ostream& os, const RECT& rect)
|
||||
return os << "R(" << rect.left << ',' << rect.top << ',' << rect.right << ',' << rect.bottom << ')';
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, HDC__& dc)
|
||||
{
|
||||
return os << "DC(" << static_cast<void*>(&dc) << ',' << WindowFromDC(&dc) << ')';
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, HWND__& hwnd)
|
||||
{
|
||||
char name[256] = {};
|
||||
GetClassName(&hwnd, name, sizeof(name));
|
||||
RECT rect = {};
|
||||
GetWindowRect(&hwnd, &rect);
|
||||
return os << "WND(" << static_cast<void*>(&hwnd) << ',' << name << ',' << rect << ')';
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const DDSCAPS& caps)
|
||||
{
|
||||
return os << "C(" << std::hex << caps.dwCaps << std::dec << ')';
|
||||
@ -74,9 +88,7 @@ std::ostream& operator<<(std::ostream& os, const DDSURFACEDESC2& sd)
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const CWPRETSTRUCT& cwrp)
|
||||
{
|
||||
RECT wr = {};
|
||||
GetWindowRect(cwrp.hwnd, &wr);
|
||||
return os << "CWRP(" << std::hex << cwrp.message << "," << cwrp.hwnd << ":" << std::dec << wr << "," <<
|
||||
return os << "CWRP(" << std::hex << cwrp.message << "," << std::dec << cwrp.hwnd << "," <<
|
||||
std::hex << cwrp.wParam << "," << cwrp.lParam << "," << cwrp.lResult << std::dec << ")";
|
||||
}
|
||||
|
||||
|
@ -16,6 +16,8 @@
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const WCHAR* wstr);
|
||||
std::ostream& operator<<(std::ostream& os, const RECT& rect);
|
||||
std::ostream& operator<<(std::ostream& os, HDC__& dc);
|
||||
std::ostream& operator<<(std::ostream& os, HWND__& hwnd);
|
||||
std::ostream& operator<<(std::ostream& os, const DDSCAPS& caps);
|
||||
std::ostream& operator<<(std::ostream& os, const DDSCAPS2& caps);
|
||||
std::ostream& operator<<(std::ostream& os, const DDPIXELFORMAT& pf);
|
||||
@ -32,7 +34,7 @@ operator<<(std::ostream& os, const T& t)
|
||||
|
||||
template <typename T>
|
||||
typename std::enable_if<std::is_class<T>::value, std::ostream&>::type
|
||||
operator<<(std::ostream& os, const T* t)
|
||||
operator<<(std::ostream& os, T* t)
|
||||
{
|
||||
return t ? (os << *t) : (os << "null");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user