Version
menu_open
link
Target Platform(s):

include/AK/SoundEngine/Platforms/Windows/AkTypes.h

Go to the documentation of this file.
00001 
00002 //
00003 // Copyright (c) 2006 Audiokinetic Inc. / All Rights Reserved
00004 //
00006 
00007 // AkTypes.h
00008 
00011 
00012 #ifndef _AK_DATA_TYPES_PLATFORM_H_
00013 #define _AK_DATA_TYPES_PLATFORM_H_
00014 
00015 #include <limits.h>
00016 
00017 #ifndef __cplusplus
00018     #include <wchar.h> // wchar_t not a built-in type in C
00019 #endif
00020 
00021 #define AK_WIN                                      ///< Compiling for Windows
00022     
00023 #ifndef _WIN32_WINNT
00024     #define _WIN32_WINNT 0x0602
00025 #endif                      
00026     
00027 #if defined _M_IX86
00028     #define AK_CPU_X86                              ///< Compiling for 32-bit x86 CPU
00029 #elif defined _M_AMD64
00030     #define AK_CPU_X86_64                           ///< Compiling for 64-bit x86 CPU
00031 #elif defined _M_ARM
00032     #define AK_CPU_ARM
00033     #define AK_CPU_ARM_NEON
00034 #endif
00035     
00036 #ifdef WINAPI_FAMILY
00037     #include <winapifamily.h>
00038     #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
00039         #define AK_USE_METRO_API
00040         #define AK_USE_THREAD_EMULATION
00041         #if defined(WINAPI_PARTITION_PHONE) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE)
00042             #define AK_WINPHONE
00043         #endif
00044     #endif
00045 #endif
00046 
00047 #ifndef AK_WINPHONE
00048 #define AK_MOTION                               ///< Internal use
00049 #define AK_71AUDIO
00050 #endif
00051 
00052 #define AK_LFECENTER                            ///< Internal use
00053 #define AK_REARCHANNELS                         ///< Internal use
00054 
00055 #define AK_SUPPORT_WCHAR                        ///< Can support wchar
00056 #define AK_OS_WCHAR                             ///< Use wchar natively
00057 
00058 #define AK_RESTRICT     __restrict              ///< Refers to the __restrict compilation flag available on some platforms
00059 #define AK_EXPECT_FALSE( _x )   (_x)
00060 #define AkForceInline   __forceinline           ///< Force inlining
00061 #define AkNoInline      __declspec(noinline)    ///< Disable inlining
00062 
00063 #define AK_SIMD_ALIGNMENT   16                  ///< Platform-specific alignment requirement for SIMD data
00064 #define AK_ALIGN_SIMD( __Declaration__ ) __declspec(align(AK_SIMD_ALIGNMENT)) __Declaration__ ///< Platform-specific alignment requirement for SIMD data
00065 #define AK_ALIGN_DMA                            ///< Platform-specific data alignment for DMA transfers
00066 #define AK_ALIGN_FASTDMA                        ///< Platform-specific data alignment for faster DMA transfers
00067 #define AK_ALIGN_SIZE_FOR_DMA( __Size__ ) (__Size__) ///< Used to align sizes to next 16 byte boundary on platfroms that require it
00068 #define AK_BUFFER_ALIGNMENT AK_SIMD_ALIGNMENT
00069 #define AK_XAUDIO2_FLAGS 0
00070 
00071 #define AKSOUNDENGINE_CALL __cdecl              ///< Calling convention for the Wwise API
00072 
00073 typedef unsigned char       AkUInt8;            
00074 typedef unsigned short      AkUInt16;           
00075 typedef unsigned long       AkUInt32;           
00076 typedef unsigned __int64    AkUInt64;           
00077 
00078 #if defined(_WIN64)
00079 typedef __int64 AkIntPtr;                       
00080 typedef unsigned __int64 AkUIntPtr;             
00081 #else
00082 typedef __w64 int AkIntPtr;                     
00083 typedef __w64 unsigned int AkUIntPtr;           
00084 #endif
00085 
00086 typedef char            AkInt8;                 
00087 typedef short           AkInt16;                
00088 typedef long            AkInt32;                
00089 typedef __int64         AkInt64;                
00090 
00091 typedef wchar_t         AkOSChar;               
00092 
00093 typedef float           AkReal32;               
00094 typedef double          AkReal64;               
00095 
00096 typedef void *                  AkThread;       
00097 typedef AkUInt32                AkThreadID;     
00098 typedef AkUInt32 (__stdcall *AkThreadRoutine)(  void* lpThreadParameter ); 
00099 typedef void *                  AkEvent;        
00100 typedef void *                  AkFileHandle;   
00101 typedef wchar_t         AkUtf16;                
00102 
00103 #define AK_UINT_MAX     UINT_MAX
00104 
00105 // For strings.
00106 #define AK_MAX_PATH     260                     ///< Maximum path length.
00107 
00108 typedef AkUInt32            AkFourcc;           
00109 
00111 #define AkmmioFOURCC( ch0, ch1, ch2, ch3 )                                      \
00112         ( (AkFourcc)(AkUInt8)(ch0) | ( (AkFourcc)(AkUInt8)(ch1) << 8 ) |        \
00113         ( (AkFourcc)(AkUInt8)(ch2) << 16 ) | ( (AkFourcc)(AkUInt8)(ch3) << 24 ) )
00114 
00115 #define AK_BANK_PLATFORM_DATA_ALIGNMENT (16)    ///< Required memory alignment for bank loading by memory address (see LoadBank())
00116 #define AK_BANK_PLATFORM_ALLOC_TYPE     AkMalloc
00117 
00121 #define AKTEXT(x) L ## x
00122 
00131 enum AkMemPoolAttributes
00132 {
00133     AkNoAlloc       = 0,    
00134     AkMalloc        = 1<<0, 
00135 
00136     AkVirtualAlloc  = 1<<1, 
00137     AkAllocMask     = AkNoAlloc | AkMalloc | AkVirtualAlloc,    
00138 
00139     AkFixedSizeBlocksMode   = 1<<3,         
00140     AkBlockMgmtMask = AkFixedSizeBlocksMode 
00141 };
00142 #define AK_MEMPOOLATTRIBUTES
00143 
00144 #ifdef __cplusplus
00145     namespace AK
00146     {
00156         extern void * AKSOUNDENGINE_CALL VirtualAllocHook( 
00157             void * in_pMemAddress,      
00158             size_t in_size,             
00159             AkUInt32 in_dwAllocationType,   
00160             AkUInt32 in_dwProtect           
00161             );
00162     
00171         extern void AKSOUNDENGINE_CALL VirtualFreeHook( 
00172             void * in_pMemAddress,  
00173             size_t in_size,         
00174             AkUInt32 in_dwFreeType      
00175             );
00176     }
00177 #endif
00178 
00179 #endif //_AK_DATA_TYPES_PLATFORM_H_
00180 

Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise