TazGraph Project v0.1.0
Loading...
Searching...
No Matches
pch.h
1// pch.h: This is a precompiled header file.
2// Files listed below are compiled only once, improving build performance for future builds.
3// This also affects IntelliSense performance, including code completion and many code browsing features.
4// However, files listed here are ALL re-compiled if any one of them is updated between builds.
5// Do not add files here that you will be updating frequently as this negates the performance advantage.
6
7#ifndef PCH_H
8#define PCH_H
9
10
11#include <iostream>
12#include <string>
13#include <ctime>
14
15#include <unordered_map>
16#include <memory>
17#include <map>
18#include <vector>
19#include <fstream>
20
21// add headers that you want to pre-compile here
22//#include "framework.h"
23#define GLM_ENABLE_EXPERIMENTAL
24#include "GL/glew.h"
25#include "glm/glm.hpp"
26#include "glm/gtc/matrix_transform.hpp"
27#include <glm/gtx/rotate_vector.hpp>
28#include "glm/gtc/type_ptr.hpp"
29
30#include <imgui.h>
31
32#include <SDL2/SDL.h>
33
34#include <tracy/public/tracy/Tracy.hpp>
35
36//namespace TracyAligned {
37//
38//#if defined(_WIN32) || defined(__CYGWIN__)
39//#include <malloc.h>
40// inline void* aligned_alloc(size_t alignment, size_t size) {
41// return _aligned_malloc(size, alignment);
42// }
43// inline void aligned_free(void* ptr) {
44// _aligned_free(ptr);
45// }
46//#elif defined(__linux__) || defined(__APPLE__)
47//#include <stdlib.h>
48// inline void* aligned_alloc(size_t alignment, size_t size) {
49// void* ptr = nullptr;
50// if (posix_memalign(&ptr, alignment, size) != 0) {
51// return nullptr;
52// }
53// return ptr;
54// }
55// inline void aligned_free(void* ptr) {
56// free(ptr);
57// }
58//#else
59// inline void* aligned_alloc(size_t alignment, size_t size) {
60// size_t extra = alignment - 1 + sizeof(void*);
61// void* original = malloc(size + extra);
62// if (!original) return nullptr;
63//
64// void* ptr = reinterpret_cast<void*>(
65// (reinterpret_cast<uintptr_t>(original) + extra) & ~(alignment - 1));
66// reinterpret_cast<void**>(ptr)[-1] = original;
67// return ptr;
68// }
69//
70// inline void aligned_free(void* ptr) {
71// if (!ptr) return;
72// void* original = reinterpret_cast<void**>(ptr)[-1];
73// free(original);
74// }
75//#endif
76//
77// // Tracy-profiled aligned allocation
78// inline void* tracy_aligned_alloc(size_t size, size_t alignment) {
79// void* ptr = aligned_alloc(alignment, size);
80//#ifdef TRACY_ENABLE
81// if (ptr) {
82// TracyAlloc(ptr, size);
83// }
84//#endif
85// return ptr;
86// }
87//
88// inline void tracy_aligned_free(void* ptr) {
89// if (!ptr) return;
90//#ifdef TRACY_ENABLE
91// TracyFree(ptr);
92//#endif
93// aligned_free(ptr);
94// }
95//}
96//
98//inline void* operator new(size_t size, std::align_val_t al) {
99// return TracyAligned::tracy_aligned_alloc(size, static_cast<size_t>(al));
100//}
101//
102//inline void* operator new[](size_t size, std::align_val_t al) {
103// return operator new(size, al);
104//}
105//
106//inline void* operator new(size_t size) {
107//#ifdef TRACY_ENABLE
108// void* ptr = std::malloc(size);
109// TracyAlloc(ptr, size);
110// return ptr;
111//#else
112// return std::malloc(size);
113//#endif
114//}
115//
116//inline void operator delete(void* ptr, std::align_val_t al) noexcept {
117// TracyAligned::tracy_aligned_free(ptr);
118//}
119//
120//inline void operator delete[](void* ptr, std::align_val_t al) noexcept {
121// operator delete(ptr, al);
122//}
123//
124//inline void operator delete(void* ptr) noexcept {
125//#ifdef TRACY_ENABLE
126// TracyFree(ptr);
127//#endif
128// std::free(ptr);
129//}
130
131#endif //PCH_H