SDL Utility
Util.hpp
Go to the documentation of this file.
1 
7 #pragma once
8 #include <cstdint>
9 
10 #define PI 3.1415926f
11 
12 #define IS_NULLPTR( x ) (x == nullptr)
13 
14 #define RETURN_IF_NULLPTR( x, ... ) { if(IS_NULLPTR(x)) return __VA_ARGS__; }
15 #define RETURN_IF_NOT_NULLPTR( x, ... ) { if(!IS_NULLPTR(x)) return __VA_ARGS__; }
16 
17 typedef uint8_t Uint8;
18 typedef int8_t Int8;
19 
20 typedef uint16_t Uint16;
21 typedef int16_t Int16;
22 
23 typedef uint32_t Uint32;
24 typedef int32_t Int32;
25 
26 typedef uint64_t Uint64;
27 typedef int64_t Int64;
28 
29 #define THROW_IF( condition, exception ) ( condition ? throw exception : false)
30 #define THROW_IF_NOT( condition, exception ) ( THROW_IF(!condition, exception) )
31 
32 #define SDLU_BEGIN namespace sdlu {
33 #define SDLU_END }
int8_t Int8
Definition: Util.hpp:18
int32_t Int32
Definition: Util.hpp:24
uint8_t Uint8
Definition: Util.hpp:17
int64_t Int64
Definition: Util.hpp:27
uint16_t Uint16
Definition: Util.hpp:20
int16_t Int16
Definition: Util.hpp:21
uint64_t Uint64
Definition: Util.hpp:26
uint32_t Uint32
Definition: Util.hpp:23