00001 // Copyright (C) 2002-2018 Nikolaus Gebhardt 00002 // This file is part of the "irrKlang" library. 00003 // For conditions of distribution and use, see copyright notice in irrKlang.h 00004 00005 #ifndef __IRRKLANG_TYPES_H_INCLUDED__ 00006 #define __IRRKLANG_TYPES_H_INCLUDED__ 00007 00008 00009 namespace irrklang 00010 { 00011 00013 00014 typedef unsigned char ik_u8; 00015 00017 00018 typedef signed char ik_s8; 00019 00021 00022 typedef char ik_c8; 00023 00024 00025 00027 00028 typedef unsigned short ik_u16; 00029 00031 00032 typedef signed short ik_s16; 00033 00034 00035 00037 00038 typedef unsigned int ik_u32; 00039 00041 00042 typedef signed int ik_s32; 00043 00044 00045 00047 00048 typedef float ik_f32; 00049 00051 00052 typedef double ik_f64; 00053 00054 00055 00056 // some constants 00057 00058 const ik_f32 IK_ROUNDING_ERROR_32 = 0.000001f; 00059 const ik_f64 IK_PI64 = 3.1415926535897932384626433832795028841971693993751; 00060 const ik_f32 IK_PI32 = 3.14159265359f; 00061 const ik_f32 IK_RADTODEG = 180.0f / IK_PI32; 00062 const ik_f32 IK_DEGTORAD = IK_PI32 / 180.0f; 00063 const ik_f64 IK_RADTODEG64 = 180.0 / IK_PI64; 00064 const ik_f64 IK_DEGTORAD64 = IK_PI64 / 180.0; 00065 00068 inline bool equalsfloat(const ik_f32 a, const ik_f32 b, const ik_f32 tolerance = IK_ROUNDING_ERROR_32) 00069 { 00070 return (a + tolerance > b) && (a - tolerance < b); 00071 } 00072 00073 } // end irrklang namespace 00074 00075 // ensure wchar_t type is existing for unicode support 00076 #include <wchar.h> 00077 00078 // define the wchar_t type if not already built in. 00079 #ifdef _MSC_VER // microsoft compiler 00080 #ifndef _WCHAR_T_DEFINED 00082 00089 typedef unsigned short wchar_t; 00090 #define _WCHAR_T_DEFINED 00091 #endif // wchar is not defined 00092 #endif // microsoft compiler 00093 00094 00095 #endif // __IRR_TYPES_H_INCLUDED__ 00096
The irrKlang
Engine Documentation © 2003-2018 by Nikolaus Gebhardt. Generated
by Doxygen
(1.6.1) |