TurtleBrains  0.3.5
High quality, portable, C++ framework for rapid 2D game development.
tb_configuration.hpp
1 
9 #ifndef TurtleBrains_Configuration_hpp
10 #define TurtleBrains_Configuration_hpp
11 
12 //TODO: TurtleBrains: Remove the settings in the build script and set them up here, hopefully automatically.
14 //#define tb_windows
15 //#define tb_macos
16 //#define tb_linux
17 //#define tb_web
18 //#define tb_ios
19 
20 #if defined(tb_macosx) && !defined(tb_macos)
21 #warning The tb_macosx define is deprecated, use tb_macos
22 #define tb_macos
23 #endif /* use newer tb_macos define */
24 
25 #if !defined(tb_windows) && !defined(tb_macos) && !defined(tb_linux) && !defined(tb_web) && !defined(tb_ios)
26  #error Unsupported or unknown platform configuration, make sure either: tb_windows, tb_macos, tb_linux, or tb_web is defined.
27 #endif /* tb_platform */
28 
31 //#define tb_without_threading ///< When deefined, TurtleBrains will stay on a single thread, otherwise Audio and other things may run on threads.
32 //#define tb_without_audio ///< When defined, TurtleBrains will NOT include the Audio API, which would require linking with OpenAL.
33 //#define tb_without_networking ///< When defined, TurtleBrains will NOT include the Networking API, which may require additional linked dependencies.
34 //#define tb_without_input_devices ///< When defined, TurtleBrains will NOT include the system input devices API, which could require additional linking.
35 //#define tb_without_development ///< When defined, TurtleBrains will NOT include the Development API, which is useful tools for development stuff.
36 //#define tb_without_math_operators ///< When defined, Vector/Matrix math objects will contain FEWER operators, does NOT disable ALL operators!
37 //#define tb_without_splash_screen ///< When defined, TurtleBrains will jump directly to set scene instead of displaying TurtleBrains splash screen.
38 //#define tb_without_legacy_gl ///< When defined, if TurtleBrains cannot create a 3.2 Core context, it will fail to create application window.
39 //#define tb_with_legacy_gl_context ///< When defined a legacy OpenGL context will be used instead of 3.2 Core, if possible. Not recommended.
40 //#define tb_without_internal_tests ///< When defined TurtleBrains will not build and include internal tests into the UnitTest RunAllTests().
41 
46 //#define tb_with_debug_set ///< Can be used to keep the debug tools/logging active even in a release build.
47 //#define tb_without_debug_set ///< Takes precedence over anything else, if defined will shutoff debug_set completely.
48 //#define tb_without_diagnostics ///< Turn off TurtleBrains internal logging, automatically implied if tb_without_debug_set is defined.
49 
50 //#define tb_with_wide_string ///< Allows an Opt-In for using std::wstring vs std::string implementation throughout framework.
51 
52 //If unspecified, setup the debug/release state based on DEBUG or _DEBUG being defined.
53 #if !defined(tb_release_build) && !defined(tb_debug_build)
54  #if !defined(DEBUG) && !defined(_DEBUG)
55  #define tb_release_build
56  #else
57  #define tb_debug_build
58  #endif
59 #endif /* tb_debug or tb_release */
60 
61 //Defines for the compiler being used, mainly to use specific 'features' of a compiler or, more likely, to avoid issues when building.
62 #if !defined(tb_visual_cpp) && !defined(tb_mingw)
63  #if defined(_MSC_VER)
64  #define tb_visual_cpp
65  #elif defined(__MINGW32__)
66  #define tb_mingw
67  #endif
68 #endif /* compiler checks */
69 
70 #if !defined(tb_with_debug_set) && !defined(tb_without_debug_set)
71  #if defined(tb_debug_build)
72  #define tb_with_debug_set
73  #else
74  #define tb_without_debug_set
75  #endif
76 #endif
77 
78 //Using the with/without options, enable the actual define used deeper in the framework.
79 #if !defined(tb_without_diagnostics) && !defined(tb_with_diagnostics)
80 #if !defined(tb_release_build) || defined(tb_with_debug_set)
81  #define tb_with_diagnostics
82 #else
83  #define tb_without_diagnostics
84 #endif
85 #endif
86 
87 //-------------------------------------------------------------------------------------------------------------------//
88 //-------------------------------------------------------------------------------------------------------------------//
89 //-------------------------------------------------------------------------------------------------------------------//
90 
91 #if !defined(tb_without_threading) && !defined(tb_with_threading)
92  #define tb_with_threading
93 #elif defined(tb_without_threading) && defined(tb_with_threading)
94  #warning Both tb_with_threading and tb_without_threading are defined, No threading used.
95  #undef(tb_with_threading);
96 #endif
97 
98 #if !defined(tb_without_audio) && !defined(tb_with_audio)
99  #define tb_with_audio
100 #elif defined(tb_without_audio) && defined(tb_with_audio)
101  #warning Both tb_with_audio and tb_without_audio are defined, No audio used.
102  #undef(tb_with_audio)
103 #endif
104 
105 #if !defined(tb_without_networking) && !defined(tb_with_networking)
106  #define tb_with_networking
107 #elif defined(tb_without_networking) && defined(tb_with_networking)
108  #warning Both tb_with_networking and tb_without_networking are defined, No networking used.
109  #undef(tb_with_networking)
110 #endif
111 
112 #if !defined(tb_without_input_devices) && !defined(tb_with_input_devices)
113  #define tb_with_input_devices
114 #elif defined(tb_without_input_devices) && defined(tb_with_input_devices)
115  #warning Both tb_with_input_devices and tb_without_input_devices are defined, No input devices used.
116  #undef tb_with_input_devices
117 #endif
118 
120 // Uncaught emscripten_get_num_gamepads() can only be called after having first called
121 // emscripten_sample_gamepad_data() and that function has returned EMSCRIPTEN_RESULT_SUCCESS!
122 #if defined(tb_web) && defined(tb_with_input_devices)
123  #undef tb_with_input_devices
124  #if !defined(tb_without_input_devices)
125  #define tb_without_input_devices
126  #endif
127 #endif
128 
129 //TODO: TurtleBrains: Deprecate development_kit, or, ensure all defines add _kit for consistency.
130 #if !defined(tb_with_development_kit) && !defined(tb_without_development_kit)
131  #if defined(tb_with_development)
132  #define tb_with_development_kit
133  #elif defined(tb_without_development)
134  #define tb_without_development_kit
135  #endif
136 #endif
137 
138 #if !defined(tb_without_development_kit) && !defined(tb_with_development_kit)
139  #define tb_with_development_kit
140 #elif defined(tb_without_development_kit) && defined(tb_with_development_kit)
141  #warning Both tb_with_development_kit and tb_without_development_kit are defined, No development kit used.
142  #undef tb_with_development_kit
143 #endif
144 
145 #if !defined(tb_without_math_operators) && !defined(tb_with_math_operators)
146  #define tb_with_math_operators
147 #elif defined(tb_without_math_operators) && defined(tb_with_math_operators)
148  #warning Both tb_with_math_operators and tb_without_math_operators are defined, No math operators used.
149  #undef tb_with_math_operators
150 #endif
151 
152 #if !defined(tb_without_splash_screen) && !defined(tb_with_splash_screen)
153  #define tb_with_splash_screen
154 #elif defined(tb_without_splash_screen) && defined(tb_with_splash_screen)
155  #warning Both tb_with_splash_screen and tb_without_splash_screen are defined, No splash screen used.
156  #undef tb_with_splash_screen
157 #endif
158 
159 #if !defined(tb_without_legacy_gl) && !defined(tb_with_legacy_gl)
160  #define tb_with_legacy_gl
161 #elif defined(tb_without_legacy_gl) && defined(tb_with_legacy_gl)
162  #warning Both tb_with_legacy_gl and tb_without_legacy_gl are defined, No legacy OpenGL used.
163  #undef tb_with_legacy_gl
164 #endif
165 
166 #if !defined(tb_without_internal_tests) && !defined(tb_with_internal_tests)
167  #define tb_with_internal_tests
168 #elif defined(tb_without_internal_tests) && defined(tb_with_internal_tests)
169  #warning Both tb_with_legacy_gl and tb_without_internal_tests are defined, No internal tests used.
170  #undef tb_with_internal_tests
171 #endif
172 
173 #endif /* TurtleBrains_Configuration_hpp */