-
Notifications
You must be signed in to change notification settings - Fork 0
/
pch.h
59 lines (45 loc) · 1.28 KB
/
pch.h
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
#pragma once
#include "mytypes.h"
#include <filesystem>
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
#include <cassert>
#include <queue>
#include <map>
#include <unordered_map>
#include <memory>
#include <cmath> // abs
#include <cstddef> // offsetof, NULL
#include <cstring> // memcpy
#include <functional>
#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <SFML/OpenGL.hpp>
#include <SFML/Config.hpp>
// TODO(dan): compatibility with Box2D >= 2.4.0
#include "Box2D/Box2D.h"
#include "imgui-SFML.h"
#include "imgui.h"
//#include <glm/glm.hpp>
#define BUILD_DEBUG
#ifdef BUILD_DEBUG
#define DEBUG_GUI(x) g_gui_callbacks.push_back(x);
#else
#define DEBUG_GUI(x)
#endif
extern std::vector<std::function<void(void)>> g_gui_callbacks;
// conversion functions
constexpr f64 PIXELS_PER_METER = 32.0;
constexpr f64 PI = 3.14159265358979323846;
template<typename T>
constexpr T pixelsToMeters(const T& x) { return x / PIXELS_PER_METER; };
template<typename T>
constexpr T metersToPixels(const T& x) { return x * PIXELS_PER_METER; };
template<typename T>
constexpr T degToRad(const T& x) { return PI * x / 180.f; }
template<typename T>
constexpr T radToDeg(const T& x) { return 180.f * x / PI; };