RioEngine  0.1
My first attempt to create a 3D WYSIWYG Game Engine
ik_irrKlangTypes.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2014 Nikolaus Gebhardt
2 // This file is part of the "irrKlang" library.
3 // For conditions of distribution and use, see copyright notice in irrKlang.h
4 
5 #ifndef __IRRKLANG_TYPES_H_INCLUDED__
6 #define __IRRKLANG_TYPES_H_INCLUDED__
7 
8 
9 namespace irrklang
10 {
11 
13 
14  typedef unsigned char ik_u8;
15 
17 
18  typedef signed char ik_s8;
19 
21 
22  typedef char ik_c8;
23 
24 
25 
27 
28  typedef unsigned short ik_u16;
29 
31 
32  typedef signed short ik_s16;
33 
34 
35 
37 
38  typedef unsigned int ik_u32;
39 
41 
42  typedef signed int ik_s32;
43 
44 
45 
47 
48  typedef float ik_f32;
49 
51 
52  typedef double ik_f64;
53 
54 
55 
56  // some constants
57 
58  const ik_f32 IK_ROUNDING_ERROR_32 = 0.000001f;
59  const ik_f64 IK_PI64 = 3.1415926535897932384626433832795028841971693993751;
60  const ik_f32 IK_PI32 = 3.14159265359f;
61  const ik_f32 IK_RADTODEG = 180.0f / IK_PI32;
62  const ik_f32 IK_DEGTORAD = IK_PI32 / 180.0f;
63  const ik_f64 IK_RADTODEG64 = 180.0 / IK_PI64;
64  const ik_f64 IK_DEGTORAD64 = IK_PI64 / 180.0;
65 
68  inline bool equalsfloat(const ik_f32 a, const ik_f32 b, const ik_f32 tolerance = IK_ROUNDING_ERROR_32)
69  {
70  return (a + tolerance > b) && (a - tolerance < b);
71  }
72 
73 } // end irrklang namespace
74 
75 // ensure wchar_t type is existing for unicode support
76 #include <wchar.h>
77 
78 // define the wchar_t type if not already built in.
79 #ifdef _MSC_VER // microsoft compiler
80  #ifndef _WCHAR_T_DEFINED
81 
89  typedef unsigned short wchar_t;
90  #define _WCHAR_T_DEFINED
91  #endif // wchar is not defined
92 #endif // microsoft compiler
93 
94 
95 #endif // __IRR_TYPES_H_INCLUDED__
96 
const ik_f64 IK_PI64
signed char ik_s8
8 bit signed variable.
unsigned int ik_u32
32 bit unsigned variable.
signed int ik_s32
32 bit signed variable.
const ik_f32 IK_RADTODEG
char ik_c8
8 bit character variable.
double ik_f64
64 bit floating point variable.
Everything in the irrKlang Sound Engine can be found in this namespace.
const ik_f32 IK_ROUNDING_ERROR_32
unsigned char ik_u8
8 bit unsigned variable.
signed short ik_s16
16 bit signed variable.
const ik_f64 IK_DEGTORAD64
const ik_f32 IK_DEGTORAD
bool equalsfloat(const ik_f32 a, const ik_f32 b, const ik_f32 tolerance=IK_ROUNDING_ERROR_32)
unsigned short ik_u16
16 bit unsigned variable.
float ik_f32
32 bit floating point variable.
const ik_f64 IK_RADTODEG64
const ik_f32 IK_PI32