forked from Rust-SDL2/rust-sdl2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Rust-SDL2#782 from Rust-SDL2/unstable-build-rs-work
Move ffi into sys, update bindgen, build.rs and update to sdl2.0.8
- Loading branch information
Showing
130 changed files
with
32,692 additions
and
14,847 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
sdl2-sys/SDL2-2.0.6/include/SDL.h → sdl2-sys/SDL2-2.0.8/include/SDL.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
Simple DirectMedia Layer | ||
Copyright (C) 1997-2017 Sam Lantinga <[email protected]> | ||
Copyright (C) 1997-2018 Sam Lantinga <[email protected]> | ||
This software is provided 'as-is', without any express or implied | ||
warranty. In no event will the authors be held liable for any damages | ||
|
2 changes: 1 addition & 1 deletion
2
sdl2-sys/SDL2-2.0.6/include/SDL_assert.h → sdl2-sys/SDL2-2.0.8/include/SDL_assert.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
Simple DirectMedia Layer | ||
Copyright (C) 1997-2017 Sam Lantinga <[email protected]> | ||
Copyright (C) 1997-2018 Sam Lantinga <[email protected]> | ||
This software is provided 'as-is', without any express or implied | ||
warranty. In no event will the authors be held liable for any damages | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
Simple DirectMedia Layer | ||
Copyright (C) 1997-2017 Sam Lantinga <[email protected]> | ||
Copyright (C) 1997-2018 Sam Lantinga <[email protected]> | ||
This software is provided 'as-is', without any express or implied | ||
warranty. In no event will the authors be held liable for any damages | ||
|
@@ -158,6 +158,9 @@ extern DECLSPEC void SDLCALL SDL_MemoryBarrierAcquireFunction(void); | |
#if defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) | ||
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("lwsync" : : : "memory") | ||
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("lwsync" : : : "memory") | ||
#elif defined(__GNUC__) && defined(__aarch64__) | ||
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory") | ||
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory") | ||
#elif defined(__GNUC__) && defined(__arm__) | ||
#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) | ||
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
Simple DirectMedia Layer | ||
Copyright (C) 1997-2017 Sam Lantinga <[email protected]> | ||
Copyright (C) 1997-2018 Sam Lantinga <[email protected]> | ||
This software is provided 'as-is', without any express or implied | ||
warranty. In no event will the authors be held liable for any damages | ||
|
@@ -164,6 +164,15 @@ typedef void (SDLCALL * SDL_AudioCallback) (void *userdata, Uint8 * stream, | |
|
||
/** | ||
* The calculated values in this structure are calculated by SDL_OpenAudio(). | ||
* | ||
* For multi-channel audio, the default SDL channel mapping is: | ||
* 2: FL FR (stereo) | ||
* 3: FL FR LFE (2.1 surround) | ||
* 4: FL FR BL BR (quad) | ||
* 5: FL FR FC BL BR (quad + center) | ||
* 6: FL FR FC LFE SL SR (5.1 surround - last two can also be BL BR) | ||
* 7: FL FR FC LFE BC SL SR (6.1 surround) | ||
* 8: FL FR FC LFE BL BR SL SR (7.1 surround) | ||
*/ | ||
typedef struct SDL_AudioSpec | ||
{ | ||
|
@@ -477,6 +486,132 @@ extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT * cvt, | |
*/ | ||
extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT * cvt); | ||
|
||
/* SDL_AudioStream is a new audio conversion interface. | ||
The benefits vs SDL_AudioCVT: | ||
- it can handle resampling data in chunks without generating | ||
artifacts, when it doesn't have the complete buffer available. | ||
- it can handle incoming data in any variable size. | ||
- You push data as you have it, and pull it when you need it | ||
*/ | ||
/* this is opaque to the outside world. */ | ||
struct _SDL_AudioStream; | ||
typedef struct _SDL_AudioStream SDL_AudioStream; | ||
|
||
/** | ||
* Create a new audio stream | ||
* | ||
* \param src_format The format of the source audio | ||
* \param src_channels The number of channels of the source audio | ||
* \param src_rate The sampling rate of the source audio | ||
* \param dst_format The format of the desired audio output | ||
* \param dst_channels The number of channels of the desired audio output | ||
* \param dst_rate The sampling rate of the desired audio output | ||
* \return 0 on success, or -1 on error. | ||
* | ||
* \sa SDL_AudioStreamPut | ||
* \sa SDL_AudioStreamGet | ||
* \sa SDL_AudioStreamAvailable | ||
* \sa SDL_AudioStreamFlush | ||
* \sa SDL_AudioStreamClear | ||
* \sa SDL_FreeAudioStream | ||
*/ | ||
extern DECLSPEC SDL_AudioStream * SDLCALL SDL_NewAudioStream(const SDL_AudioFormat src_format, | ||
const Uint8 src_channels, | ||
const int src_rate, | ||
const SDL_AudioFormat dst_format, | ||
const Uint8 dst_channels, | ||
const int dst_rate); | ||
|
||
/** | ||
* Add data to be converted/resampled to the stream | ||
* | ||
* \param stream The stream the audio data is being added to | ||
* \param buf A pointer to the audio data to add | ||
* \param len The number of bytes to write to the stream | ||
* \return 0 on success, or -1 on error. | ||
* | ||
* \sa SDL_NewAudioStream | ||
* \sa SDL_AudioStreamGet | ||
* \sa SDL_AudioStreamAvailable | ||
* \sa SDL_AudioStreamFlush | ||
* \sa SDL_AudioStreamClear | ||
* \sa SDL_FreeAudioStream | ||
*/ | ||
extern DECLSPEC int SDLCALL SDL_AudioStreamPut(SDL_AudioStream *stream, const void *buf, int len); | ||
|
||
/** | ||
* Get converted/resampled data from the stream | ||
* | ||
* \param stream The stream the audio is being requested from | ||
* \param buf A buffer to fill with audio data | ||
* \param len The maximum number of bytes to fill | ||
* \return The number of bytes read from the stream, or -1 on error | ||
* | ||
* \sa SDL_NewAudioStream | ||
* \sa SDL_AudioStreamPut | ||
* \sa SDL_AudioStreamAvailable | ||
* \sa SDL_AudioStreamFlush | ||
* \sa SDL_AudioStreamClear | ||
* \sa SDL_FreeAudioStream | ||
*/ | ||
extern DECLSPEC int SDLCALL SDL_AudioStreamGet(SDL_AudioStream *stream, void *buf, int len); | ||
|
||
/** | ||
* Get the number of converted/resampled bytes available. The stream may be | ||
* buffering data behind the scenes until it has enough to resample | ||
* correctly, so this number might be lower than what you expect, or even | ||
* be zero. Add more data or flush the stream if you need the data now. | ||
* | ||
* \sa SDL_NewAudioStream | ||
* \sa SDL_AudioStreamPut | ||
* \sa SDL_AudioStreamGet | ||
* \sa SDL_AudioStreamFlush | ||
* \sa SDL_AudioStreamClear | ||
* \sa SDL_FreeAudioStream | ||
*/ | ||
extern DECLSPEC int SDLCALL SDL_AudioStreamAvailable(SDL_AudioStream *stream); | ||
|
||
/** | ||
* Tell the stream that you're done sending data, and anything being buffered | ||
* should be converted/resampled and made available immediately. | ||
* | ||
* It is legal to add more data to a stream after flushing, but there will | ||
* be audio gaps in the output. Generally this is intended to signal the | ||
* end of input, so the complete output becomes available. | ||
* | ||
* \sa SDL_NewAudioStream | ||
* \sa SDL_AudioStreamPut | ||
* \sa SDL_AudioStreamGet | ||
* \sa SDL_AudioStreamAvailable | ||
* \sa SDL_AudioStreamClear | ||
* \sa SDL_FreeAudioStream | ||
*/ | ||
extern DECLSPEC int SDLCALL SDL_AudioStreamFlush(SDL_AudioStream *stream); | ||
|
||
/** | ||
* Clear any pending data in the stream without converting it | ||
* | ||
* \sa SDL_NewAudioStream | ||
* \sa SDL_AudioStreamPut | ||
* \sa SDL_AudioStreamGet | ||
* \sa SDL_AudioStreamAvailable | ||
* \sa SDL_AudioStreamFlush | ||
* \sa SDL_FreeAudioStream | ||
*/ | ||
extern DECLSPEC void SDLCALL SDL_AudioStreamClear(SDL_AudioStream *stream); | ||
|
||
/** | ||
* Free an audio stream | ||
* | ||
* \sa SDL_NewAudioStream | ||
* \sa SDL_AudioStreamPut | ||
* \sa SDL_AudioStreamGet | ||
* \sa SDL_AudioStreamAvailable | ||
* \sa SDL_AudioStreamFlush | ||
* \sa SDL_AudioStreamClear | ||
*/ | ||
extern DECLSPEC void SDLCALL SDL_FreeAudioStream(SDL_AudioStream *stream); | ||
|
||
#define SDL_MIX_MAXVOLUME 128 | ||
/** | ||
* This takes two audio buffers of the playing audio format and mixes | ||
|
@@ -532,7 +667,7 @@ extern DECLSPEC void SDLCALL SDL_MixAudioFormat(Uint8 * dst, | |
* \param dev The device ID to which we will queue audio. | ||
* \param data The data to queue to the device for later playback. | ||
* \param len The number of bytes (not samples!) to which (data) points. | ||
* \return zero on success, -1 on error. | ||
* \return 0 on success, or -1 on error. | ||
* | ||
* \sa SDL_GetQueuedAudioSize | ||
* \sa SDL_ClearQueuedAudio | ||
|
2 changes: 1 addition & 1 deletion
2
sdl2-sys/SDL2-2.0.6/include/SDL_bits.h → sdl2-sys/SDL2-2.0.8/include/SDL_bits.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
Simple DirectMedia Layer | ||
Copyright (C) 1997-2017 Sam Lantinga <[email protected]> | ||
Copyright (C) 1997-2018 Sam Lantinga <[email protected]> | ||
This software is provided 'as-is', without any express or implied | ||
warranty. In no event will the authors be held liable for any damages | ||
|
2 changes: 1 addition & 1 deletion
2
sdl2-sys/SDL2-2.0.6/include/SDL_blendmode.h → sdl2-sys/SDL2-2.0.8/include/SDL_blendmode.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
Simple DirectMedia Layer | ||
Copyright (C) 1997-2017 Sam Lantinga <[email protected]> | ||
Copyright (C) 1997-2018 Sam Lantinga <[email protected]> | ||
This software is provided 'as-is', without any express or implied | ||
warranty. In no event will the authors be held liable for any damages | ||
|
2 changes: 1 addition & 1 deletion
2
sdl2-sys/SDL2-2.0.6/include/SDL_clipboard.h → sdl2-sys/SDL2-2.0.8/include/SDL_clipboard.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
Simple DirectMedia Layer | ||
Copyright (C) 1997-2017 Sam Lantinga <[email protected]> | ||
Copyright (C) 1997-2018 Sam Lantinga <[email protected]> | ||
This software is provided 'as-is', without any express or implied | ||
warranty. In no event will the authors be held liable for any damages | ||
|
2 changes: 1 addition & 1 deletion
2
sdl2-sys/SDL2-2.0.6/include/SDL_config.h → sdl2-sys/SDL2-2.0.8/include/SDL_config.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
Simple DirectMedia Layer | ||
Copyright (C) 1997-2017 Sam Lantinga <[email protected]> | ||
Copyright (C) 1997-2018 Sam Lantinga <[email protected]> | ||
This software is provided 'as-is', without any express or implied | ||
warranty. In no event will the authors be held liable for any damages | ||
|
Oops, something went wrong.