Version
menu_open
link
Target Platform(s):
Wwise SDK 2023.1.4
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  Copyright (c) 2024 Audiokinetic Inc.
25 *******************************************************************************/
26 
27 // AkTypes.h
28 
29 /// \file
30 /// Data type definitions.
31 
32 #pragma once
33 
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 #if !defined(AK_WIN )
43  #define AK_WIN ///< Compiling for Windows
44 #endif
45 
46 #if defined _M_IX86
47  #define AK_CPU_X86 ///< Compiling for 32-bit x86 CPU
48 #elif defined _M_AMD64
49  #define AK_CPU_X86_64 ///< Compiling for 64-bit x86 CPU
50 #elif defined _M_ARM
51  #define AK_CPU_ARM
52  #define AK_CPU_ARM_NEON
53 #elif defined _M_ARM64
54  #define AK_CPU_ARM_64
55  #define AK_CPU_ARM_NEON
56 #endif
57 
58 #ifdef WINAPI_FAMILY
59  #include <winapifamily.h>
60  #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
61 #error "The current WINAPI_FAMILY_PARTITION is not supported."
62  #endif
63 #endif
64 
65 #ifndef _WIN32_WINNT
66  #ifdef AK_WIN_UNIVERSAL_APP
67  #define _WIN32_WINNT 0x0A00 // _WIN32_WINNT_WIN10
68  #else
69  #define _WIN32_WINNT 0x0602
70  #endif
71 #endif
72 
73 #define AK_71FROMSTEREOMIXER
74 #define AK_51FROMSTEREOMIXER
75 
76 #define AK_SUPPORT_THREADS
77 #define AK_SUPPORT_WCHAR ///< Can support wchar
78 #define AK_OS_WCHAR ///< Use wchar natively
79 
80 #define AK_SUPPORT_THREAD_LOCAL ///< Support thread_local C++11 keyword with no restrictions
81 
82 #define AK_RESTRICT __restrict ///< Refers to the __restrict compilation flag available on some platforms
83 #define AK_EXPECT_FALSE( _x ) (_x)
84 #define AkForceInline __forceinline ///< Force inlining
85 #define AkNoInline __declspec(noinline) ///< Disable inlining
86 
87 #define AK_SIMD_ALIGNMENT 16 ///< Platform-specific alignment requirement for SIMD data
88 #define AK_ALIGN_SIMD( _declaration_ ) AK_ALIGN( _declaration_, AK_SIMD_ALIGNMENT ) ///< Platform-specific alignment requirement for SIMD data
89 #define AK_BUFFER_ALIGNMENT AK_SIMD_ALIGNMENT
90 #define AK_XAUDIO2_FLAGS 0
91 
92 #define AK_DEVICE_CACHE_SUPPORT ///< Supports output device notifications & cache
93 
94 #if defined AK_CPU_X86 || defined AK_CPU_X86_64 || defined AK_CPU_ARM_NEON
95 #define AKSIMD_V4F32_SUPPORTED
96 #endif
97 
98 /// These flags defined that a given class of SIMD extensions is available.
99 /// Note that runtime checks MUST be done before entering code that explicitly utilizes one of these classes
100 #if defined AK_CPU_X86_64
101 #define AKSIMD_AVX2_SUPPORTED
102 #define AKSIMD_AVX_SUPPORTED
103 #endif
104 
105 #define AKSOUNDENGINE_CALL __cdecl ///< Calling convention for the Wwise API
106 
107 #define AK_DLLEXPORT __declspec(dllexport)
108 #define AK_DLLIMPORT __declspec(dllimport)
109 
110 typedef wchar_t AkOSChar; ///< Generic character string
111 typedef wchar_t AkUtf16; ///< Type for 2 byte chars. Used for communication
112  ///< with the authoring tool.
113 
114 typedef void * AkThread; ///< Thread handle
115 typedef unsigned long AkThreadID; ///< Thread ID
116 typedef unsigned long (__stdcall *AkThreadRoutine)( void* lpThreadParameter ); ///< Thread routine
117 
118 typedef void * AkEvent; ///< Event handle
119 typedef void * AkSemaphore; ///< Semaphore handle
120 
121 typedef void * AkFileHandle; ///< File handle
122 
123 typedef void* AkStackTrace[ 64 ];
124 
125 #define AK_UINT_MAX UINT_MAX
126 
127 // For strings.
128 #define AK_MAX_PATH 260 ///< Maximum path length.
129 
130 typedef AkUInt32 AkFourcc; ///< Riff chunk
131 
132 /// Create Riff chunk
133 #define AkmmioFOURCC( ch0, ch1, ch2, ch3 ) \
134  ( (AkFourcc)(AkUInt8)(ch0) | ( (AkFourcc)(AkUInt8)(ch1) << 8 ) | \
135  ( (AkFourcc)(AkUInt8)(ch2) << 16 ) | ( (AkFourcc)(AkUInt8)(ch3) << 24 ) )
136 
137 #define AK_BANK_PLATFORM_DATA_ALIGNMENT (16) ///< Required memory alignment for bank loading by memory address (see LoadBank())
138 
139 /// Format for printing AkOSChar string using OutputDebugMsgV
140 /// Corresponds to "%ls" if AK_OS_WCHAR, else "%s".
141 /// \remark Usage: AKPLATFORM::OutputDebugMsgV(AKTEXT("Print this string: " AK_OSCHAR_FMT "\n", msg));
142 #define AK_OSCHAR_FMT "%ls"
143 
144 /// Macro that takes a string litteral and changes it to an AkOSChar string at compile time
145 /// \remark This is similar to the TEXT() and _T() macros that can be used to turn string litterals into wchar_t strings
146 /// \remark Usage: AKTEXT( "Some Text" )
147 #define AKTEXT(x) L ## x
semaphore_t AkEvent
Definition: AkTypes.h:84
int AkThreadID
Definition: AkTypes.h:69
char AkOSChar
Generic character string.
Definition: AkTypes.h:60
FILE * AkFileHandle
File handle.
Definition: AkTypes.h:77
AkUInt16 AkUtf16
Definition: AkTypes.h:61
nn::os::ThreadFunction AkThreadRoutine
Thread routine.
Definition: AkTypes.h:90
int AkThread
Definition: AkTypes.h:68
uint32_t AkUInt32
Unsigned 32-bit integer.
void * AkStackTrace[64]
Definition: AkTypes.h:61
AkUInt32 AkFourcc
Riff chunk.
Definition: AkTypes.h:84
semaphore_t AkSemaphore
Definition: AkTypes.h:85

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