mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2025-01-26 12:59:18 +01:00
Merged 'default' into branch 'iOS-improvements'
This commit is contained in:
commit
bde54b7f34
@ -76,6 +76,7 @@ test/Makefile
|
|||||||
test/SDL2.dll
|
test/SDL2.dll
|
||||||
test/checkkeys
|
test/checkkeys
|
||||||
test/loopwave
|
test/loopwave
|
||||||
|
test/loopwavequeue
|
||||||
test/testatomic
|
test/testatomic
|
||||||
test/testaudioinfo
|
test/testaudioinfo
|
||||||
test/testautomation
|
test/testautomation
|
||||||
|
@ -9,7 +9,7 @@ To compile and install SDL:
|
|||||||
* Run './configure; make; make install'
|
* Run './configure; make; make install'
|
||||||
|
|
||||||
Mac OS X with Xcode:
|
Mac OS X with Xcode:
|
||||||
* Read README-macosx.txt
|
* Read docs/README-macosx.md
|
||||||
|
|
||||||
Mac OS X from the command line:
|
Mac OS X from the command line:
|
||||||
* Run './configure; make; make install'
|
* Run './configure; make; make install'
|
||||||
@ -18,13 +18,13 @@ To compile and install SDL:
|
|||||||
* Run './configure; make; make install'
|
* Run './configure; make; make install'
|
||||||
|
|
||||||
Android:
|
Android:
|
||||||
* Read README-android.txt
|
* Read docs/README-android.md
|
||||||
|
|
||||||
iOS:
|
iOS:
|
||||||
* Read README-ios.txt
|
* Read docs/README-ios.md
|
||||||
|
|
||||||
Using Cmake:
|
Using Cmake:
|
||||||
* Read README-cmake.txt
|
* Read docs/README-cmake.md
|
||||||
|
|
||||||
2. Look at the example programs in ./test, and check out the online
|
2. Look at the example programs in ./test, and check out the online
|
||||||
documentation at http://wiki.libsdl.org/
|
documentation at http://wiki.libsdl.org/
|
||||||
|
25
README.txt
25
README.txt
@ -14,29 +14,8 @@ hardware via OpenGL and Direct3D. It is used by video playback software,
|
|||||||
emulators, and popular games including Valve's award winning catalog
|
emulators, and popular games including Valve's award winning catalog
|
||||||
and many Humble Bundle games.
|
and many Humble Bundle games.
|
||||||
|
|
||||||
SDL officially supports Windows, Mac OS X, Linux, iOS, and Android.
|
More extensive documentation is available in the docs directory, starting
|
||||||
Support for other platforms may be found in the source code.
|
with README.md
|
||||||
|
|
||||||
SDL is written in C, works natively with C++, and there are bindings
|
|
||||||
available for several other languages, including C# and Python.
|
|
||||||
|
|
||||||
This library is distributed under the zlib license, which can be found
|
|
||||||
in the file "COPYING.txt".
|
|
||||||
|
|
||||||
The best way to learn how to use SDL is to check out the header files in
|
|
||||||
the "include" subdirectory and the programs in the "test" subdirectory.
|
|
||||||
The header files and test programs are well commented and always up to date.
|
|
||||||
More documentation and FAQs are available online at:
|
|
||||||
http://wiki.libsdl.org/
|
|
||||||
|
|
||||||
If you need help with the library, or just want to discuss SDL related
|
|
||||||
issues, you can join the developers mailing list:
|
|
||||||
http://www.libsdl.org/mailing-list.php
|
|
||||||
|
|
||||||
If you want to report bugs or contribute patches, please submit them to
|
|
||||||
bugzilla:
|
|
||||||
http://bugzilla.libsdl.org/
|
|
||||||
|
|
||||||
Enjoy!
|
Enjoy!
|
||||||
Sam Lantinga (slouken@libsdl.org)
|
Sam Lantinga (slouken@libsdl.org)
|
||||||
|
|
||||||
|
@ -61,6 +61,7 @@
|
|||||||
Detect64BitPortabilityProblems="false"
|
Detect64BitPortabilityProblems="false"
|
||||||
DebugInformationFormat="4"
|
DebugInformationFormat="4"
|
||||||
CompileAs="0"
|
CompileAs="0"
|
||||||
|
OmitDefaultLibName="true"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
@ -144,6 +145,7 @@
|
|||||||
Detect64BitPortabilityProblems="false"
|
Detect64BitPortabilityProblems="false"
|
||||||
DebugInformationFormat="4"
|
DebugInformationFormat="4"
|
||||||
CompileAs="0"
|
CompileAs="0"
|
||||||
|
OmitDefaultLibName="true"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
@ -232,6 +234,7 @@
|
|||||||
Detect64BitPortabilityProblems="false"
|
Detect64BitPortabilityProblems="false"
|
||||||
DebugInformationFormat="3"
|
DebugInformationFormat="3"
|
||||||
CompileAs="0"
|
CompileAs="0"
|
||||||
|
OmitDefaultLibName="true"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
@ -320,6 +323,7 @@
|
|||||||
Detect64BitPortabilityProblems="false"
|
Detect64BitPortabilityProblems="false"
|
||||||
DebugInformationFormat="3"
|
DebugInformationFormat="3"
|
||||||
CompileAs="0"
|
CompileAs="0"
|
||||||
|
OmitDefaultLibName="true"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
@ -94,6 +94,7 @@
|
|||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
|
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ResourceCompile>
|
<ResourceCompile>
|
||||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
@ -127,6 +128,7 @@
|
|||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ResourceCompile>
|
<ResourceCompile>
|
||||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
@ -167,6 +169,7 @@
|
|||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
|
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ResourceCompile>
|
<ResourceCompile>
|
||||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
@ -203,6 +206,7 @@
|
|||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ResourceCompile>
|
<ResourceCompile>
|
||||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
@ -98,6 +98,7 @@
|
|||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
|
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ResourceCompile>
|
<ResourceCompile>
|
||||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
@ -131,6 +132,7 @@
|
|||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ResourceCompile>
|
<ResourceCompile>
|
||||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
@ -171,6 +173,7 @@
|
|||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
|
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ResourceCompile>
|
<ResourceCompile>
|
||||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
@ -207,6 +210,7 @@
|
|||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ResourceCompile>
|
<ResourceCompile>
|
||||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
@ -98,6 +98,7 @@
|
|||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
|
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ResourceCompile>
|
<ResourceCompile>
|
||||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
@ -131,6 +132,7 @@
|
|||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ResourceCompile>
|
<ResourceCompile>
|
||||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
@ -171,6 +173,7 @@
|
|||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
|
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ResourceCompile>
|
<ResourceCompile>
|
||||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
@ -207,6 +210,7 @@
|
|||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ResourceCompile>
|
<ResourceCompile>
|
||||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
@ -56,6 +56,7 @@
|
|||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
DebugInformationFormat="1"
|
DebugInformationFormat="1"
|
||||||
CompileAs="0"
|
CompileAs="0"
|
||||||
|
OmitDefaultLibName="true"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
@ -123,6 +124,7 @@
|
|||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
DebugInformationFormat="1"
|
DebugInformationFormat="1"
|
||||||
CompileAs="0"
|
CompileAs="0"
|
||||||
|
OmitDefaultLibName="true"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
@ -316,6 +318,7 @@
|
|||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
DebugInformationFormat="1"
|
DebugInformationFormat="1"
|
||||||
CompileAs="0"
|
CompileAs="0"
|
||||||
|
OmitDefaultLibName="true"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
@ -381,6 +384,7 @@
|
|||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
DebugInformationFormat="1"
|
DebugInformationFormat="1"
|
||||||
CompileAs="0"
|
CompileAs="0"
|
||||||
|
OmitDefaultLibName="true"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
@ -87,6 +87,7 @@
|
|||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Lib>
|
<Lib>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
@ -110,6 +111,7 @@
|
|||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Lib>
|
<Lib>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
@ -129,6 +131,7 @@
|
|||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Lib>
|
<Lib>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
@ -150,6 +153,7 @@
|
|||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Lib>
|
<Lib>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
@ -91,6 +91,7 @@
|
|||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Lib>
|
<Lib>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
@ -114,6 +115,7 @@
|
|||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Lib>
|
<Lib>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
@ -133,6 +135,7 @@
|
|||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Lib>
|
<Lib>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
@ -154,6 +157,7 @@
|
|||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Lib>
|
<Lib>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
@ -91,6 +91,7 @@
|
|||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Lib>
|
<Lib>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
@ -114,6 +115,7 @@
|
|||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Lib>
|
<Lib>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
@ -133,6 +135,7 @@
|
|||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Lib>
|
<Lib>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
@ -154,6 +157,7 @@
|
|||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Lib>
|
<Lib>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
@ -56,6 +56,7 @@
|
|||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
DebugInformationFormat="1"
|
DebugInformationFormat="1"
|
||||||
CompileAs="0"
|
CompileAs="0"
|
||||||
|
OmitDefaultLibName="true"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
@ -123,6 +124,7 @@
|
|||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
DebugInformationFormat="1"
|
DebugInformationFormat="1"
|
||||||
CompileAs="0"
|
CompileAs="0"
|
||||||
|
OmitDefaultLibName="true"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
@ -316,6 +318,7 @@
|
|||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
DebugInformationFormat="1"
|
DebugInformationFormat="1"
|
||||||
CompileAs="0"
|
CompileAs="0"
|
||||||
|
OmitDefaultLibName="true"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
@ -381,6 +384,7 @@
|
|||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
DebugInformationFormat="1"
|
DebugInformationFormat="1"
|
||||||
CompileAs="0"
|
CompileAs="0"
|
||||||
|
OmitDefaultLibName="true"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
@ -87,6 +87,7 @@
|
|||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Lib>
|
<Lib>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
@ -110,6 +111,7 @@
|
|||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Lib>
|
<Lib>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
@ -129,6 +131,7 @@
|
|||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Lib>
|
<Lib>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
@ -150,6 +153,7 @@
|
|||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Lib>
|
<Lib>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
@ -91,6 +91,7 @@
|
|||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Lib>
|
<Lib>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
@ -114,6 +115,7 @@
|
|||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Lib>
|
<Lib>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
@ -133,6 +135,7 @@
|
|||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Lib>
|
<Lib>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
@ -154,6 +157,7 @@
|
|||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Lib>
|
<Lib>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
@ -91,6 +91,7 @@
|
|||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Lib>
|
<Lib>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
@ -114,6 +115,7 @@
|
|||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Lib>
|
<Lib>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
@ -133,6 +135,7 @@
|
|||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Lib>
|
<Lib>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
@ -154,6 +157,7 @@
|
|||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
|
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Lib>
|
<Lib>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
================================================================================
|
Android
|
||||||
Simple DirectMedia Layer for Android
|
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
Requirements:
|
Requirements:
|
@ -1,6 +1,6 @@
|
|||||||
|
CMake
|
||||||
================================================================================
|
================================================================================
|
||||||
CMake build system for SDL (www.cmake.org)
|
(www.cmake.org)
|
||||||
================================================================================
|
|
||||||
|
|
||||||
SDL's build system was traditionally based on autotools. Over time, this
|
SDL's build system was traditionally based on autotools. Over time, this
|
||||||
approach has suffered from several issues across the different supported
|
approach has suffered from several issues across the different supported
|
@ -1,4 +1,5 @@
|
|||||||
SDL on DirectFB
|
DirectFB
|
||||||
|
========
|
||||||
|
|
||||||
Supports:
|
Supports:
|
||||||
|
|
@ -1,4 +1,3 @@
|
|||||||
================================================================================
|
|
||||||
Dynamic API
|
Dynamic API
|
||||||
================================================================================
|
================================================================================
|
||||||
Originally posted by Ryan at https://plus.google.com/103391075724026391227/posts/TB8UfnDYu4U
|
Originally posted by Ryan at https://plus.google.com/103391075724026391227/posts/TB8UfnDYu4U
|
@ -1,4 +1,3 @@
|
|||||||
===========================================================================
|
|
||||||
Dollar Gestures
|
Dollar Gestures
|
||||||
===========================================================================
|
===========================================================================
|
||||||
SDL Provides an implementation of the $1 gesture recognition system. This allows for recording, saving, loading, and performing single stroke gestures.
|
SDL Provides an implementation of the $1 gesture recognition system. This allows for recording, saving, loading, and performing single stroke gestures.
|
@ -1,3 +1,6 @@
|
|||||||
|
Mercurial
|
||||||
|
=========
|
||||||
|
|
||||||
The latest development version of SDL is available via Mercurial.
|
The latest development version of SDL is available via Mercurial.
|
||||||
Mercurial allows you to get up-to-the-minute fixes and enhancements;
|
Mercurial allows you to get up-to-the-minute fixes and enhancements;
|
||||||
as a developer works on a source tree, you can use "hg" to mirror that
|
as a developer works on a source tree, you can use "hg" to mirror that
|
@ -1,3 +1,6 @@
|
|||||||
|
iOS
|
||||||
|
======
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
Building the Simple DirectMedia Layer for iPhone OS 5.1
|
Building the Simple DirectMedia Layer for iPhone OS 5.1
|
||||||
==============================================================================
|
==============================================================================
|
@ -1,5 +1,4 @@
|
|||||||
================================================================================
|
Linux
|
||||||
Simple DirectMedia Layer for Linux
|
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
By default SDL will only link against glibc, the rest of the features will be
|
By default SDL will only link against glibc, the rest of the features will be
|
@ -1,5 +1,4 @@
|
|||||||
==============================================================================
|
Mac OS X
|
||||||
Using the Simple DirectMedia Layer with Mac OS X
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
|
||||||
These instructions are for people using Apple's Mac OS X (pronounced
|
These instructions are for people using Apple's Mac OS X (pronounced
|
@ -1,5 +1,4 @@
|
|||||||
================================================================================
|
Native Client
|
||||||
Simple DirectMedia Layer for Native Client
|
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
Requirements:
|
Requirements:
|
@ -1,6 +1,7 @@
|
|||||||
SDL 2.0 with open pandora console support ( http://openpandora.org/ )
|
Pandora
|
||||||
=====================================================================
|
=====================================================================
|
||||||
|
|
||||||
|
( http://openpandora.org/ )
|
||||||
- A pandora specific video driver was written to allow SDL 2.0 with OpenGL ES
|
- A pandora specific video driver was written to allow SDL 2.0 with OpenGL ES
|
||||||
support to work on the pandora under the framebuffer. This driver do not have
|
support to work on the pandora under the framebuffer. This driver do not have
|
||||||
input support for now, so if you use it you will have to add your own control code.
|
input support for now, so if you use it you will have to add your own control code.
|
@ -1,3 +1,6 @@
|
|||||||
|
Platforms
|
||||||
|
=========
|
||||||
|
|
||||||
|
|
||||||
This is a list of the platforms SDL supports, and who maintains them.
|
This is a list of the platforms SDL supports, and who maintains them.
|
||||||
|
|
@ -1,3 +1,5 @@
|
|||||||
|
Porting
|
||||||
|
=======
|
||||||
|
|
||||||
* Porting To A New Platform
|
* Porting To A New Platform
|
||||||
|
|
@ -1,3 +1,5 @@
|
|||||||
|
PSP
|
||||||
|
======
|
||||||
SDL port for the Sony PSP contributed by
|
SDL port for the Sony PSP contributed by
|
||||||
Captian Lex
|
Captian Lex
|
||||||
|
|
@ -1,5 +1,4 @@
|
|||||||
================================================================================
|
Raspberry Pi
|
||||||
SDL2 for Raspberry Pi
|
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
Requirements:
|
Requirements:
|
@ -1,3 +1,4 @@
|
|||||||
|
Touch
|
||||||
===========================================================================
|
===========================================================================
|
||||||
System Specific Notes
|
System Specific Notes
|
||||||
===========================================================================
|
===========================================================================
|
@ -1,3 +1,5 @@
|
|||||||
|
WinCE
|
||||||
|
=====
|
||||||
|
|
||||||
Windows CE is no longer supported by SDL.
|
Windows CE is no longer supported by SDL.
|
||||||
|
|
@ -1,5 +1,4 @@
|
|||||||
================================================================================
|
Windows
|
||||||
Simple DirectMedia Layer for Windows
|
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
@ -1,5 +1,4 @@
|
|||||||
================================================================================
|
WinRT
|
||||||
Simple DirectMedia Layer for WinRT
|
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
SDL/WinRT layer allows SDL2-based applications to run on many of Microsoft's
|
SDL/WinRT layer allows SDL2-based applications to run on many of Microsoft's
|
62
docs/README.md
Normal file
62
docs/README.md
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
Simple DirectMedia Layer {#mainpage}
|
||||||
|
========================
|
||||||
|
|
||||||
|
(SDL)
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
---
|
||||||
|
http://www.libsdl.org/
|
||||||
|
|
||||||
|
Simple DirectMedia Layer is a cross-platform development library designed
|
||||||
|
to provide low level access to audio, keyboard, mouse, joystick, and graphics
|
||||||
|
hardware via OpenGL and Direct3D. It is used by video playback software,
|
||||||
|
emulators, and popular games including Valve's award winning catalog
|
||||||
|
and many Humble Bundle games. 42
|
||||||
|
|
||||||
|
SDL officially supports Windows, Mac OS X, Linux, iOS, and Android.
|
||||||
|
Support for other platforms may be found in the source code.
|
||||||
|
|
||||||
|
SDL is written in C, works natively with C++, and there are bindings
|
||||||
|
available for several other languages, including C# and Python.
|
||||||
|
|
||||||
|
This library is distributed under the zlib license, which can be found
|
||||||
|
in the file "COPYING.txt".
|
||||||
|
|
||||||
|
The best way to learn how to use SDL is to check out the header files in
|
||||||
|
the "include" subdirectory and the programs in the "test" subdirectory.
|
||||||
|
The header files and test programs are well commented and always up to date.
|
||||||
|
|
||||||
|
More documentation and FAQs are available online at [the wiki](http://wiki.libsdl.org/)
|
||||||
|
|
||||||
|
- [Android](README-android.md)
|
||||||
|
- [CMake](README-cmake.md)
|
||||||
|
- [DirectFB](README-directfb.md)
|
||||||
|
- [DynAPI](README-dynapi.md)
|
||||||
|
- [Gesture](README-gesture.md)
|
||||||
|
- [Mercurial](README-hg.md)
|
||||||
|
- [iOS](README-ios.md)
|
||||||
|
- [Linux](README-linux.md)
|
||||||
|
- [OS X](README-macosx.md)
|
||||||
|
- [Native Client](README-nacl.md)
|
||||||
|
- [Pandora](README-pandora.md)
|
||||||
|
- [Supported Platforms](README-platforms.md)
|
||||||
|
- [Porting information](README-porting.md)
|
||||||
|
- [PSP](README-psp.md)
|
||||||
|
- [Raspberry Pi](README-raspberrypi.md)
|
||||||
|
- [Touch](README-touch.md)
|
||||||
|
- [WinCE](README-wince.md)
|
||||||
|
- [Windows](README-windows.md)
|
||||||
|
- [WinRT](README-winrt.md)
|
||||||
|
|
||||||
|
If you need help with the library, or just want to discuss SDL related
|
||||||
|
issues, you can join the [developers mailing list](http://www.libsdl.org/mailing-list.php)
|
||||||
|
|
||||||
|
If you want to report bugs or contribute patches, please submit them to
|
||||||
|
[bugzilla](http://bugzilla.libsdl.org/)
|
||||||
|
|
||||||
|
Enjoy!
|
||||||
|
|
||||||
|
|
||||||
|
Sam Lantinga <mailto:slouken@libsdl.org>
|
||||||
|
|
@ -38,7 +38,7 @@ PROJECT_NUMBER = 2.0.0
|
|||||||
# If a relative path is entered, it will be relative to the location
|
# If a relative path is entered, it will be relative to the location
|
||||||
# where doxygen was started. If left blank the current directory will be used.
|
# where doxygen was started. If left blank the current directory will be used.
|
||||||
|
|
||||||
OUTPUT_DIRECTORY = .
|
OUTPUT_DIRECTORY = ./output
|
||||||
|
|
||||||
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
|
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
|
||||||
# 4096 sub-directories (in 2 levels) under the output directory of each output
|
# 4096 sub-directories (in 2 levels) under the output directory of each output
|
||||||
@ -569,7 +569,7 @@ WARN_LOGFILE = ./doxygen_warn.txt
|
|||||||
# directories like "/usr/src/myproject". Separate the files or directories
|
# directories like "/usr/src/myproject". Separate the files or directories
|
||||||
# with spaces.
|
# with spaces.
|
||||||
|
|
||||||
INPUT = .
|
INPUT = . ../include
|
||||||
|
|
||||||
# This tag can be used to specify the character encoding of the source files
|
# This tag can be used to specify the character encoding of the source files
|
||||||
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
|
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
|
||||||
@ -618,7 +618,8 @@ FILE_PATTERNS = *.c \
|
|||||||
*.vhd \
|
*.vhd \
|
||||||
*.vhdl \
|
*.vhdl \
|
||||||
*.h.in \
|
*.h.in \
|
||||||
*.h.default
|
*.h.default \
|
||||||
|
*.md
|
||||||
|
|
||||||
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
|
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
|
||||||
# should be searched for input files as well. Possible values are YES and NO.
|
# should be searched for input files as well. Possible values are YES and NO.
|
||||||
@ -630,12 +631,15 @@ RECURSIVE = YES
|
|||||||
# excluded from the INPUT source files. This way you can easily exclude a
|
# excluded from the INPUT source files. This way you can easily exclude a
|
||||||
# subdirectory from a directory tree whose root is specified with the INPUT tag.
|
# subdirectory from a directory tree whose root is specified with the INPUT tag.
|
||||||
|
|
||||||
EXCLUDE = ../doxy \
|
EXCLUDE = ../include/SDL_opengles2_gl2ext.h \
|
||||||
../test \
|
../include/SDL_opengles2_gl2platform.h \
|
||||||
../Xcode \
|
../include/SDL_opengles2_khrplatform.h \
|
||||||
../VisualC \
|
../include/SDL_opengl_glext.h \
|
||||||
../VisualCE \
|
../include/SDL_opengles2_gl2.h \
|
||||||
../Xcode-iOS
|
../include/SDL_opengles2.h \
|
||||||
|
../include/SDL_opengles.h \
|
||||||
|
../include/SDL_opengl.h \
|
||||||
|
|
||||||
|
|
||||||
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
|
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
|
||||||
# directories that are symbolic links (a Unix filesystem feature) are excluded
|
# directories that are symbolic links (a Unix filesystem feature) are excluded
|
@ -25,41 +25,6 @@
|
|||||||
* Main include header for the SDL library
|
* Main include header for the SDL library
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* \mainpage Simple DirectMedia Layer (SDL)
|
|
||||||
*
|
|
||||||
* http://www.libsdl.org/
|
|
||||||
*
|
|
||||||
* \section intro_sec Introduction
|
|
||||||
*
|
|
||||||
* Simple DirectMedia Layer is a cross-platform development library designed
|
|
||||||
* to provide low level access to audio, keyboard, mouse, joystick, and
|
|
||||||
* graphics hardware via OpenGL and Direct3D. It is used by video playback
|
|
||||||
* software, emulators, and popular games including Valve's award winning
|
|
||||||
* catalog and many Humble Bundle games.
|
|
||||||
*
|
|
||||||
* SDL officially supports Windows, Mac OS X, Linux, iOS, and Android.
|
|
||||||
* Support for other platforms may be found in the source code.
|
|
||||||
*
|
|
||||||
* SDL is written in C, works natively with C++, and there are bindings
|
|
||||||
* available for several other languages, including C# and Python.
|
|
||||||
*
|
|
||||||
* This library is distributed under the zlib license, which can be found
|
|
||||||
* in the file "COPYING.txt".
|
|
||||||
*
|
|
||||||
* The best way to learn how to use SDL is to check out the header files in
|
|
||||||
* the "include" subdirectory and the programs in the "test" subdirectory.
|
|
||||||
* The header files and test programs are well commented and always up to date.
|
|
||||||
* More documentation and FAQs are available online at:
|
|
||||||
* http://wiki.libsdl.org/
|
|
||||||
*
|
|
||||||
* If you need help with the library, or just want to discuss SDL related
|
|
||||||
* issues, you can join the developers mailing list:
|
|
||||||
* http://www.libsdl.org/mailing-list.php
|
|
||||||
*
|
|
||||||
* Enjoy!
|
|
||||||
* Sam Lantinga (slouken@libsdl.org)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _SDL_H
|
#ifndef _SDL_H
|
||||||
#define _SDL_H
|
#define _SDL_H
|
||||||
|
@ -141,16 +141,13 @@ extern DECLSPEC SDL_assert_state SDLCALL SDL_ReportAssertion(SDL_assert_data *,
|
|||||||
#define SDL_enabled_assert(condition) \
|
#define SDL_enabled_assert(condition) \
|
||||||
do { \
|
do { \
|
||||||
while ( !(condition) ) { \
|
while ( !(condition) ) { \
|
||||||
static struct SDL_assert_data assert_data = { \
|
static struct SDL_assert_data sdl_assert_data = { \
|
||||||
0, 0, #condition, 0, 0, 0, 0 \
|
0, 0, #condition, 0, 0, 0, 0 \
|
||||||
}; \
|
}; \
|
||||||
const SDL_assert_state state = SDL_ReportAssertion(&assert_data, \
|
const SDL_assert_state sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \
|
||||||
SDL_FUNCTION, \
|
if (sdl_assert_state == SDL_ASSERTION_RETRY) { \
|
||||||
SDL_FILE, \
|
|
||||||
SDL_LINE); \
|
|
||||||
if (state == SDL_ASSERTION_RETRY) { \
|
|
||||||
continue; /* go again. */ \
|
continue; /* go again. */ \
|
||||||
} else if (state == SDL_ASSERTION_BREAK) { \
|
} else if (sdl_assert_state == SDL_ASSERTION_BREAK) { \
|
||||||
SDL_TriggerBreakpoint(); \
|
SDL_TriggerBreakpoint(); \
|
||||||
} \
|
} \
|
||||||
break; /* not retrying. */ \
|
break; /* not retrying. */ \
|
||||||
|
@ -155,6 +155,9 @@ typedef Uint16 SDL_AudioFormat;
|
|||||||
*
|
*
|
||||||
* Once the callback returns, the buffer will no longer be valid.
|
* Once the callback returns, the buffer will no longer be valid.
|
||||||
* Stereo samples are stored in a LRLRLR ordering.
|
* Stereo samples are stored in a LRLRLR ordering.
|
||||||
|
*
|
||||||
|
* You can choose to avoid callbacks and use SDL_QueueAudio() instead, if
|
||||||
|
* you like. Just open your audio device with a NULL callback.
|
||||||
*/
|
*/
|
||||||
typedef void (SDLCALL * SDL_AudioCallback) (void *userdata, Uint8 * stream,
|
typedef void (SDLCALL * SDL_AudioCallback) (void *userdata, Uint8 * stream,
|
||||||
int len);
|
int len);
|
||||||
@ -171,8 +174,8 @@ typedef struct SDL_AudioSpec
|
|||||||
Uint16 samples; /**< Audio buffer size in samples (power of 2) */
|
Uint16 samples; /**< Audio buffer size in samples (power of 2) */
|
||||||
Uint16 padding; /**< Necessary for some compile environments */
|
Uint16 padding; /**< Necessary for some compile environments */
|
||||||
Uint32 size; /**< Audio buffer size in bytes (calculated) */
|
Uint32 size; /**< Audio buffer size in bytes (calculated) */
|
||||||
SDL_AudioCallback callback;
|
SDL_AudioCallback callback; /**< Callback that feeds the audio device (NULL to use SDL_QueueAudio()). */
|
||||||
void *userdata;
|
void *userdata; /**< Userdata passed to callback (ignored for NULL callbacks). */
|
||||||
} SDL_AudioSpec;
|
} SDL_AudioSpec;
|
||||||
|
|
||||||
|
|
||||||
@ -273,9 +276,11 @@ extern DECLSPEC const char *SDLCALL SDL_GetCurrentAudioDriver(void);
|
|||||||
* to the audio buffer, and the length in bytes of the audio buffer.
|
* to the audio buffer, and the length in bytes of the audio buffer.
|
||||||
* This function usually runs in a separate thread, and so you should
|
* This function usually runs in a separate thread, and so you should
|
||||||
* protect data structures that it accesses by calling SDL_LockAudio()
|
* protect data structures that it accesses by calling SDL_LockAudio()
|
||||||
* and SDL_UnlockAudio() in your code.
|
* and SDL_UnlockAudio() in your code. Alternately, you may pass a NULL
|
||||||
|
* pointer here, and call SDL_QueueAudio() with some frequency, to queue
|
||||||
|
* more audio samples to be played.
|
||||||
* - \c desired->userdata is passed as the first parameter to your callback
|
* - \c desired->userdata is passed as the first parameter to your callback
|
||||||
* function.
|
* function. If you passed a NULL callback, this value is ignored.
|
||||||
*
|
*
|
||||||
* The audio device starts out playing silence when it's opened, and should
|
* The audio device starts out playing silence when it's opened, and should
|
||||||
* be enabled for playing by calling \c SDL_PauseAudio(0) when you are ready
|
* be enabled for playing by calling \c SDL_PauseAudio(0) when you are ready
|
||||||
@ -474,6 +479,100 @@ extern DECLSPEC void SDLCALL SDL_MixAudioFormat(Uint8 * dst,
|
|||||||
SDL_AudioFormat format,
|
SDL_AudioFormat format,
|
||||||
Uint32 len, int volume);
|
Uint32 len, int volume);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Queue more audio on non-callback devices.
|
||||||
|
*
|
||||||
|
* SDL offers two ways to feed audio to the device: you can either supply a
|
||||||
|
* callback that SDL triggers with some frequency to obtain more audio
|
||||||
|
* (pull method), or you can supply no callback, and then SDL will expect
|
||||||
|
* you to supply data at regular intervals (push method) with this function.
|
||||||
|
*
|
||||||
|
* There are no limits on the amount of data you can queue, short of
|
||||||
|
* exhaustion of address space. Queued data will drain to the device as
|
||||||
|
* necessary without further intervention from you. If the device needs
|
||||||
|
* audio but there is not enough queued, it will play silence to make up
|
||||||
|
* the difference. This means you will have skips in your audio playback
|
||||||
|
* if you aren't routinely queueing sufficient data.
|
||||||
|
*
|
||||||
|
* This function copies the supplied data, so you are safe to free it when
|
||||||
|
* the function returns. This function is thread-safe, but queueing to the
|
||||||
|
* same device from two threads at once does not promise which buffer will
|
||||||
|
* be queued first.
|
||||||
|
*
|
||||||
|
* You may not queue audio on a device that is using an application-supplied
|
||||||
|
* callback; doing so returns an error. You have to use the audio callback
|
||||||
|
* or queue audio with this function, but not both.
|
||||||
|
*
|
||||||
|
* You should not call SDL_LockAudio() on the device before queueing; SDL
|
||||||
|
* handles locking internally for this function.
|
||||||
|
*
|
||||||
|
* \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.
|
||||||
|
*
|
||||||
|
* \sa SDL_GetQueuedAudioSize
|
||||||
|
* \sa SDL_ClearQueuedAudio
|
||||||
|
*/
|
||||||
|
extern DECLSPEC int SDLCALL SDL_QueueAudio(SDL_AudioDeviceID dev, const void *data, Uint32 len);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the number of bytes of still-queued audio.
|
||||||
|
*
|
||||||
|
* This is the number of bytes that have been queued for playback with
|
||||||
|
* SDL_QueueAudio(), but have not yet been sent to the hardware.
|
||||||
|
*
|
||||||
|
* Once we've sent it to the hardware, this function can not decide the exact
|
||||||
|
* byte boundary of what has been played. It's possible that we just gave the
|
||||||
|
* hardware several kilobytes right before you called this function, but it
|
||||||
|
* hasn't played any of it yet, or maybe half of it, etc.
|
||||||
|
*
|
||||||
|
* You may not queue audio on a device that is using an application-supplied
|
||||||
|
* callback; calling this function on such a device always returns 0.
|
||||||
|
* You have to use the audio callback or queue audio with SDL_QueueAudio(),
|
||||||
|
* but not both.
|
||||||
|
*
|
||||||
|
* You should not call SDL_LockAudio() on the device before querying; SDL
|
||||||
|
* handles locking internally for this function.
|
||||||
|
*
|
||||||
|
* \param dev The device ID of which we will query queued audio size.
|
||||||
|
* \return Number of bytes (not samples!) of queued audio.
|
||||||
|
*
|
||||||
|
* \sa SDL_QueueAudio
|
||||||
|
* \sa SDL_ClearQueuedAudio
|
||||||
|
*/
|
||||||
|
extern DECLSPEC Uint32 SDLCALL SDL_GetQueuedAudioSize(SDL_AudioDeviceID dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Drop any queued audio data waiting to be sent to the hardware.
|
||||||
|
*
|
||||||
|
* Immediately after this call, SDL_GetQueuedAudioSize() will return 0 and
|
||||||
|
* the hardware will start playing silence if more audio isn't queued.
|
||||||
|
*
|
||||||
|
* This will not prevent playback of queued audio that's already been sent
|
||||||
|
* to the hardware, as we can not undo that, so expect there to be some
|
||||||
|
* fraction of a second of audio that might still be heard. This can be
|
||||||
|
* useful if you want to, say, drop any pending music during a level change
|
||||||
|
* in your game.
|
||||||
|
*
|
||||||
|
* You may not queue audio on a device that is using an application-supplied
|
||||||
|
* callback; calling this function on such a device is always a no-op.
|
||||||
|
* You have to use the audio callback or queue audio with SDL_QueueAudio(),
|
||||||
|
* but not both.
|
||||||
|
*
|
||||||
|
* You should not call SDL_LockAudio() on the device before clearing the
|
||||||
|
* queue; SDL handles locking internally for this function.
|
||||||
|
*
|
||||||
|
* This function always succeeds and thus returns void.
|
||||||
|
*
|
||||||
|
* \param dev The device ID of which to clear the audio queue.
|
||||||
|
*
|
||||||
|
* \sa SDL_QueueAudio
|
||||||
|
* \sa SDL_GetQueuedAudioSize
|
||||||
|
*/
|
||||||
|
extern DECLSPEC void SDLCALL SDL_ClearQueuedAudio(SDL_AudioDeviceID dev);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \name Audio lock functions
|
* \name Audio lock functions
|
||||||
*
|
*
|
||||||
|
@ -178,6 +178,12 @@ SDL_AudioPlayDevice_Default(_THIS)
|
|||||||
{ /* no-op. */
|
{ /* no-op. */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
SDL_AudioGetPendingBytes_Default(_THIS)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static Uint8 *
|
static Uint8 *
|
||||||
SDL_AudioGetDeviceBuf_Default(_THIS)
|
SDL_AudioGetDeviceBuf_Default(_THIS)
|
||||||
{
|
{
|
||||||
@ -205,23 +211,35 @@ SDL_AudioOpenDevice_Default(_THIS, const char *devname, int iscapture)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static SDL_INLINE SDL_bool
|
||||||
|
is_in_audio_device_thread(SDL_AudioDevice * device)
|
||||||
|
{
|
||||||
|
/* The device thread locks the same mutex, but not through the public API.
|
||||||
|
This check is in case the application, in the audio callback,
|
||||||
|
tries to lock the thread that we've already locked from the
|
||||||
|
device thread...just in case we only have non-recursive mutexes. */
|
||||||
|
if (device->thread && (SDL_ThreadID() == device->threadid)) {
|
||||||
|
return SDL_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return SDL_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
SDL_AudioLockDevice_Default(SDL_AudioDevice * device)
|
SDL_AudioLockDevice_Default(SDL_AudioDevice * device)
|
||||||
{
|
{
|
||||||
if (device->thread && (SDL_ThreadID() == device->threadid)) {
|
if (!is_in_audio_device_thread(device)) {
|
||||||
return;
|
|
||||||
}
|
|
||||||
SDL_LockMutex(device->mixer_lock);
|
SDL_LockMutex(device->mixer_lock);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
SDL_AudioUnlockDevice_Default(SDL_AudioDevice * device)
|
SDL_AudioUnlockDevice_Default(SDL_AudioDevice * device)
|
||||||
{
|
{
|
||||||
if (device->thread && (SDL_ThreadID() == device->threadid)) {
|
if (!is_in_audio_device_thread(device)) {
|
||||||
return;
|
|
||||||
}
|
|
||||||
SDL_UnlockMutex(device->mixer_lock);
|
SDL_UnlockMutex(device->mixer_lock);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -241,6 +259,7 @@ finalize_audio_entry_points(void)
|
|||||||
FILL_STUB(ThreadInit);
|
FILL_STUB(ThreadInit);
|
||||||
FILL_STUB(WaitDevice);
|
FILL_STUB(WaitDevice);
|
||||||
FILL_STUB(PlayDevice);
|
FILL_STUB(PlayDevice);
|
||||||
|
FILL_STUB(GetPendingBytes);
|
||||||
FILL_STUB(GetDeviceBuf);
|
FILL_STUB(GetDeviceBuf);
|
||||||
FILL_STUB(WaitDone);
|
FILL_STUB(WaitDone);
|
||||||
FILL_STUB(CloseDevice);
|
FILL_STUB(CloseDevice);
|
||||||
@ -312,6 +331,181 @@ SDL_StreamDeinit(SDL_AudioStreamer * stream)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* buffer queueing support... */
|
||||||
|
|
||||||
|
/* this expects that you managed thread safety elsewhere. */
|
||||||
|
static void
|
||||||
|
free_audio_queue(SDL_AudioBufferQueue *buffer)
|
||||||
|
{
|
||||||
|
while (buffer) {
|
||||||
|
SDL_AudioBufferQueue *next = buffer->next;
|
||||||
|
SDL_free(buffer);
|
||||||
|
buffer = next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void SDLCALL
|
||||||
|
SDL_BufferQueueDrainCallback(void *userdata, Uint8 *stream, int _len)
|
||||||
|
{
|
||||||
|
/* this function always holds the mixer lock before being called. */
|
||||||
|
Uint32 len = (Uint32) _len;
|
||||||
|
SDL_AudioDevice *device = (SDL_AudioDevice *) userdata;
|
||||||
|
SDL_AudioBufferQueue *buffer;
|
||||||
|
|
||||||
|
SDL_assert(device != NULL); /* this shouldn't ever happen, right?! */
|
||||||
|
SDL_assert(_len >= 0); /* this shouldn't ever happen, right?! */
|
||||||
|
|
||||||
|
while ((len > 0) && ((buffer = device->buffer_queue_head) != NULL)) {
|
||||||
|
const Uint32 avail = buffer->datalen - buffer->startpos;
|
||||||
|
const Uint32 cpy = SDL_min(len, avail);
|
||||||
|
SDL_assert(device->queued_bytes >= avail);
|
||||||
|
|
||||||
|
SDL_memcpy(stream, buffer->data + buffer->startpos, cpy);
|
||||||
|
buffer->startpos += cpy;
|
||||||
|
stream += cpy;
|
||||||
|
device->queued_bytes -= cpy;
|
||||||
|
len -= cpy;
|
||||||
|
|
||||||
|
if (buffer->startpos == buffer->datalen) { /* packet is done, put it in the pool. */
|
||||||
|
device->buffer_queue_head = buffer->next;
|
||||||
|
SDL_assert((buffer->next != NULL) || (buffer == device->buffer_queue_tail));
|
||||||
|
buffer->next = device->buffer_queue_pool;
|
||||||
|
device->buffer_queue_pool = buffer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SDL_assert((device->buffer_queue_head != NULL) == (device->queued_bytes != 0));
|
||||||
|
|
||||||
|
if (len > 0) { /* fill any remaining space in the stream with silence. */
|
||||||
|
SDL_assert(device->buffer_queue_head == NULL);
|
||||||
|
SDL_memset(stream, device->spec.silence, len);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (device->buffer_queue_head == NULL) {
|
||||||
|
device->buffer_queue_tail = NULL; /* in case we drained the queue entirely. */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
SDL_QueueAudio(SDL_AudioDeviceID devid, const void *_data, Uint32 len)
|
||||||
|
{
|
||||||
|
SDL_AudioDevice *device = get_audio_device(devid);
|
||||||
|
const Uint8 *data = (const Uint8 *) _data;
|
||||||
|
SDL_AudioBufferQueue *orighead;
|
||||||
|
SDL_AudioBufferQueue *origtail;
|
||||||
|
Uint32 origlen;
|
||||||
|
Uint32 datalen;
|
||||||
|
|
||||||
|
if (!device) {
|
||||||
|
return -1; /* get_audio_device() will have set the error state */
|
||||||
|
}
|
||||||
|
|
||||||
|
if (device->spec.callback != SDL_BufferQueueDrainCallback) {
|
||||||
|
return SDL_SetError("Audio device has a callback, queueing not allowed");
|
||||||
|
}
|
||||||
|
|
||||||
|
current_audio.impl.LockDevice(device);
|
||||||
|
|
||||||
|
orighead = device->buffer_queue_head;
|
||||||
|
origtail = device->buffer_queue_tail;
|
||||||
|
origlen = origtail ? origtail->datalen : 0;
|
||||||
|
|
||||||
|
while (len > 0) {
|
||||||
|
SDL_AudioBufferQueue *packet = device->buffer_queue_tail;
|
||||||
|
SDL_assert(!packet || (packet->datalen <= SDL_AUDIOBUFFERQUEUE_PACKETLEN));
|
||||||
|
if (!packet || (packet->datalen >= SDL_AUDIOBUFFERQUEUE_PACKETLEN)) {
|
||||||
|
/* tail packet missing or completely full; we need a new packet. */
|
||||||
|
packet = device->buffer_queue_pool;
|
||||||
|
if (packet != NULL) {
|
||||||
|
/* we have one available in the pool. */
|
||||||
|
device->buffer_queue_pool = packet->next;
|
||||||
|
} else {
|
||||||
|
/* Have to allocate a new one! */
|
||||||
|
packet = (SDL_AudioBufferQueue *) SDL_malloc(sizeof (SDL_AudioBufferQueue));
|
||||||
|
if (packet == NULL) {
|
||||||
|
/* uhoh, reset so we've queued nothing new, free what we can. */
|
||||||
|
if (!origtail) {
|
||||||
|
packet = device->buffer_queue_head; /* whole queue. */
|
||||||
|
} else {
|
||||||
|
packet = origtail->next; /* what we added to existing queue. */
|
||||||
|
origtail->next = NULL;
|
||||||
|
origtail->datalen = origlen;
|
||||||
|
}
|
||||||
|
device->buffer_queue_head = orighead;
|
||||||
|
device->buffer_queue_tail = origtail;
|
||||||
|
device->buffer_queue_pool = NULL;
|
||||||
|
|
||||||
|
current_audio.impl.UnlockDevice(device);
|
||||||
|
|
||||||
|
free_audio_queue(packet); /* give back what we can. */
|
||||||
|
|
||||||
|
return SDL_OutOfMemory();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
packet->datalen = 0;
|
||||||
|
packet->startpos = 0;
|
||||||
|
packet->next = NULL;
|
||||||
|
|
||||||
|
SDL_assert((device->buffer_queue_head != NULL) == (device->queued_bytes != 0));
|
||||||
|
if (device->buffer_queue_tail == NULL) {
|
||||||
|
device->buffer_queue_head = packet;
|
||||||
|
} else {
|
||||||
|
device->buffer_queue_tail->next = packet;
|
||||||
|
}
|
||||||
|
device->buffer_queue_tail = packet;
|
||||||
|
}
|
||||||
|
|
||||||
|
datalen = SDL_min(len, SDL_AUDIOBUFFERQUEUE_PACKETLEN - packet->datalen);
|
||||||
|
SDL_memcpy(packet->data + packet->datalen, data, datalen);
|
||||||
|
data += datalen;
|
||||||
|
len -= datalen;
|
||||||
|
packet->datalen += datalen;
|
||||||
|
device->queued_bytes += datalen;
|
||||||
|
}
|
||||||
|
|
||||||
|
current_audio.impl.UnlockDevice(device);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Uint32
|
||||||
|
SDL_GetQueuedAudioSize(SDL_AudioDeviceID devid)
|
||||||
|
{
|
||||||
|
Uint32 retval = 0;
|
||||||
|
SDL_AudioDevice *device = get_audio_device(devid);
|
||||||
|
|
||||||
|
/* Nothing to do unless we're set up for queueing. */
|
||||||
|
if (device && (device->spec.callback == SDL_BufferQueueDrainCallback)) {
|
||||||
|
current_audio.impl.LockDevice(device);
|
||||||
|
retval = device->queued_bytes + current_audio.impl.GetPendingBytes(device);
|
||||||
|
current_audio.impl.UnlockDevice(device);
|
||||||
|
}
|
||||||
|
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SDL_ClearQueuedAudio(SDL_AudioDeviceID devid)
|
||||||
|
{
|
||||||
|
SDL_AudioDevice *device = get_audio_device(devid);
|
||||||
|
SDL_AudioBufferQueue *buffer = NULL;
|
||||||
|
if (!device) {
|
||||||
|
return; /* nothing to do. */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Blank out the device and release the mutex. Free it afterwards. */
|
||||||
|
current_audio.impl.LockDevice(device);
|
||||||
|
buffer = device->buffer_queue_head;
|
||||||
|
device->buffer_queue_tail = NULL;
|
||||||
|
device->buffer_queue_head = NULL;
|
||||||
|
device->queued_bytes = 0;
|
||||||
|
current_audio.impl.UnlockDevice(device);
|
||||||
|
|
||||||
|
free_audio_queue(buffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#if defined(__ANDROID__)
|
#if defined(__ANDROID__)
|
||||||
#include <android/log.h>
|
#include <android/log.h>
|
||||||
#endif
|
#endif
|
||||||
@ -788,6 +982,10 @@ close_audio_device(SDL_AudioDevice * device)
|
|||||||
current_audio.impl.CloseDevice(device);
|
current_audio.impl.CloseDevice(device);
|
||||||
device->opened = 0;
|
device->opened = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free_audio_queue(device->buffer_queue_head);
|
||||||
|
free_audio_queue(device->buffer_queue_pool);
|
||||||
|
|
||||||
SDL_FreeAudioMem(device);
|
SDL_FreeAudioMem(device);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -802,11 +1000,6 @@ prepare_audiospec(const SDL_AudioSpec * orig, SDL_AudioSpec * prepared)
|
|||||||
{
|
{
|
||||||
SDL_memcpy(prepared, orig, sizeof(SDL_AudioSpec));
|
SDL_memcpy(prepared, orig, sizeof(SDL_AudioSpec));
|
||||||
|
|
||||||
if (orig->callback == NULL) {
|
|
||||||
SDL_SetError("SDL_OpenAudio() passed a NULL callback");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (orig->freq == 0) {
|
if (orig->freq == 0) {
|
||||||
const char *env = SDL_getenv("SDL_AUDIO_FREQUENCY");
|
const char *env = SDL_getenv("SDL_AUDIO_FREQUENCY");
|
||||||
if ((!env) || ((prepared->freq = SDL_atoi(env)) == 0)) {
|
if ((!env) || ((prepared->freq = SDL_atoi(env)) == 0)) {
|
||||||
@ -859,7 +1052,6 @@ prepare_audiospec(const SDL_AudioSpec * orig, SDL_AudioSpec * prepared)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static SDL_AudioDeviceID
|
static SDL_AudioDeviceID
|
||||||
open_audio_device(const char *devname, int iscapture,
|
open_audio_device(const char *devname, int iscapture,
|
||||||
const SDL_AudioSpec * desired, SDL_AudioSpec * obtained,
|
const SDL_AudioSpec * desired, SDL_AudioSpec * obtained,
|
||||||
@ -938,7 +1130,7 @@ open_audio_device(const char *devname, int iscapture,
|
|||||||
SDL_OutOfMemory();
|
SDL_OutOfMemory();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
SDL_memset(device, '\0', sizeof(SDL_AudioDevice));
|
SDL_zerop(device);
|
||||||
device->spec = *obtained;
|
device->spec = *obtained;
|
||||||
device->enabled = 1;
|
device->enabled = 1;
|
||||||
device->paused = 1;
|
device->paused = 1;
|
||||||
@ -956,8 +1148,9 @@ open_audio_device(const char *devname, int iscapture,
|
|||||||
|
|
||||||
/* force a device detection if we haven't done one yet. */
|
/* force a device detection if we haven't done one yet. */
|
||||||
if ( ((iscapture) && (current_audio.inputDevices == NULL)) ||
|
if ( ((iscapture) && (current_audio.inputDevices == NULL)) ||
|
||||||
((!iscapture) && (current_audio.outputDevices == NULL)) )
|
((!iscapture) && (current_audio.outputDevices == NULL)) ) {
|
||||||
SDL_GetNumAudioDevices(iscapture);
|
SDL_GetNumAudioDevices(iscapture);
|
||||||
|
}
|
||||||
|
|
||||||
if (current_audio.impl.OpenDevice(device, devname, iscapture) < 0) {
|
if (current_audio.impl.OpenDevice(device, devname, iscapture) < 0) {
|
||||||
close_audio_device(device);
|
close_audio_device(device);
|
||||||
@ -1031,6 +1224,25 @@ open_audio_device(const char *devname, int iscapture,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (device->spec.callback == NULL) { /* use buffer queueing? */
|
||||||
|
/* pool a few packets to start. Enough for two callbacks. */
|
||||||
|
const int packetlen = SDL_AUDIOBUFFERQUEUE_PACKETLEN;
|
||||||
|
const int wantbytes = ((device->convert.needed) ? device->convert.len : device->spec.size) * 2;
|
||||||
|
const int wantpackets = (wantbytes / packetlen) + ((wantbytes % packetlen) ? packetlen : 0);
|
||||||
|
for (i = 0; i < wantpackets; i++) {
|
||||||
|
SDL_AudioBufferQueue *packet = (SDL_AudioBufferQueue *) SDL_malloc(sizeof (SDL_AudioBufferQueue));
|
||||||
|
if (packet) { /* don't care if this fails, we'll deal later. */
|
||||||
|
packet->datalen = 0;
|
||||||
|
packet->startpos = 0;
|
||||||
|
packet->next = device->buffer_queue_pool;
|
||||||
|
device->buffer_queue_pool = packet;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
device->spec.callback = SDL_BufferQueueDrainCallback;
|
||||||
|
device->spec.userdata = device;
|
||||||
|
}
|
||||||
|
|
||||||
/* Find an available device ID and store the structure... */
|
/* Find an available device ID and store the structure... */
|
||||||
for (id = min_id - 1; id < SDL_arraysize(open_devices); id++) {
|
for (id = min_id - 1; id < SDL_arraysize(open_devices); id++) {
|
||||||
if (open_devices[id] == NULL) {
|
if (open_devices[id] == NULL) {
|
||||||
|
@ -33,6 +33,26 @@ typedef struct SDL_AudioDevice SDL_AudioDevice;
|
|||||||
/* Used by audio targets during DetectDevices() */
|
/* Used by audio targets during DetectDevices() */
|
||||||
typedef void (*SDL_AddAudioDevice)(const char *name);
|
typedef void (*SDL_AddAudioDevice)(const char *name);
|
||||||
|
|
||||||
|
/* This is the size of a packet when using SDL_QueueAudio(). We allocate
|
||||||
|
these as necessary and pool them, under the assumption that we'll
|
||||||
|
eventually end up with a handful that keep recycling, meeting whatever
|
||||||
|
the app needs. We keep packing data tightly as more arrives to avoid
|
||||||
|
wasting space, and if we get a giant block of data, we'll split them
|
||||||
|
into multiple packets behind the scenes. My expectation is that most
|
||||||
|
apps will have 2-3 of these in the pool. 8k should cover most needs, but
|
||||||
|
if this is crippling for some embedded system, we can #ifdef this.
|
||||||
|
The system preallocates enough packets for 2 callbacks' worth of data. */
|
||||||
|
#define SDL_AUDIOBUFFERQUEUE_PACKETLEN (8 * 1024)
|
||||||
|
|
||||||
|
/* Used by apps that queue audio instead of using the callback. */
|
||||||
|
typedef struct SDL_AudioBufferQueue
|
||||||
|
{
|
||||||
|
Uint8 data[SDL_AUDIOBUFFERQUEUE_PACKETLEN]; /* packet data. */
|
||||||
|
Uint32 datalen; /* bytes currently in use in this packet. */
|
||||||
|
Uint32 startpos; /* bytes currently consumed in this packet. */
|
||||||
|
struct SDL_AudioBufferQueue *next; /* next item in linked list. */
|
||||||
|
} SDL_AudioBufferQueue;
|
||||||
|
|
||||||
typedef struct SDL_AudioDriverImpl
|
typedef struct SDL_AudioDriverImpl
|
||||||
{
|
{
|
||||||
void (*DetectDevices) (int iscapture, SDL_AddAudioDevice addfn);
|
void (*DetectDevices) (int iscapture, SDL_AddAudioDevice addfn);
|
||||||
@ -40,6 +60,7 @@ typedef struct SDL_AudioDriverImpl
|
|||||||
void (*ThreadInit) (_THIS); /* Called by audio thread at start */
|
void (*ThreadInit) (_THIS); /* Called by audio thread at start */
|
||||||
void (*WaitDevice) (_THIS);
|
void (*WaitDevice) (_THIS);
|
||||||
void (*PlayDevice) (_THIS);
|
void (*PlayDevice) (_THIS);
|
||||||
|
int (*GetPendingBytes) (_THIS);
|
||||||
Uint8 *(*GetDeviceBuf) (_THIS);
|
Uint8 *(*GetDeviceBuf) (_THIS);
|
||||||
void (*WaitDone) (_THIS);
|
void (*WaitDone) (_THIS);
|
||||||
void (*CloseDevice) (_THIS);
|
void (*CloseDevice) (_THIS);
|
||||||
@ -119,6 +140,12 @@ struct SDL_AudioDevice
|
|||||||
SDL_Thread *thread;
|
SDL_Thread *thread;
|
||||||
SDL_threadID threadid;
|
SDL_threadID threadid;
|
||||||
|
|
||||||
|
/* Queued buffers (if app not using callback). */
|
||||||
|
SDL_AudioBufferQueue *buffer_queue_head; /* device fed from here. */
|
||||||
|
SDL_AudioBufferQueue *buffer_queue_tail; /* queue fills to here. */
|
||||||
|
SDL_AudioBufferQueue *buffer_queue_pool; /* these are unused packets. */
|
||||||
|
Uint32 queued_bytes; /* number of bytes of audio data in the queue. */
|
||||||
|
|
||||||
/* * * */
|
/* * * */
|
||||||
/* Data private to this driver */
|
/* Data private to this driver */
|
||||||
struct SDL_PrivateAudioData *hidden;
|
struct SDL_PrivateAudioData *hidden;
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
/* The configure script already did any necessary checking */
|
/* The configure script already did any necessary checking */
|
||||||
# define SDL_XAUDIO2_HAS_SDK 1
|
# define SDL_XAUDIO2_HAS_SDK 1
|
||||||
#elif defined(__WINRT__)
|
#elif defined(__WINRT__)
|
||||||
/* WinRT always has access to the .the XAudio 2 SDK */
|
/* WinRT always has access to the the XAudio 2 SDK */
|
||||||
# define SDL_XAUDIO2_HAS_SDK
|
# define SDL_XAUDIO2_HAS_SDK
|
||||||
#else
|
#else
|
||||||
/* XAudio2 exists as of the March 2008 DirectX SDK
|
/* XAudio2 exists as of the March 2008 DirectX SDK
|
||||||
@ -241,14 +241,14 @@ XAUDIO2_WaitDone(_THIS)
|
|||||||
SDL_assert(!this->enabled); /* flag that stops playing. */
|
SDL_assert(!this->enabled); /* flag that stops playing. */
|
||||||
IXAudio2SourceVoice_Discontinuity(source);
|
IXAudio2SourceVoice_Discontinuity(source);
|
||||||
#if SDL_XAUDIO2_WIN8
|
#if SDL_XAUDIO2_WIN8
|
||||||
IXAudio2SourceVoice_GetState(source, &state, 0);
|
IXAudio2SourceVoice_GetState(source, &state, XAUDIO2_VOICE_NOSAMPLESPLAYED);
|
||||||
#else
|
#else
|
||||||
IXAudio2SourceVoice_GetState(source, &state);
|
IXAudio2SourceVoice_GetState(source, &state);
|
||||||
#endif
|
#endif
|
||||||
while (state.BuffersQueued > 0) {
|
while (state.BuffersQueued > 0) {
|
||||||
SDL_SemWait(this->hidden->semaphore);
|
SDL_SemWait(this->hidden->semaphore);
|
||||||
#if SDL_XAUDIO2_WIN8
|
#if SDL_XAUDIO2_WIN8
|
||||||
IXAudio2SourceVoice_GetState(source, &state, 0);
|
IXAudio2SourceVoice_GetState(source, &state, XAUDIO2_VOICE_NOSAMPLESPLAYED);
|
||||||
#else
|
#else
|
||||||
IXAudio2SourceVoice_GetState(source, &state);
|
IXAudio2SourceVoice_GetState(source, &state);
|
||||||
#endif
|
#endif
|
||||||
|
@ -331,7 +331,7 @@ IBus_SetupConnection(SDL_DBusContext *dbus, const char* addr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(result){
|
if(result){
|
||||||
DBusMessage *msg = dbus->message_new_method_call(IBUS_SERVICE,
|
msg = dbus->message_new_method_call(IBUS_SERVICE,
|
||||||
input_ctx_path,
|
input_ctx_path,
|
||||||
IBUS_INPUT_INTERFACE,
|
IBUS_INPUT_INTERFACE,
|
||||||
"SetCapabilities");
|
"SetCapabilities");
|
||||||
|
@ -588,3 +588,6 @@
|
|||||||
#define SDL_SetWindowHitTest SDL_SetWindowHitTest_REAL
|
#define SDL_SetWindowHitTest SDL_SetWindowHitTest_REAL
|
||||||
#define SDL_GetGlobalMouseState SDL_GetGlobalMouseState_REAL
|
#define SDL_GetGlobalMouseState SDL_GetGlobalMouseState_REAL
|
||||||
#define SDL_HasAVX2 SDL_HasAVX2_REAL
|
#define SDL_HasAVX2 SDL_HasAVX2_REAL
|
||||||
|
#define SDL_QueueAudio SDL_QueueAudio_REAL
|
||||||
|
#define SDL_GetQueuedAudioSize SDL_GetQueuedAudioSize_REAL
|
||||||
|
#define SDL_ClearQueuedAudio SDL_ClearQueuedAudio_REAL
|
||||||
|
@ -620,3 +620,6 @@ SDL_DYNAPI_PROC(int,SDL_CaptureMouse,(SDL_bool a),(a),return)
|
|||||||
SDL_DYNAPI_PROC(int,SDL_SetWindowHitTest,(SDL_Window *a, SDL_HitTest b, void *c),(a,b,c),return)
|
SDL_DYNAPI_PROC(int,SDL_SetWindowHitTest,(SDL_Window *a, SDL_HitTest b, void *c),(a,b,c),return)
|
||||||
SDL_DYNAPI_PROC(Uint32,SDL_GetGlobalMouseState,(int *a, int *b),(a,b),return)
|
SDL_DYNAPI_PROC(Uint32,SDL_GetGlobalMouseState,(int *a, int *b),(a,b),return)
|
||||||
SDL_DYNAPI_PROC(SDL_bool,SDL_HasAVX2,(void),(),return)
|
SDL_DYNAPI_PROC(SDL_bool,SDL_HasAVX2,(void),(),return)
|
||||||
|
SDL_DYNAPI_PROC(int,SDL_QueueAudio,(SDL_AudioDeviceID a, const void *b, Uint32 c),(a,b,c),return)
|
||||||
|
SDL_DYNAPI_PROC(Uint32,SDL_GetQueuedAudioSize,(SDL_AudioDeviceID a),(a),return)
|
||||||
|
SDL_DYNAPI_PROC(void,SDL_ClearQueuedAudio,(SDL_AudioDeviceID a),(a),)
|
||||||
|
@ -10,9 +10,6 @@
|
|||||||
/* Include this so we define UNICODE properly */
|
/* Include this so we define UNICODE properly */
|
||||||
#include "../../core/windows/SDL_windows.h"
|
#include "../../core/windows/SDL_windows.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
/* Include the SDL main definition header */
|
/* Include the SDL main definition header */
|
||||||
#include "SDL.h"
|
#include "SDL.h"
|
||||||
#include "SDL_main.h"
|
#include "SDL_main.h"
|
||||||
@ -103,23 +100,11 @@ ParseCommandLine(char *cmdline, char **argv)
|
|||||||
return (argc);
|
return (argc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Show an error message */
|
|
||||||
static void
|
|
||||||
ShowError(const char *title, const char *message)
|
|
||||||
{
|
|
||||||
/* If USE_MESSAGEBOX is defined, you need to link with user32.lib */
|
|
||||||
#ifdef USE_MESSAGEBOX
|
|
||||||
MessageBox(NULL, message, title, MB_ICONEXCLAMATION | MB_OK);
|
|
||||||
#else
|
|
||||||
fprintf(stderr, "%s: %s\n", title, message);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Pop up an out of memory message, returns to Windows */
|
/* Pop up an out of memory message, returns to Windows */
|
||||||
static BOOL
|
static BOOL
|
||||||
OutOfMemory(void)
|
OutOfMemory(void)
|
||||||
{
|
{
|
||||||
ShowError("Fatal Error", "Out of memory - aborting");
|
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Fatal Error", "Out of memory - aborting", NULL);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,18 +117,10 @@ OutOfMemory(void)
|
|||||||
int
|
int
|
||||||
console_main(int argc, char *argv[])
|
console_main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int status;
|
|
||||||
|
|
||||||
SDL_SetMainReady();
|
SDL_SetMainReady();
|
||||||
|
|
||||||
/* Run the application main() code */
|
/* Run the application main() code */
|
||||||
status = SDL_main(argc, argv);
|
return SDL_main(argc, argv);
|
||||||
|
|
||||||
/* Exit cleanly, calling atexit() functions */
|
|
||||||
exit(status);
|
|
||||||
|
|
||||||
/* Hush little compiler, don't you cry... */
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This is where execution begins [windowed apps] */
|
/* This is where execution begins [windowed apps] */
|
||||||
|
@ -688,6 +688,9 @@ GL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
|||||||
GL_CheckError("", renderer);
|
GL_CheckError("", renderer);
|
||||||
renderdata->glGenTextures(1, &data->texture);
|
renderdata->glGenTextures(1, &data->texture);
|
||||||
if (GL_CheckError("glGenTexures()", renderer) < 0) {
|
if (GL_CheckError("glGenTexures()", renderer) < 0) {
|
||||||
|
if (data->pixels) {
|
||||||
|
SDL_free(data->pixels);
|
||||||
|
}
|
||||||
SDL_free(data);
|
SDL_free(data);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ do { \
|
|||||||
|
|
||||||
#define DRAW_SETPIXEL_BLEND(getpixel, setpixel) \
|
#define DRAW_SETPIXEL_BLEND(getpixel, setpixel) \
|
||||||
do { \
|
do { \
|
||||||
unsigned sr, sg, sb, sa; \
|
unsigned sr, sg, sb, sa = 0xFF; \
|
||||||
getpixel; \
|
getpixel; \
|
||||||
sr = DRAW_MUL(inva, sr) + r; \
|
sr = DRAW_MUL(inva, sr) + r; \
|
||||||
sg = DRAW_MUL(inva, sg) + g; \
|
sg = DRAW_MUL(inva, sg) + g; \
|
||||||
|
@ -377,34 +377,25 @@ _allmul()
|
|||||||
{
|
{
|
||||||
/* *INDENT-OFF* */
|
/* *INDENT-OFF* */
|
||||||
__asm {
|
__asm {
|
||||||
push ebp
|
mov eax, dword ptr[esp+8]
|
||||||
mov ebp,esp
|
mov ecx, dword ptr[esp+10h]
|
||||||
push edi
|
or ecx, eax
|
||||||
push esi
|
mov ecx, dword ptr[esp+0Ch]
|
||||||
|
jne hard
|
||||||
|
mov eax, dword ptr[esp+4]
|
||||||
|
mul ecx
|
||||||
|
ret 10h
|
||||||
|
hard:
|
||||||
push ebx
|
push ebx
|
||||||
sub esp,0Ch
|
mul ecx
|
||||||
mov eax,dword ptr [ebp+10h]
|
|
||||||
mov edi,dword ptr [ebp+8]
|
|
||||||
mov ebx, eax
|
mov ebx, eax
|
||||||
mov esi,eax
|
mov eax, dword ptr[esp+8]
|
||||||
sar esi,1Fh
|
mul dword ptr[esp+14h]
|
||||||
mov eax,dword ptr [ebp+8]
|
add ebx, eax
|
||||||
mul ebx
|
mov eax, dword ptr[esp+8]
|
||||||
imul edi,esi
|
mul ecx
|
||||||
mov ecx,edx
|
add edx, ebx
|
||||||
mov dword ptr [ebp-18h],eax
|
|
||||||
mov edx,dword ptr [ebp+0Ch]
|
|
||||||
add ecx,edi
|
|
||||||
imul ebx,edx
|
|
||||||
mov eax,dword ptr [ebp-18h]
|
|
||||||
lea ebx,[ebx+ecx]
|
|
||||||
mov dword ptr [ebp-14h],ebx
|
|
||||||
mov edx,dword ptr [ebp-14h]
|
|
||||||
add esp,0Ch
|
|
||||||
pop ebx
|
pop ebx
|
||||||
pop esi
|
|
||||||
pop edi
|
|
||||||
pop ebp
|
|
||||||
ret 10h
|
ret 10h
|
||||||
}
|
}
|
||||||
/* *INDENT-ON* */
|
/* *INDENT-ON* */
|
||||||
|
@ -93,6 +93,7 @@ struct SDL_Window
|
|||||||
SDL_Surface *surface;
|
SDL_Surface *surface;
|
||||||
SDL_bool surface_valid;
|
SDL_bool surface_valid;
|
||||||
|
|
||||||
|
SDL_bool is_hiding;
|
||||||
SDL_bool is_destroying;
|
SDL_bool is_destroying;
|
||||||
|
|
||||||
SDL_WindowShaper *shaper;
|
SDL_WindowShaper *shaper;
|
||||||
|
@ -1105,6 +1105,10 @@ SDL_UpdateFullscreenMode(SDL_Window * window, SDL_bool fullscreen)
|
|||||||
|
|
||||||
CHECK_WINDOW_MAGIC(window,);
|
CHECK_WINDOW_MAGIC(window,);
|
||||||
|
|
||||||
|
/* if we are in the process of hiding don't go back to fullscreen */
|
||||||
|
if ( window->is_hiding && fullscreen )
|
||||||
|
return;
|
||||||
|
|
||||||
#ifdef __MACOSX__
|
#ifdef __MACOSX__
|
||||||
if (Cocoa_SetWindowFullscreenSpace(window, fullscreen)) {
|
if (Cocoa_SetWindowFullscreenSpace(window, fullscreen)) {
|
||||||
window->last_fullscreen_flags = window->flags;
|
window->last_fullscreen_flags = window->flags;
|
||||||
@ -1833,11 +1837,13 @@ SDL_HideWindow(SDL_Window * window)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window->is_hiding = SDL_TRUE;
|
||||||
SDL_UpdateFullscreenMode(window, SDL_FALSE);
|
SDL_UpdateFullscreenMode(window, SDL_FALSE);
|
||||||
|
|
||||||
if (_this->HideWindow) {
|
if (_this->HideWindow) {
|
||||||
_this->HideWindow(_this, window);
|
_this->HideWindow(_this, window);
|
||||||
}
|
}
|
||||||
|
window->is_hiding = SDL_FALSE;
|
||||||
SDL_SendWindowEvent(window, SDL_WINDOWEVENT_HIDDEN, 0, 0);
|
SDL_SendWindowEvent(window, SDL_WINDOWEVENT_HIDDEN, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ LIBS = @LIBS@
|
|||||||
TARGETS = \
|
TARGETS = \
|
||||||
checkkeys$(EXE) \
|
checkkeys$(EXE) \
|
||||||
loopwave$(EXE) \
|
loopwave$(EXE) \
|
||||||
|
loopwavequeue$(EXE) \
|
||||||
testatomic$(EXE) \
|
testatomic$(EXE) \
|
||||||
testaudioinfo$(EXE) \
|
testaudioinfo$(EXE) \
|
||||||
testautomation$(EXE) \
|
testautomation$(EXE) \
|
||||||
@ -71,6 +72,9 @@ checkkeys$(EXE): $(srcdir)/checkkeys.c
|
|||||||
loopwave$(EXE): $(srcdir)/loopwave.c
|
loopwave$(EXE): $(srcdir)/loopwave.c
|
||||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
|
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
|
||||||
|
|
||||||
|
loopwavequeue$(EXE): $(srcdir)/loopwavequeue.c
|
||||||
|
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
|
||||||
|
|
||||||
testresample$(EXE): $(srcdir)/testresample.c
|
testresample$(EXE): $(srcdir)/testresample.c
|
||||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
|
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ These are test programs for the SDL library:
|
|||||||
|
|
||||||
checkkeys Watch the key events to check the keyboard
|
checkkeys Watch the key events to check the keyboard
|
||||||
loopwave Audio test -- loop playing a WAV file
|
loopwave Audio test -- loop playing a WAV file
|
||||||
|
loopwavequeue Audio test -- loop playing a WAV file with SDL_QueueAudio
|
||||||
testaudioinfo Lists audio device capabilities
|
testaudioinfo Lists audio device capabilities
|
||||||
testcdrom Sample audio CD control program
|
testcdrom Sample audio CD control program
|
||||||
testerror Tests multi-threaded error handling
|
testerror Tests multi-threaded error handling
|
||||||
|
127
test/loopwavequeue.c
Normal file
127
test/loopwavequeue.c
Normal file
@ -0,0 +1,127 @@
|
|||||||
|
/*
|
||||||
|
Copyright (C) 1997-2014 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Program to load a wave file and loop playing it using SDL sound queueing */
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#if HAVE_SIGNAL_H
|
||||||
|
#include <signal.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "SDL.h"
|
||||||
|
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
SDL_AudioSpec spec;
|
||||||
|
Uint8 *sound; /* Pointer to wave data */
|
||||||
|
Uint32 soundlen; /* Length of wave data */
|
||||||
|
int soundpos; /* Current play position */
|
||||||
|
} wave;
|
||||||
|
|
||||||
|
|
||||||
|
/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
|
||||||
|
static void
|
||||||
|
quit(int rc)
|
||||||
|
{
|
||||||
|
SDL_Quit();
|
||||||
|
exit(rc);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int done = 0;
|
||||||
|
void
|
||||||
|
poked(int sig)
|
||||||
|
{
|
||||||
|
done = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
char filename[4096];
|
||||||
|
|
||||||
|
/* Enable standard application logging */
|
||||||
|
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
|
||||||
|
|
||||||
|
/* Load the SDL library */
|
||||||
|
if (SDL_Init(SDL_INIT_AUDIO) < 0) {
|
||||||
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError());
|
||||||
|
return (1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (argc > 1) {
|
||||||
|
SDL_strlcpy(filename, argv[1], sizeof(filename));
|
||||||
|
} else {
|
||||||
|
SDL_strlcpy(filename, "sample.wav", sizeof(filename));
|
||||||
|
}
|
||||||
|
/* Load the wave file into memory */
|
||||||
|
if (SDL_LoadWAV(filename, &wave.spec, &wave.sound, &wave.soundlen) == NULL) {
|
||||||
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s\n", filename, SDL_GetError());
|
||||||
|
quit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
wave.spec.callback = NULL; /* we'll push audio. */
|
||||||
|
|
||||||
|
#if HAVE_SIGNAL_H
|
||||||
|
/* Set the signals */
|
||||||
|
#ifdef SIGHUP
|
||||||
|
signal(SIGHUP, poked);
|
||||||
|
#endif
|
||||||
|
signal(SIGINT, poked);
|
||||||
|
#ifdef SIGQUIT
|
||||||
|
signal(SIGQUIT, poked);
|
||||||
|
#endif
|
||||||
|
signal(SIGTERM, poked);
|
||||||
|
#endif /* HAVE_SIGNAL_H */
|
||||||
|
|
||||||
|
/* Initialize fillerup() variables */
|
||||||
|
if (SDL_OpenAudio(&wave.spec, NULL) < 0) {
|
||||||
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't open audio: %s\n", SDL_GetError());
|
||||||
|
SDL_FreeWAV(wave.sound);
|
||||||
|
quit(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*static x[99999]; SDL_QueueAudio(1, x, sizeof (x));*/
|
||||||
|
|
||||||
|
/* Let the audio run */
|
||||||
|
SDL_PauseAudio(0);
|
||||||
|
|
||||||
|
/* Note that we stuff the entire audio buffer into the queue in one
|
||||||
|
shot. Most apps would want to feed it a little at a time, as it
|
||||||
|
plays, but we're going for simplicity here. */
|
||||||
|
|
||||||
|
while (!done && (SDL_GetAudioStatus() == SDL_AUDIO_PLAYING))
|
||||||
|
{
|
||||||
|
/* The device from SDL_OpenAudio() is always device #1. */
|
||||||
|
const Uint32 queued = SDL_GetQueuedAudioSize(1);
|
||||||
|
SDL_Log("Device has %u bytes queued.\n", (unsigned int) queued);
|
||||||
|
if (queued <= 8192) { /* time to requeue the whole thing? */
|
||||||
|
if (SDL_QueueAudio(1, wave.sound, wave.soundlen) == 0) {
|
||||||
|
SDL_Log("Device queued %u more bytes.\n", (unsigned int) wave.soundlen);
|
||||||
|
} else {
|
||||||
|
SDL_Log("Device FAILED to queue %u more bytes: %s\n", (unsigned int) wave.soundlen, SDL_GetError());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SDL_Delay(100); /* let it play for awhile. */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Clean up on signal */
|
||||||
|
SDL_CloseAudio();
|
||||||
|
SDL_FreeWAV(wave.sound);
|
||||||
|
SDL_Quit();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* vi: set ts=4 sw=4 expandtab: */
|
Loading…
Reference in New Issue
Block a user