Version
menu_open
link
Target Platform(s):
Wwise SDK 2019.2.15
AkTypes.h
Go to the documentation of this file.
1 /*******************************************************************************
2 The content of this file includes portions of the AUDIOKINETIC Wwise Technology
3 released in source code form as part of the SDK installer package.
4 
5 Commercial License Usage
6 
7 Licensees holding valid commercial licenses to the AUDIOKINETIC Wwise Technology
8 may use this file in accordance with the end user license agreement provided
9 with the software or, alternatively, in accordance with the terms contained in a
10 written agreement between you and Audiokinetic Inc.
11 
12 Apache License Usage
13 
14 Alternatively, this file may be used under the Apache License, Version 2.0 (the
15 "Apache License"); you may not use this file except in compliance with the
16 Apache License. You may obtain a copy of the Apache License at
17 http://www.apache.org/licenses/LICENSE-2.0.
18 
19 Unless required by applicable law or agreed to in writing, software distributed
20 under the Apache License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
21 OR CONDITIONS OF ANY KIND, either express or implied. See the Apache License for
22 the specific language governing permissions and limitations under the License.
23 
24  Version: <VERSION> Build: <BUILDNUMBER>
25  Copyright (c) <COPYRIGHTYEAR> Audiokinetic Inc.
26 *******************************************************************************/
27 
28 // AkTypes.h
29 
30 /// \file
31 /// Data type definitions.
32 
33 #ifndef _AK_DATA_TYPES_PLATFORM_H_
34 #define _AK_DATA_TYPES_PLATFORM_H_
35 
36 #include <limits.h>
37 
38 #ifndef __cplusplus
39  #include <wchar.h> // wchar_t not a built-in type in C
40 #endif
41 
42 #define AK_WIN ///< Compiling for Windows
43 
44 #if defined _M_IX86
45  #define AK_CPU_X86 ///< Compiling for 32-bit x86 CPU
46 #elif defined _M_AMD64
47  #define AK_CPU_X86_64 ///< Compiling for 64-bit x86 CPU
48 #elif defined _M_ARM
49  #define AK_CPU_ARM
50  #define AK_CPU_ARM_NEON
51 #elif defined _M_ARM64
52  #define AK_CPU_ARM_64
53  #define AK_CPU_ARM_NEON
54 #endif
55 
56 #ifdef WINAPI_FAMILY
57  #include <winapifamily.h>
58  #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
59  #define AK_USE_UWP_API
60  #define AK_USE_METRO_API // deprecated
61  #ifdef __cplusplus_winrt
62  #define AK_UWP_CPP_CX // To test for UWP code which uses Microsoft's C++/CX extended language (not all projects do)
63  #endif
64  #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PC_APP)
65  #define AK_WIN_UNIVERSAL_APP
66  #endif
67  #endif
68 #endif
69 
70 #ifndef _WIN32_WINNT
71  #ifdef AK_WIN_UNIVERSAL_APP
72  #define _WIN32_WINNT 0x0A00 // _WIN32_WINNT_WIN10
73  #else
74  #define _WIN32_WINNT 0x0602
75  #endif
76 #endif
77 
78 #define AK_71AUDIO
79 #define AK_71FROMSTEREOMIXER
80 #define AK_51FROMSTEREOMIXER
81 
82 #define AK_LFECENTER ///< Internal use
83 #define AK_REARCHANNELS ///< Internal use
84 
85 #define AK_SUPPORT_WCHAR ///< Can support wchar
86 #define AK_OS_WCHAR ///< Use wchar natively
87 
88 #define AK_RESTRICT __restrict ///< Refers to the __restrict compilation flag available on some platforms
89 #define AK_EXPECT_FALSE( _x ) (_x)
90 #define AkForceInline __forceinline ///< Force inlining
91 #define AkNoInline __declspec(noinline) ///< Disable inlining
92 
93 #define AK_SIMD_ALIGNMENT 16 ///< Platform-specific alignment requirement for SIMD data
94 #define AK_ALIGN_SIMD( __Declaration__ ) __declspec(align(AK_SIMD_ALIGNMENT)) __Declaration__ ///< Platform-specific alignment requirement for SIMD data
95 #define AK_ALIGN_DMA ///< Platform-specific data alignment for DMA transfers
96 #define AK_ALIGN_FASTDMA ///< Platform-specific data alignment for faster DMA transfers
97 #define AK_ALIGN_SIZE_FOR_DMA( __Size__ ) (__Size__) ///< Used to align sizes to next 16 byte boundary on platfroms that require it
98 #define AK_BUFFER_ALIGNMENT AK_SIMD_ALIGNMENT
99 #define AK_XAUDIO2_FLAGS 0
100 
101 #if defined AK_CPU_X86 || defined AK_CPU_X86_64 || defined AK_CPU_ARM_NEON
102 #define AKSIMD_V4F32_SUPPORTED
103 #endif
104 
105 /// These flags defined that a given class of SIMD extensions is available.
106 /// Note that runtime checks MUST be done before entering code that explicitly utilizes one of these classes
107 #if defined AK_CPU_X86_64
108 #define AKSIMD_AVX2_SUPPORTED
109 #define AKSIMD_AVX_SUPPORTED
110 #endif
111 
112 #define AKSOUNDENGINE_CALL __cdecl ///< Calling convention for the Wwise API
113 
114 #define AK_DLLEXPORT __declspec(dllexport)
115 #define AK_DLLIMPORT __declspec(dllimport)
116 
117 typedef unsigned char AkUInt8; ///< Unsigned 8-bit integer
118 typedef unsigned short AkUInt16; ///< Unsigned 16-bit integer
119 typedef unsigned long AkUInt32; ///< Unsigned 32-bit integer
120 typedef unsigned __int64 AkUInt64; ///< Unsigned 64-bit integer
121 
122 #if defined(_WIN64)
123 typedef __int64 AkIntPtr; ///< Integer type for pointers
124 typedef unsigned __int64 AkUIntPtr; ///< Integer (unsigned) type for pointers
125 #else
126 typedef __w64 int AkIntPtr; ///< Integer type for pointers
127 typedef __w64 unsigned int AkUIntPtr; ///< Integer (unsigned) type for pointers
128 #endif
129 
130 typedef char AkInt8; ///< Signed 8-bit integer
131 typedef short AkInt16; ///< Signed 16-bit integer
132 typedef long AkInt32; ///< Signed 32-bit integer
133 typedef __int64 AkInt64; ///< Signed 64-bit integer
134 
135 typedef wchar_t AkOSChar; ///< Generic character string
136 
137 typedef float AkReal32; ///< 32-bit floating point
138 typedef double AkReal64; ///< 64-bit floating point
139 
140 typedef void * AkThread; ///< Thread handle
141 typedef AkUInt32 AkThreadID; ///< Thread ID
142 typedef AkUInt32 (__stdcall *AkThreadRoutine)( void* lpThreadParameter ); ///< Thread routine
143 typedef void * AkEvent; ///< Event handle
144 typedef void * AkFileHandle; ///< File handle
145 typedef wchar_t AkUtf16; ///< Type for 2 byte chars. Used for communication
146  ///< with the authoring tool.
147 #define AK_UINT_MAX UINT_MAX
148 
149 // For strings.
150 #define AK_MAX_PATH 260 ///< Maximum path length.
151 
152 typedef AkUInt32 AkFourcc; ///< Riff chunk
153 
154 /// Create Riff chunk
155 #define AkmmioFOURCC( ch0, ch1, ch2, ch3 ) \
156  ( (AkFourcc)(AkUInt8)(ch0) | ( (AkFourcc)(AkUInt8)(ch1) << 8 ) | \
157  ( (AkFourcc)(AkUInt8)(ch2) << 16 ) | ( (AkFourcc)(AkUInt8)(ch3) << 24 ) )
158 
159 #define AK_BANK_PLATFORM_DATA_ALIGNMENT (16) ///< Required memory alignment for bank loading by memory address (see LoadBank())
160 
161 /// Macro that takes a string litteral and changes it to an AkOSChar string at compile time
162 /// \remark This is similar to the TEXT() and _T() macros that can be used to turn string litterals into wchar_t strings
163 /// \remark Usage: AKTEXT( "Some Text" )
164 #define AKTEXT(x) L ## x
165 
166 #endif //_AK_DATA_TYPES_PLATFORM_H_
167 
uint64_t AkUInt64
Unsigned 64-bit integer.
Definition: AkTypes.h:86
AkUInt32 AkFourcc
Riff chunk.
Definition: AkTypes.h:121
semaphore_t AkEvent
Definition: AkTypes.h:77
ScePthread AkThreadID
Thread ID.
Definition: AkTypes.h:107
void *(* AkThreadRoutine)(void *lpThreadParameter)
Thread routine.
Definition: AkTypes.h:108
wchar_t AkUtf16
Definition: AkTypes.h:113
char AkOSChar
Generic character string.
Definition: AkTypes.h:101
double AkReal64
64-bit floating point
Definition: AkTypes.h:104
int64_t AkInt64
Signed 64-bit integer.
Definition: AkTypes.h:99
int32_t AkInt32
Signed 32-bit integer.
Definition: AkTypes.h:98
uint8_t AkUInt8
Unsigned 8-bit integer.
Definition: AkTypes.h:83
uint16_t AkUInt16
Unsigned 16-bit integer.
Definition: AkTypes.h:84
int8_t AkInt8
Signed 8-bit integer.
Definition: AkTypes.h:96
int64_t AkIntPtr
Definition: AkTypes.h:89
int16_t AkInt16
Signed 16-bit integer.
Definition: AkTypes.h:97
uint64_t AkUIntPtr
Definition: AkTypes.h:90
SceFiosFH AkFileHandle
File handle.
Definition: AkTypes.h:111
float AkReal32
32-bit floating point
Definition: AkTypes.h:103
uint32_t AkUInt32
Unsigned 32-bit integer.
Definition: AkTypes.h:85
ScePthread AkThread
Thread handle.
Definition: AkTypes.h:106

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