forked from stuerp/foo_vis_spectrum_analyzer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathframework.h
More file actions
76 lines (57 loc) · 1.5 KB
/
framework.h
File metadata and controls
76 lines (57 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/** $VER: framework.h (2024.08.16) P. Stuer **/
#pragma once
#include <CppCoreCheck/Warnings.h>
#pragma warning(disable: 4100 4625 4626 4710 4711 4738 5045 ALL_CPPCORECHECK_WARNINGS)
#include <SDKDDKVer.h>
#define NOMINMAX
#include <helpers/foobar2000+atl.h>
#include <helpers/helpers.h>
#undef NOMINMAX
#include <dxgi1_3.h>
#include <d3d11_2.h>
#include <d2d1_2.h>
#include <d2d1helper.h>
#include <dwrite.h>
#include <wincodec.h>
#include <stdlib.h>
#include <strsafe.h>
#include <algorithm>
#include <cmath>
#include <cassert>
#include <bit>
#include "CriticalSection.h"
#ifndef Assert
#if defined(DEBUG) || defined(_DEBUG)
#define Assert(b) do {if (!(b)) { ::OutputDebugStringA("Assert: " #b "\n");}} while(0)
#else
#define Assert(b)
#endif
#endif
#define TOSTRING_IMPL(x) #x
#define TOSTRING(x) TOSTRING_IMPL(x)
#ifndef THIS_HINSTANCE
EXTERN_C IMAGE_DOS_HEADER __ImageBase;
#define THIS_HINSTANCE ((HINSTANCE) &__ImageBase)
#endif
/// <summary>
/// A more sane way of representing a rectangle
/// </summary>
struct rect_t
{
rect_t & operator = (const D2D1_RECT_F & other) noexcept
{
*this = other;
return *this;
}
operator D2D1_RECT_F () const noexcept
{
return { x1, y1, x2, y2 };
}
D2D1_SIZE_F Size() const noexcept { return { std::abs(x1 - x2), std::abs(y1 - y2) }; }
FLOAT Width() const noexcept { return std::abs(x2 - x1); }
FLOAT Height() const noexcept { return std::abs(y2 - y1); }
FLOAT x1;
FLOAT y1;
FLOAT x2;
FLOAT y2;
};