Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libSDL
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
libSDL
Commits
46bb3d87
Commit
46bb3d87
authored
Aug 04, 2011
by
Ryan C. Gordon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented XAudio2 target for Windows (and Xbox360, theoretically!).
parent
8fa65eea
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
534 additions
and
0 deletions
+534
-0
SDL_VS2005.vcproj
VisualC/SDL/SDL_VS2005.vcproj
+8
-0
SDL_VS2008.vcproj
VisualC/SDL/SDL_VS2008.vcproj
+8
-0
SDL_VS2010.vcxproj
VisualC/SDL/SDL_VS2010.vcxproj
+2
-0
configure.in
configure.in
+9
-0
SDL_config.h.in
include/SDL_config.h.in
+1
-0
SDL_config_windows.h
include/SDL_config_windows.h
+1
-0
SDL_audio.c
src/audio/SDL_audio.c
+4
-0
SDL_xaudio2.c
src/audio/xaudio2/SDL_xaudio2.c
+455
-0
SDL_xaudio2.h
src/audio/xaudio2/SDL_xaudio2.h
+46
-0
No files found.
VisualC/SDL/SDL_VS2005.vcproj
View file @
46bb3d87
...
@@ -847,6 +847,14 @@
...
@@ -847,6 +847,14 @@
RelativePath=
"..\..\src\audio\directsound\SDL_directsound.h"
RelativePath=
"..\..\src\audio\directsound\SDL_directsound.h"
>
>
</File>
</File>
<File
RelativePath=
"..\..\src\audio\xaudio2\SDL_xaudio2.c"
>
</File>
<File
RelativePath=
"..\..\src\audio\xaudio2\SDL_xaudio2.h"
>
</File>
<File
<File
RelativePath=
"..\..\src\joystick\windows\SDL_dxjoystick.c"
RelativePath=
"..\..\src\joystick\windows\SDL_dxjoystick.c"
>
>
...
...
VisualC/SDL/SDL_VS2008.vcproj
View file @
46bb3d87
...
@@ -836,6 +836,14 @@
...
@@ -836,6 +836,14 @@
RelativePath=
"..\..\src\audio\directsound\SDL_directsound.h"
RelativePath=
"..\..\src\audio\directsound\SDL_directsound.h"
>
>
</File>
</File>
<File
RelativePath=
"..\..\src\audio\xaudio2\SDL_xaudio2.c"
>
</File>
<File
RelativePath=
"..\..\src\audio\xaudio2\SDL_xaudio2.h"
>
</File>
<File
<File
RelativePath=
"..\..\src\joystick\windows\SDL_dxjoystick.c"
RelativePath=
"..\..\src\joystick\windows\SDL_dxjoystick.c"
>
>
...
...
VisualC/SDL/SDL_VS2010.vcxproj
View file @
46bb3d87
...
@@ -280,6 +280,7 @@
...
@@ -280,6 +280,7 @@
<ClInclude
Include=
"..\..\src\audio\disk\SDL_diskaudio.h"
/>
<ClInclude
Include=
"..\..\src\audio\disk\SDL_diskaudio.h"
/>
<ClInclude
Include=
"..\..\src\audio\dummy\SDL_dummyaudio.h"
/>
<ClInclude
Include=
"..\..\src\audio\dummy\SDL_dummyaudio.h"
/>
<ClInclude
Include=
"..\..\src\audio\directsound\SDL_directsound.h"
/>
<ClInclude
Include=
"..\..\src\audio\directsound\SDL_directsound.h"
/>
<ClInclude
Include=
"..\..\src\audio\xaudio2\SDL_xaudio2.h"
/>
<ClInclude
Include=
"..\..\src\SDL_error_c.h"
/>
<ClInclude
Include=
"..\..\src\SDL_error_c.h"
/>
<ClInclude
Include=
"..\..\src\SDL_hints_c.h"
/>
<ClInclude
Include=
"..\..\src\SDL_hints_c.h"
/>
<ClInclude
Include=
"..\..\src\events\SDL_events_c.h"
/>
<ClInclude
Include=
"..\..\src\events\SDL_events_c.h"
/>
...
@@ -381,6 +382,7 @@
...
@@ -381,6 +382,7 @@
<ClCompile
Include=
"..\..\src\audio\disk\SDL_diskaudio.c"
/>
<ClCompile
Include=
"..\..\src\audio\disk\SDL_diskaudio.c"
/>
<ClCompile
Include=
"..\..\src\audio\dummy\SDL_dummyaudio.c"
/>
<ClCompile
Include=
"..\..\src\audio\dummy\SDL_dummyaudio.c"
/>
<ClCompile
Include=
"..\..\src\audio\directsound\SDL_directsound.c"
/>
<ClCompile
Include=
"..\..\src\audio\directsound\SDL_directsound.c"
/>
<ClCompile
Include=
"..\..\src\audio\xaudio2\SDL_xaudio2.c"
/>
<ClCompile
Include=
"..\..\src\joystick\windows\SDL_dxjoystick.c"
/>
<ClCompile
Include=
"..\..\src\joystick\windows\SDL_dxjoystick.c"
/>
<ClCompile
Include=
"..\..\src\SDL_error.c"
/>
<ClCompile
Include=
"..\..\src\SDL_error.c"
/>
<ClCompile
Include=
"..\..\src\events\SDL_events.c"
/>
<ClCompile
Include=
"..\..\src\events\SDL_events.c"
/>
...
...
configure.in
View file @
46bb3d87
...
@@ -1726,6 +1726,7 @@ AC_HELP_STRING([--enable-directx], [use DirectX for Windows audio/video [[defaul
...
@@ -1726,6 +1726,7 @@ AC_HELP_STRING([--enable-directx], [use DirectX for Windows audio/video [[defaul
AC_CHECK_HEADER(ddraw.h, have_ddraw=yes)
AC_CHECK_HEADER(ddraw.h, have_ddraw=yes)
AC_CHECK_HEADER(dsound.h, have_dsound=yes)
AC_CHECK_HEADER(dsound.h, have_dsound=yes)
AC_CHECK_HEADER(dinput.h, have_dinput=yes)
AC_CHECK_HEADER(dinput.h, have_dinput=yes)
AC_CHECK_HEADER(xaudio2.h, have_xaudio2=yes)
fi
fi
}
}
...
@@ -2063,6 +2064,10 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau
...
@@ -2063,6 +2064,10 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau
AC_DEFINE(SDL_AUDIO_DRIVER_DSOUND, 1, [ ])
AC_DEFINE(SDL_AUDIO_DRIVER_DSOUND, 1, [ ])
SOURCES="$SOURCES $srcdir/src/audio/directsound/*.c"
SOURCES="$SOURCES $srcdir/src/audio/directsound/*.c"
fi
fi
if test x$have_xaudio2 = xyes; then
AC_DEFINE(SDL_AUDIO_DRIVER_XAUDIO2, 1, [ ])
SOURCES="$SOURCES $srcdir/src/audio/xaudio2/*.c"
fi
have_audio=yes
have_audio=yes
fi
fi
# Set up dummy files for the joystick for now
# Set up dummy files for the joystick for now
...
@@ -2150,6 +2155,10 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau
...
@@ -2150,6 +2155,10 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau
AC_DEFINE(SDL_AUDIO_DRIVER_DSOUND, 1, [ ])
AC_DEFINE(SDL_AUDIO_DRIVER_DSOUND, 1, [ ])
SOURCES="$SOURCES $srcdir/src/audio/directsound/*.c"
SOURCES="$SOURCES $srcdir/src/audio/directsound/*.c"
fi
fi
if test x$have_xaudio2 = xyes; then
AC_DEFINE(SDL_AUDIO_DRIVER_XAUDIO2, 1, [ ])
SOURCES="$SOURCES $srcdir/src/audio/xaudio2/*.c"
fi
have_audio=yes
have_audio=yes
fi
fi
# Set up files for the joystick library
# Set up files for the joystick library
...
...
include/SDL_config.h.in
View file @
46bb3d87
...
@@ -184,6 +184,7 @@
...
@@ -184,6 +184,7 @@
#undef SDL_AUDIO_DRIVER_COREAUDIO
#undef SDL_AUDIO_DRIVER_COREAUDIO
#undef SDL_AUDIO_DRIVER_DISK
#undef SDL_AUDIO_DRIVER_DISK
#undef SDL_AUDIO_DRIVER_DUMMY
#undef SDL_AUDIO_DRIVER_DUMMY
#undef SDL_AUDIO_DRIVER_XAUDIO2
#undef SDL_AUDIO_DRIVER_DSOUND
#undef SDL_AUDIO_DRIVER_DSOUND
#undef SDL_AUDIO_DRIVER_ESD
#undef SDL_AUDIO_DRIVER_ESD
#undef SDL_AUDIO_DRIVER_ESD_DYNAMIC
#undef SDL_AUDIO_DRIVER_ESD_DYNAMIC
...
...
include/SDL_config_windows.h
View file @
46bb3d87
...
@@ -145,6 +145,7 @@ typedef unsigned int uintptr_t;
...
@@ -145,6 +145,7 @@ typedef unsigned int uintptr_t;
/* Enable various audio drivers */
/* Enable various audio drivers */
#ifndef _WIN32_WCE
#ifndef _WIN32_WCE
#define SDL_AUDIO_DRIVER_DSOUND 1
#define SDL_AUDIO_DRIVER_DSOUND 1
#define SDL_AUDIO_DRIVER_XAUDIO2 1
#endif
#endif
#define SDL_AUDIO_DRIVER_WINMM 1
#define SDL_AUDIO_DRIVER_WINMM 1
#define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_DISK 1
...
...
src/audio/SDL_audio.c
View file @
46bb3d87
...
@@ -52,6 +52,7 @@ extern AudioBootStrap SUNAUDIO_bootstrap;
...
@@ -52,6 +52,7 @@ extern AudioBootStrap SUNAUDIO_bootstrap;
extern
AudioBootStrap
ARTS_bootstrap
;
extern
AudioBootStrap
ARTS_bootstrap
;
extern
AudioBootStrap
ESD_bootstrap
;
extern
AudioBootStrap
ESD_bootstrap
;
extern
AudioBootStrap
NAS_bootstrap
;
extern
AudioBootStrap
NAS_bootstrap
;
extern
AudioBootStrap
XAUDIO2_bootstrap
;
extern
AudioBootStrap
DSOUND_bootstrap
;
extern
AudioBootStrap
DSOUND_bootstrap
;
extern
AudioBootStrap
WINMM_bootstrap
;
extern
AudioBootStrap
WINMM_bootstrap
;
extern
AudioBootStrap
PAUDIO_bootstrap
;
extern
AudioBootStrap
PAUDIO_bootstrap
;
...
@@ -97,6 +98,9 @@ static const AudioBootStrap *const bootstrap[] = {
...
@@ -97,6 +98,9 @@ static const AudioBootStrap *const bootstrap[] = {
#if SDL_AUDIO_DRIVER_NAS
#if SDL_AUDIO_DRIVER_NAS
&
NAS_bootstrap
,
&
NAS_bootstrap
,
#endif
#endif
#if SDL_AUDIO_DRIVER_XAUDIO2
&
XAUDIO2_bootstrap
,
#endif
#if SDL_AUDIO_DRIVER_DSOUND
#if SDL_AUDIO_DRIVER_DSOUND
&
DSOUND_bootstrap
,
&
DSOUND_bootstrap
,
#endif
#endif
...
...
src/audio/xaudio2/SDL_xaudio2.c
0 → 100644
View file @
46bb3d87
This diff is collapsed.
Click to expand it.
src/audio/xaudio2/SDL_xaudio2.h
0 → 100644
View file @
46bb3d87
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "SDL_config.h"
#ifndef _SDL_xaudio2_h
#define _SDL_xaudio2_h
#include "../SDL_sysaudio.h"
#include <XAudio2.h>
/* Hidden "this" pointer for the audio functions */
#define _THIS SDL_AudioDevice *this
struct
SDL_PrivateAudioData
{
IXAudio2
*
ixa2
;
IXAudio2SourceVoice
*
source
;
IXAudio2MasteringVoice
*
mastering
;
HANDLE
semaphore
;
Uint8
*
mixbuf
;
int
mixlen
;
Uint8
*
nextbuf
;
};
#endif
/* _SDL_xaudio2_h */
/* vi: set ts=4 sw=4 expandtab: */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment