StarEngine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
defines.h
Go to the documentation of this file.
1 #pragma once
2 
3 #if defined(_WIN32)
4  #define DESKTOP
5 #elif defined(ANDROID)
6  #define MOBILE
7 #endif
8 
9 #include <stdint.h>
10 
11 typedef int64_t int64;
12 typedef int32_t int32;
13 typedef int16_t int16;
14 typedef int8_t int8;
15 
16 typedef uint64_t uint64;
17 typedef uint32_t uint32;
18 typedef uint16_t uint16;
19 typedef uint8_t uint8;
20 
21 typedef int8_t status;
22 
23 const status STATUS_OK = 0;
24 const status STATUS_KO = -1;
25 const status STATUS_EXIT = -2;
26 
27 #include <string.h>
28 #include <sstream>
29 #include <iostream>
30 #include <fstream>
31 
32 #ifdef _WIN32
33 #include <Windows.h>
34 #include <stdlib.h>
35 #include <minmax.h>
36 #include <tchar.h>
37 #endif
38 
39 #ifdef _UNICODE
40  #define tstring std::wstring
41  #define tcin std::wcin
42  #define tcout std::wcout
43  #define tstringstream std::wstringstream
44  #define tofstream std::wofstream
45  #define tifstream std::wifstream
46  #define tfstream std::wfstream
47  #define to_tstring std::to_wstring
48  #define tchar wchar_t
49  #define tuchar unsigned std::char
50  #define tprintf std::wprintf
51  #define ttof _wtof
52  #define ttoi _wtoi
53  #define tstrlen wcslen
54 #else
55  #define tstring std::string
56  #define tcin std::cin
57  #define tcout std::cout
58  #define tstringstream std::stringstream
59  #define tofstream std::ofstream
60  #define tifstream std::ifstream
61  #define tfstream std::fstream
62  #define to_tstring std::to_string
63  #define tchar char
64  #define tuchar unsigned char
65  #define tprintf std::printf
66  #define ttof atof
67  #define ttoi atoi
68  #define tstrlen strlen
69 #endif
70 
71 #include <algorithm>
72 
73 using std::min;
74 using std::max;
75 
76 //OpenGL Math Library
77 #include "Helpers\glm\glm.h"
78 #include "Helpers\glm\ext.hpp"
79 
80 using glm::vec2;
81 using glm::vec3;
82 using glm::vec4;
83 using glm::quat;
84 using glm::mat4x4;
85 using glm::ivec2;
86 using glm::ivec3;
87 using glm::ivec4;
88 
89 const double PI = 3.14159265358979323846264338327950288;
90 
91 #define EMPTY_STRING _T("")
92 #define ANDROID_LOG_TAG _T("STAR_ENGINE")
93 #define NO_WRAPPING -1
94 const float EPSILON = 0.0000001f;
95 
96 #ifdef STAR2D
97 #include "defines2D.h"
98 #endif
99 
100 #ifdef ANDROID
101 #include "definesAndroid.h"
102 #endif
103 
104 #ifdef _WIN32
105 #include "definesWindows.h"
106 const int BORDERWIDTH = 5;
107 #endif
int64_t int64
Definition: defines.h:11
uint8_t uint8
Definition: defines.h:19
const double PI
Definition: defines.h:89
uint64_t uint64
Definition: defines.h:16
uint16_t uint16
Definition: defines.h:18
int16_t int16
Definition: defines.h:13
const status STATUS_KO
Definition: defines.h:24
int8_t status
Definition: defines.h:21
const float EPSILON
Definition: defines.h:94
int8_t int8
Definition: defines.h:14
const status STATUS_EXIT
Definition: defines.h:25
int32_t int32
Definition: defines.h:12
const status STATUS_OK
Definition: defines.h:23
uint32_t uint32
Definition: defines.h:17