提交 7c2bcdd3 编写于 作者: B bernard

[BSP] update SDL to SDL2 in simulator.

上级 a4776edb
......@@ -7,12 +7,10 @@ You may report bugs there, and search to see if a given issue has already
been reported, discussed, and maybe even fixed.
You may also find help at the SDL mailing list. Subscription information:
You may also find help on the SDL mailing list. Subscription information:
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Bug reports are welcome here, but we really appreciate if you use Bugzilla, as
bugs discussed on the mailing list may be forgotten or missed.
此差异已折叠。
Simple DirectMedia Layer
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, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Simple DirectMedia Layer
(SDL)
Version 1.2
---
http://www.libsdl.org/
This is the Simple DirectMedia Layer, a general API that provides low
level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL,
and 2D framebuffer across multiple platforms.
The current version supports Linux, Windows CE/95/98/ME/XP/Vista, BeOS,
MacOS Classic, Mac OS X, FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, IRIX,
and QNX. The code contains support for Dreamcast, Atari, AIX, OSF/Tru64,
RISC OS, SymbianOS, Nintendo DS, and OS/2, but these are not officially
supported.
SDL is written in C, but works with C++ natively, and has bindings to
several other languages, including Ada, C#, Eiffel, Erlang, Euphoria,
Guile, Haskell, Java, Lisp, Lua, ML, Objective C, Pascal, Perl, PHP,
Pike, Pliant, Python, Ruby, and Smalltalk.
This library is distributed under GNU LGPL version 2, which can be
found in the file "COPYING". This license allows you to use SDL
freely in commercial programs as long as you link with the dynamic
library.
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 is available in HTML format in "docs/index.html", and
a documentation wiki is available online at:
http://www.libsdl.org/cgi/docwiki.cgi
The test programs in the "test" subdirectory are in the public domain.
Frequently asked questions are answered online:
http://www.libsdl.org/faq.php
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)
Please distribute this file with the SDL runtime environment:
The Simple DirectMedia Layer (SDL for short) is a cross-platfrom library
The Simple DirectMedia Layer (SDL for short) is a cross-platform library
designed to make it easy to write multi-media software, such as games and
emulators.
The Simple DirectMedia Layer library source code is available from:
http://www.libsdl.org/
This library is distributed under the terms of the GNU LGPL license:
http://www.gnu.org/copyleft/lesser.html
This library is distributed under the terms of the zlib license:
http://www.zlib.net/zlib_license.html
Simple DirectMedia Layer
(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.
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
If you want to report bugs or contribute patches, please submit them to
bugzilla:
http://bugzilla.libsdl.org/
Enjoy!
Sam Lantinga (slouken@libsdl.org)
<HTML>
<HEAD>
<TITLE>Using SDL with Microsoft Visual C++</TITLE>
</HEAD>
<BODY>
<H1>
Using SDL with Microsoft Visual C++ 5,6&nbsp;and 7
</H1>
<H3>
by <A HREF="mailto:snowlion@sprynet.com">Lion Kimbro </A>and additions by <A HREF="mailto:james@conceptofzero.net">
James Turk</A>
</H3>
<p>
You can either use the precompiled libraries from <A HREF="http://www.libsdl.org/download.php">
the SDL Download web site </A>, or you can build SDL yourself.
</p>
<H3>
Building SDL
</H3>
<P>
Unzip the <CODE>VisualC.zip</CODE> file into the directory that contains this
file (<CODE>VisualC.html</CODE>).
</P>
<P>
Be certain that you unzip the zip file for your compiler into <strong>this</strong>
directory and not any other directory. If you are using WinZip, be careful to
make sure that it extracts to <strong>this</strong> folder, because it's
convenient feature of unzipping to a folder with the name of the file currently
being unzipped will get you in trouble if you use it right now. And that's all
I have to say about that.
</P>
<P>
Now that it's unzipped, go into the VisualC
directory that is created, and double-click on the VC++ file "<CODE>SDL.dsw</CODE>"<STRONG><FONT color="#009900">
("<CODE>SDL.sln</CODE>").</FONT></STRONG> This should open up the IDE.
</P>
<P>
You may be prompted at this point to upgrade the workspace, should you be using
a more recent version of Visual C++. If so, allow the workspace to be upgraded.
</P>
<P>
Build the <CODE>.dll</CODE> and <CODE>.lib</CODE> files.
</P>
<P>
This is done by right clicking on each project in turn (Projects are listed in
the Workspace panel in the FileView tab), and selecting "Build".
</P>
<P>
If you get an error about SDL_config.h being missing, you should
copy include/SDL_config.h.default to include/SDL_config.h and try again.
</P>
<P>
You may get a few warnings, but you should not get any errors. You do have to
have at least the DirectX 5 SDK installed, however. The latest
version of DirectX can be downloaded or purchased on a cheap CD (my
recommendation) from <A HREF="http://www.microsoft.com">Microsoft </A>.
</P>
<P>
Later, we will refer to the following .lib and .dll files that have just been
generated:
</P>
<ul>
<li> SDL.dll</li>
<li> SDL.lib</li>
<li> SDLmain.lib</li>
</ul>
<P>
Search for these using the Windows Find (Windows-F) utility, if you don't
already know where they should be. For those of you with a clue, look inside
the Debug or Release directories of the subdirectories of the Project folder.
(It might be easier to just use Windows Find if this sounds confusing. And
don't worry about needing a clue; we all need visits from the clue fairy
frequently.)
</P>
<H3>
Creating a Project with SDL
</H3>
<P>
Create a project as a Win32 Application.
</P>
<P>
Create a C++ file for your project.
</P>
<P>
Set the C runtime to "Multi-threaded DLL" in the menu: <CODE>Project|Settings|C/C++
tab|Code Generation|Runtime Library </CODE>.
</P>
<P>
Add the SDL <CODE>include</CODE> directory to your list of includes in the
menu: <CODE>Project|Settings|C/C++ tab|Preprocessor|Additional include directories </CODE>
.
<br>
<STRONG><FONT color="#009900">VC7 Specific: Instead of doing this I find it easier to
add the include and library directories to the list that VC7 keeps. Do this by
selecting Tools|Options|Projects|VC++ Directories and under the "Show
Directories For:" dropbox select "Include Files", and click the "New Directory
Icon" and add the [SDLROOT]\include directory (ex. If you installed to
c:\SDL-1.2.5\ add c:\SDL-1.2.5\include).&nbsp;Proceed to&nbsp;change the
dropbox selection to "Library Files" and add [SDLROOT]\lib.</FONT></STRONG>
</P>
<P>
The "include directory" I am referring to is the <CODE>include</CODE> folder
within the main SDL directory (the one that this HTML file located within).
</P>
<P>
Now we're going to use the files that we had created earlier in the Build SDL
step.
</P>
<P>
Copy the following files into your Project directory:
</P>
<ul>
<li> SDL.dll</li>
</ul>
<P>
Add the following files to your project (It is not necessary to copy them to
your project directory):
</P>
<ul>
<li> SDL.lib </li>
<li> SDLmain.lib</li>
</ul>
<P>
(To add them to your project, right click on your project, and select "Add
files to project")
</P>
<P><STRONG><FONT color="#009900">Instead of adding the files to your project it is more
desireable to add them to the linker options: Project|Properties|Linker|Command
Line and type the names of the libraries to link with in the "Additional
Options:" box.&nbsp; Note: This must be done&nbsp;for&nbsp;each&nbsp;build
configuration (eg. Release,Debug).</FONT></STRONG></P>
<H3>
SDL 101, First Day of Class
</H3>
<P>
Now create the basic body of your project. The body of your program should take
the following form: <CODE>
<PRE>
#include "SDL.h"
int main( int argc, char* argv[] )
{
// Body of the program goes here.
return 0;
}
</PRE>
</CODE>
<P></P>
<H3>
That's it!
</H3>
<P>
I hope that this document has helped you get through the most difficult part of
using the SDL: installing it. Suggestions for improvements to this document
should be sent to the writers of this document.
</P>
<P>
Thanks to Paulus Esterhazy (pesterhazy@gmx.net), for the work on VC++ port.
</P>
<P>
This document was originally called "VisualC.txt", and was written by <A HREF="mailto:slouken@libsdl.org">
Sam Lantinga</A>.
</P>
<P>
Later, it was converted to HTML and expanded into the document that you see
today by <A HREF="mailto:snowlion@sprynet.com">Lion Kimbro</A>.
</P>
<P>Minor Fixes and Visual C++ 7 Information (In Green) was added by <A HREF="mailto:james@conceptofzero.net">James Turk</A>
</P>
</BODY>
</HTML>
此差异已折叠。
This is a list of major changes in SDL's version history.
---------------------------------------------------------------------------
2.0.3:
---------------------------------------------------------------------------
Mac OS X:
* Fixed creating an OpenGL context by default on Mac OS X 10.6
---------------------------------------------------------------------------
2.0.2:
---------------------------------------------------------------------------
General:
* Added SDL_GL_ResetAttributes() to reset OpenGL attributes to default values
* Added an API to load a database of game controller mappings from a file:
SDL_GameControllerAddMappingsFromFile(), SDL_GameControllerAddMappingsFromRW()
* Added game controller mappings for the PS4 and OUYA controllers
* Added SDL_GetDefaultAssertionHandler() and SDL_GetAssertionHandler()
* Added SDL_DetachThread()
* Added SDL_HasAVX() to determine if the CPU has AVX features
* Added SDL_vsscanf(), SDL_acos(), and SDL_asin() to the stdlib routines
* EGL can now create/manage OpenGL and OpenGL ES 1.x/2.x contexts, and share
them using SDL_GL_SHARE_WITH_CURRENT_CONTEXT
* Added a field "clicks" to the mouse button event which records whether the event is a single click, double click, etc.
* The screensaver is now disabled by default, and there is a hint SDL_HINT_VIDEO_ALLOW_SCREENSAVER that can change that behavior.
* Added a hint SDL_HINT_MOUSE_RELATIVE_MODE_WARP to specify whether mouse relative mode should be emulated using mouse warping.
* testgl2 does not need to link with libGL anymore
* Added testgles2 test program to demonstrate working with OpenGL ES 2.0
* Added controllermap test program to visually map a game controller
Windows:
* Support for OpenGL ES 2.x contexts using either WGL or EGL (natively via
the driver or emulated through ANGLE)
* Added a hint SDL_HINT_VIDEO_WIN_D3DCOMPILER to specify which D3D shader compiler to use for OpenGL ES 2 support through ANGLE
* Added a hint SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT that is useful when creating multiple windows that should share the same OpenGL context.
* Added an event SDL_RENDER_TARGETS_RESET that is sent when D3D9 render targets are reset after the device has been restored.
Mac OS X:
* Added a hint SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK to control whether Ctrl+click should be treated as a right click on Mac OS X. This is off by default.
Linux:
* Fixed fullscreen and focused behavior when receiving NotifyGrab events
* Added experimental Wayland and Mir support, disabled by default
Android:
* Joystick support (minimum SDK version required to build SDL is now 12,
the required runtime version remains at 10, but on such devices joystick
support won't be available).
* Hotplugging support for joysticks
* Added a hint SDL_HINT_ACCELEROMETER_AS_JOYSTICK to control whether the accelerometer should be listed as a 3 axis joystick, which it will by default.
---------------------------------------------------------------------------
2.0.1:
---------------------------------------------------------------------------
General:
* Added an API to get common filesystem paths in SDL_filesystem.h:
SDL_GetBasePath(), SDL_GetPrefPath()
* Added an API to do optimized YV12 and IYUV texture updates:
SDL_UpdateYUVTexture()
* Added an API to get the amount of RAM on the system:
SDL_GetSystemRAM()
* Added a macro to perform timestamp comparisons with SDL_GetTicks():
SDL_TICKS_PASSED()
* Dramatically improved OpenGL ES 2.0 rendering performance
* Added OpenGL attribute SDL_GL_FRAMEBUFFER_SRGB_CAPABLE
Windows:
* Created a static library configuration for the Visual Studio 2010 project
* Added a hint to create the Direct3D device with support for multi-threading:
SDL_HINT_RENDER_DIRECT3D_THREADSAFE
* Added a function to get the D3D9 adapter index for a display:
SDL_Direct3D9GetAdapterIndex()
* Added a function to get the D3D9 device for a D3D9 renderer:
SDL_RenderGetD3D9Device()
* Fixed building SDL with the mingw32 toolchain (mingw-w64 is preferred)
* Fixed crash when using two XInput controllers at the same time
* Fixed detecting a mixture of XInput and DirectInput controllers
* Fixed clearing a D3D render target larger than the window
* Improved support for format specifiers in SDL_snprintf()
Mac OS X:
* Added support for retina displays:
Create your window with the SDL_WINDOW_ALLOW_HIGHDPI flag, and then use SDL_GL_GetDrawableSize() to find the actual drawable size. You are responsible for scaling mouse and drawing coordinates appropriately.
* Fixed mouse warping in fullscreen mode
* Right mouse click is emulated by holding the Ctrl key while left clicking
Linux:
* Fixed float audio support with the PulseAudio driver
* Fixed missing line endpoints in the OpenGL renderer on some drivers
* X11 symbols are no longer defined to avoid collisions when linking statically
iOS:
* Fixed status bar visibility on iOS 7
* Flipped the accelerometer Y axis to match expected values
Android:
IMPORTANT: You MUST get the updated SDLActivity.java to match C code
* Moved EGL initialization to native code
* Fixed the accelerometer axis rotation relative to the device rotation
* Fixed race conditions when handling the EGL context on pause/resume
* Touch devices are available for enumeration immediately after init
Raspberry Pi:
* Added support for the Raspberry Pi, see README-raspberrypi.txt for details
<HTML>
<HEAD><TITLE>SDL Stable Release</TITLE></HEAD>
<BODY BGCOLOR="#FFEBCD" TEXT="#000000">
<IMG SRC="docs/images/rainbow.gif" ALT="[separator]" WIDTH="100%">
<P>
This source is stable, and is fully tested on all supported platforms.<br>
Please send bug reports or questions to the SDL mailing list:<br>
<a href="http://www.libsdl.org/mailing-list.php"
>http://www.libsdl.org/mailing-list.php</a><br>
The latest stable release may be found on the
<a href="http://www.libsdl.org/">SDL website</A>.
</P>
<H2> <A HREF="docs/index.html">API Documentation</A> </H2>
<IMG SRC="docs/images/rainbow.gif" ALT="[separator]" WIDTH="100%">
<H2> SDL 1.2.14 Release Notes </H2>
<P>
SDL 1.2.14 is a significant bug fix release and a recommended update.
</P>
<H3> General Notes </H3>
<BLOCKQUOTE>
<P>
Fixed flicker when resizing the SDL window
</P>
<P>
Fixed crash in SDL_SetGammaRamp()
</P>
<P>
Fixed freeze in SDL_memset() with 0 length when assembly code is disabled.
</P>
<P>
Added SDL_DISABLE_LOCK_KEYS environment variable to enable normal up/down events for Caps-Lock and Num-Lock keys.
</P>
<P>
Fixed audio quality problem when converting between 22050 Hz and 44100 Hz.
</P>
<P>
Fixed a threading crash when a few threads are rapidly created and complete.
</P>
<P>
Increased accuracy of alpha blending routines.
</P>
<P>
Fixed crash loading BMP files saved with the scanlines inverted.
</P>
<P>
Fixed mouse coordinate clamping if SDL_SetVideoMode() isn't called in response to SDL_VIDEORESIZE event.
</P>
<P>
Added doxygen documentation for the SDL API headers.
</P>
</BLOCKQUOTE>
<H3> Unix Notes </H3>
<BLOCKQUOTE>
<P>
Fixed potential memory corruption due to assembly bug with SDL_revcpy()
</P>
<P>
Fixed crashes trying to detect SSE features on x86_64 architecture.
</P>
<P>
Fixed assembly for GCC optimized 50% alpha blending blits.
</P>
<P>
Added configure option --enable-screensaver, to allow enabling the screensaver by default.
</P>
<P>
Use XResetScreenSaver() instead of disabling screensaver entirely.
</P>
<P>
Removed the maximum window size limitation on X11.
</P>
<P>
Fixed SDL_GL_SWAP_CONTROL on X11.
</P>
<P>
Fixed setting the X11 window input hint.
</P>
<P>
Fixed distorted X11 window icon for some visuals.
</P>
<P>
Fixed detecting X11 libraries for dynamic loading on 64-bit Linux.
</P>
<P>
SDL_GL_GetAttribute(SDL_GL_SWAP_CONTROL) returns the correct value with GLX_SGI_swap_control.
</P>
<P>
Added SDL_VIDEO_FULLSCREEN_DISPLAY as a preferred synonym for SDL_VIDEO_FULLSCREEN_HEAD on X11.
</P>
<P>
The SDL_VIDEO_FULLSCREEN_DISPLAY environment variable can be set to 0 to place fullscreen SDL windows on the first Xinerama screen.
</P>
<P>
Added the SDL_VIDEO_FBCON_ROTATION environment variable to control output orientation on the framebuffer console.
<BR>
Valid values are:
<UL>
<LI>not set - Not rotating, no shadow.
<LI>"NONE" - Not rotating, but still using shadow.
<LI>"CW" - Rotating screen clockwise.
<LI>"UD" - Rotating screen upside down.
<LI>"CCW" - Rotating screen counter clockwise.
</UL>
</P>
<P>
Fixed DirectFB detection on some Linux distributions.
</P>
<P>
Added code to use the PS3 SPE processors for YUV conversion on Linux.
</P>
<P>
Updated ALSA support to the latest stable API
</P>
<P>
ALSA is now preferred over OSS audio. (SDL_AUDIODRIVER=dsp will restore the previous behavior.)
</P>
<P>
Improved support for PulseAudio
</P>
<P>
The Network Audio System support is now dynamically loaded at runtime.
</P>
<P>
Fixed crash with the MP-8866 Dual USB Joypad on newer Linux kernels.
</P>
<P>
Fixed crash in SDL_Quit() when a joystick has been unplugged.
</P>
</BLOCKQUOTE>
<H3> Windows Notes </H3>
<BLOCKQUOTE>
<P>
Verified 100% compatibility with Windows 7.
</P>
<P>
Prevent loss of OpenGL context when setting the video mode in response to a window resize event.
</P>
<P>
Fixed video initialization with SDL_WINDOWID on Windows XP.
</P>
<P>
Improved mouse input responsiveness for first-person-shooter games.
</P>
<P>
IME messages are now generated for localized input.
</P>
<P>
SDL_RWFromFile() takes a UTF-8 filename when opening a file.
</P>
<P>
The SDL_STDIO_REDIRECT environment variable can be used to override whether SDL redirects stdio to stdout.txt and stderr.txt.
</P>
<P>
Fixed dynamic object loading on Windows CE.
</P>
</BLOCKQUOTE>
<H3> Mac OS X Notes </H3>
<BLOCKQUOTE>
<P>
SDL now builds on Mac OS X 10.6 (Snow Leopard).
<BR>
Eric Wing posted a good rundown on the numerous changes here: <A HREF="http://playcontrol.net/ewing/jibberjabber/big_behind-the-scenes_chang.html">http://playcontrol.net/ewing/jibberjabber/big_behind-the-scenes_chang.html</A>
</P>
<P>
The X11 video driver is built by default.
</P>
<P>
Fixed SDL_VIDEO_WINDOW_POS environment variable for Quartz target.
</P>
<P>
Fixed setting the starting working directory in release builds.
</P>
</BLOCKQUOTE>
<IMG SRC="docs/images/rainbow.gif" ALT="[separator]" WIDTH="100%">
<H2> SDL 1.2.13 Release Notes </H2>
<P>
SDL 1.2.13 is a minor bug fix release.
</P>
<H3> General Notes </H3>
<BLOCKQUOTE>
<P>
Fixed link error when building with Intel Compiler 10.
</P>
<P>
Removed stray C++ comment from public headers.
</P>
</BLOCKQUOTE>
<H3> Unix Notes </H3>
<BLOCKQUOTE>
<P>
Fixed crash in SDL_SoftStretch() on secure operating systems.
</P>
<P>
Fixed undefined symbol on X11 implementations without UTF-8 support.
</P>
<P>
Worked around BadAlloc error when using XVideo on the XFree86 Intel Integrated Graphics driver.
</P>
<P>
Scan for all joysticks on Linux instead of stopping at one that was removed.
</P>
<P>
Fixed use of sdl-config arguments in sdl.m4
</P>
</BLOCKQUOTE>
<H3> Windows Notes </H3>
<BLOCKQUOTE>
<P>
Fixed crash when a video driver reports higher than 32 bpp video modes.
</P>
<P>
Fixed restoring the desktop after setting a 24-bit OpenGL video mode.
</P>
<P>
Fixed window titles on Windows 95/98/ME.
</P>
<P>
Added SDL_BUTTON_X1 and SDL_BUTTON_X2 constants for extended mouse buttons.
</P>
<P>
Added support for quoted command line arguments.
</P>
</BLOCKQUOTE>
<H3> Mac OS X Notes </H3>
<BLOCKQUOTE>
<P>
SDL now builds on Mac OS X 10.5 (Leopard).
</P>
<P>
Fixed high frequency crash involving text input.
</P>
<P>
Fixed beeping when the escape key is pressed and UNICODE translation is enabled.
</P>
<P>
Improved trackpad scrolling support.
</P>
<P>
Fixed joystick hat reporting for certain joysticks.
</P>
</BLOCKQUOTE>
<IMG SRC="docs/images/rainbow.gif" ALT="[separator]" WIDTH="100%">
<H2> SDL 1.2.12 Release Notes </H2>
<P>
SDL 1.2.12 is a minor bug fix release.
</P>
<H3> General Notes </H3>
<BLOCKQUOTE>
<P>
Added support for the PulseAudio sound server: http://www.pulseaudio.org/
</P>
<P>
Added SDL_VIDEO_ALLOW_SCREENSAVER to override SDL's disabling of the screensaver on Mac OS X, Windows, and X11.
</P>
<P>
Fixed buffer overrun crash when resampling audio rates.
</P>
<P>
Fixed audio bug where converting to mono was doubling the volume.
</P>
<P>
Fixed off-by-one error in the C implementation of SDL_revcpy()
</P>
<P>
Fixed compiling with Sun Studio.
</P>
<P>
Support for AmigaOS has been removed from the main SDL code.
</P>
<P>
Support for Nokia 9210 "EPOC" driver has been removed from the main SDL code.
</P>
<P>
Unofficial support for the S60/SymbianOS platform has been added.
</P>
<P>
Unofficial support for the Nintendo DS platform has been added.
</P>
<P>
Reenabled MMX assembly for YUV overlay processing (GNU C Compiler only).
</P>
</BLOCKQUOTE>
<H3> Unix Notes </H3>
<BLOCKQUOTE>
<P>
Fixed detection of X11 DGA mouse support.
</P>
<P>
Improved XIM support for asian character sets.
</P>
<P>
The GFX_Display has been added to the X11 window information in SDL_syswm.h.
</P>
<P>
Fixed PAGE_SIZE compile error in the fbcon video driver on newer Linux kernels.
</P>
<P>
Fixed hang or crash at startup if aRts can't access the hardware.
</P>
<P>
Fixed relative mouse mode when the cursor starts outside the X11 window.
</P>
<P>
Fixed accidental free of stack memory in X11 mouse acceleration code.
</P>
<P>
Closed minor memory leak in XME code.
</P>
<P>
Fixed TEXTRELs in the library to resolve some PIC issues.
</P>
</BLOCKQUOTE>
<H3> Windows Notes </H3>
<BLOCKQUOTE>
<P>
The GDI video driver makes better use of the palette in 8-bit modes.
</P>
<P>
The windib driver now supports more mouse buttons with WM_XBUTTON events.
</P>
<P>
On Windows, SDL_SetVideoMode() will re-create the window instead of failing if the multisample settings are changed.
</P>
<P>
Added support for UTF-8 window titles on Windows.
</P>
<P>
Fixed joystick detection on Windows.
</P>
<P>
Improved performance with Win32 file I/O.
</P>
<P>
Fixed HBITMAP leak in GAPI driver.
</P>
</BLOCKQUOTE>
<H3> Mac OS X Notes </H3>
<BLOCKQUOTE>
<P>
Added support for multi-axis controllers like 3Dconnxion's SpaceNavigator on Mac OS X.
</P>
<P>
Fixed YUV overlay crash inside Quicktime on Intel Mac OS X.
</P>
<P>
Fixed blitting alignment in Altivec alpha blit functions.
</P>
<P>
Keys F13, F14, and F15 are now usable on Apple keyboards under Mac OS X.
</P>
<P>
Fixed joystick calibration code on Mac OS X.
</P>
<P>
Fixed mouse jitter when multiple motion events are queued up in Mac OS X.
</P>
<P>
Fixed changing the cursor in fullscreen mode on Mac OS X.
</P>
</BLOCKQUOTE>
<H3> Mac OS Classic Notes </H3>
<BLOCKQUOTE>
<P>
Added support for gamma ramps to both toolbox and DrawSprocket video drivers.
</P>
</BLOCKQUOTE>
<H3> BeOS Notes </H3>
<BLOCKQUOTE>
<P>
Implemented mouse grabbing and mouse relative mode on BeOS.
</P>
</BLOCKQUOTE>
<IMG SRC="docs/images/rainbow.gif" ALT="[separator]" WIDTH="100%">
<H2> SDL 1.2.11 Release Notes </H2>
<P>
SDL 1.2.11 is a minor bug fix release.
</P>
<H3> Unix Notes </H3>
<BLOCKQUOTE>
<P>
Dynamic X11 loading is only enabled with gcc 4 supporting -fvisibility=hidden. This fixes crashes related to symbol collisions, and allows building on Solaris and IRIX.
</P>
<P>
Fixed building SDL with Xinerama disabled.
</P>
<P>
Fixed DRI OpenGL library loading, using RTLD_GLOBAL in dlopen().
</P>
<P>
Added pkgconfig configuration support.
</P>
</BLOCKQUOTE>
<H3> Windows Notes </H3>
<BLOCKQUOTE>
<P>
Setting SDL_GL_SWAP_CONTROL now works with Windows OpenGL.
</P>
<P>
The Win32 window positioning code works properly for windows with menus.
</P>
<P>
DirectSound audio quality has been improved on certain sound cards.
</P>
<P>
Fixed 5.1 audio channel ordering on Windows and Mac OS X.
</P>
<P>
Plugged a couple of minor memory leaks in the windib video driver.
</P>
<P>
Fixed type collision with stdint.h when building with gcc on Win32.
</P>
<P>
Fixed building with the Digital Mars Compiler on Win32.
</P>
</BLOCKQUOTE>
<H3> Mac OS X Notes </H3>
<BLOCKQUOTE>
<P>
The Quartz video driver supports 32x32 cursors on Mac OS X 10.3 and above.
</P>
</BLOCKQUOTE>
<IMG SRC="docs/images/rainbow.gif" ALT="[separator]" WIDTH="100%">
<H2> SDL 1.2.10 Release Notes </H2>
<P>
SDL 1.2.10 is a major release, featuring a revamp of the build system and many API improvements and bug fixes.
</P>
<H3> API enhancements </H3>
<UL>
<LI>
If SDL_OpenAudio() is passed zero for the desired format
fields, the following environment variables will be used
to fill them in:
<pre><code>
SDL_AUDIO_FREQUENCY
SDL_AUDIO_FORMAT
SDL_AUDIO_CHANNELS
SDL_AUDIO_SAMPLES
</code></pre>
If an environment variable is not specified, it will be set
to a reasonable default value.
<LI>
SDL_SetVideoMode() now accepts 0 for width or height and will use
the current video mode (or the desktop mode if no mode has been set.)
<LI>
Added current_w and current_h to the SDL_VideoInfo structure,
which is set to the desktop resolution during video intialization,
and then set to the current resolution when a video mode is set.
<LI>
SDL_GL_LoadLibrary() will load the system default OpenGL library
if it is passed NULL as a parameter.
<LI>
Added SDL_GL_SWAP_CONTROL to wait for vsync in OpenGL applications.
<LI>
Added SDL_GL_ACCELERATED_VISUAL to guarantee hardware acceleration.
<LI>
SDL_WM_SetCaption() now officially takes UTF-8 title and icon strings, and displays international characters on supported platforms.
<LI>
Added SDL_GetKeyRepeat() to query the key repeat settings.
<LI>
Added the "dummy" audio driver, which can be used to emulate audio
output without a sound card.
<LI>
Added SDL_config.h, with defaults for various build environments.
</UL>
<H3> General Notes </H3>
<BLOCKQUOTE>
<P>
The SDL website now has an <A HREF="http://www.libsdl.org/rss/rss.xml">RSS feed</A>!
<P>
The SDL development source code is now managed with <A HREF="http://www.libsdl.org/svn.php">Subversion</A>.
<P>
SDL now uses the Bugzilla <A HREF="http://bugzilla.libsdl.org/">bug tracking system</A>, hosted by icculus.org.
<P>
SDL is licensed under version 2.1 of the GNU Lesser General Public License.
<P>
The entire build system has been revamped to make it much more portable, including versions of C library functions to make it possible to run SDL on a minimal embedded environment. See README.Porting in the SDL source distribution for information on how to port SDL to a new platform.
<P>
SDL_opengl.h has been updated with the latest glext.h from <A HREF="http://oss.sgi.com/projects/ogl-sample/registry/">http://oss.sgi.com/projects/ogl-sample/registry/</A>
<P>
Alex Volkov contributed highly optimized RGB <-> RGBA blitters.
</BLOCKQUOTE>
<H3> Unix Notes </H3>
<BLOCKQUOTE>
<P>
The X11 libraries are dynamically loaded at runtime by default. This allows the distributed version of SDL to run on systems without X11 libraries installed.
<P>
The XiG XME extension code is now included in the X11 video driver by default.
<P>
XRandR support for video mode switching has been added to the X11 driver, but is disabled because of undesired interactions with window managers. You can enable this by setting the environment variable SDL_VIDEO_X11_XRANDR to 1.
<P>
Xinerama multi-head displays are properly handled now, and the SDL_VIDEO_FULLSCREEN_HEAD environment variable can be used to select the screen used for fullscreen video modes. Note that changing the video modes only works on screen 0.
<P>
XVidMode video modes are now sorted so they maintain the refresh rates specified in the X11 configuration file.
<P>
SDL windows are no longer transparent in X11 compositing systems like XGL.
<P>
The mouse is properly released by the X11 video driver if the fullscreen window loses focus.
<P>
The X11 input driver now uses XIM to handle international input.
<P>
The screensaver and DPMS monitor blanking are disabled while SDL games are running under the X11 and DGA video drivers. This behavior will be formalized and selectable in SDL 1.3.
<P>
Fixed a bug preventing stereo OpenGL contexts from being selected on the X11 driver.
<P>
The DGA video driver now waits for pending blits involving surfaces before they are freed. This prevents display oddities when using SDL_DisplayFormat() to convert many images.
<P>
The framebuffer console video driver now has a parser for /etc/fb.modes for improved video mode handling.
<P>
The framebuffer console video driver now allows asynchronous VT switching, and restores the full contents of the screen when switched back.
<P>
The framebuffer console now uses CTRL-ALT-FN to switch virtual terminals, to avoid collisions with application key bindings.
<P>
The framebuffer console input driver correctly sets IMPS/2 mode for wheel mice. It also properly detects when gpm is in IMPS/2 protocol mode, or passing raw protocol from an IMPS/2 mouse.
<P>
The SVGAlib video driver now has support for banked (non-linear) video modes.
<P>
A video driver for OpenBSD on the Sharp Zaurus has been contributed by Staffan Ulfberg. See the file README.wscons in the SDL source distribution for details.
<P>
Many patches have been incorporated from *BSD ports.
</BLOCKQUOTE>
<H3> Windows Notes </H3>
<BLOCKQUOTE>
<P>
The "windib" video driver is the default now, to prevent problems with certain laptops, 64-bit Windows, and Windows Vista. The DirectX driver is still available, and can be selected by setting the environment variable SDL_VIDEODRIVER to "directx".
<P>
SDL has been ported to 64-bit Windows.
<P>
Dmitry Yakimov contributed a GAPI video driver for Windows CE.
<P>
The default fullscreen refresh rate has been increased to match the desktop refresh rate, when using equivalent resolutions. A full API for querying and selecting refresh rates is planned for SDL 1.3.
<P>
Dialog boxes are now shown when SDL is in windowed OpenGL mode.
<P>
The SDL window is recreated when necessary to maintain OpenGL context attributes, when switching between windowed and fullscreen modes.
<P>
An SDL_VIDEORESIZE event is properly sent when the SDL window is maximized and restored.
<P>
Window positions are retained when switching between fullscreen and windowed modes.
<P>
ToUnicode() is used, when available, for improved handling of international keyboard input.
<P>
The PrtScrn is now treated normally with both key down and key up events.
<P>
Pressing ALT-F4 now delivers an SDL_QUIT event to SDL applications.
<P>
Joystick names are now correct for joysticks which have been unplugged and then plugged back in since booting.
<P>
An MCI error when playing the last track on a CD-ROM has been fixed.
<P>
OpenWatcom projects for building SDL have been provided by Marc Peter.
</BLOCKQUOTE>
<H3> Mac OS X Notes </H3>
<BLOCKQUOTE>
<P>
SDL now supports building Universal binaries, both through Xcode projects and when using configure/make. See README.MacOSX in the SDL source archive for details.
<P>
The X11 video driver with GLX support can be built on Mac OS X, if the X11 development SDK is installed.
<P>
Transitions between fullscreen resolutions and windowed mode now use a much faster asynchronous fade to hide desktop flicker.
<P>
Icons set with SDL_WM_SetIcon() now have the proper colors on Intel Macs.
</BLOCKQUOTE>
<H3> OS/2 Notes </H3>
<BLOCKQUOTE>
<P>
Projects for building SDL on OS/2 with OpenWatcom have been contributed by Doodle. See the file README.OS2 in the SDL source distribution for details.
</BLOCKQUOTE>
<IMG SRC="docs/images/rainbow.gif" ALT="[separator]" WIDTH="100%">
</BODY>
</HTML>
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
Simple DirectMedia Layer
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, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/** @file SDL.h
/**
* \file SDL.h
*
* 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
#define _SDL_H
#include "SDL_main.h"
#include "SDL_stdinc.h"
#include "SDL_assert.h"
#include "SDL_atomic.h"
#include "SDL_audio.h"
#include "SDL_cdrom.h"
#include "SDL_clipboard.h"
#include "SDL_cpuinfo.h"
#include "SDL_endian.h"
#include "SDL_error.h"
#include "SDL_events.h"
#include "SDL_filesystem.h"
#include "SDL_joystick.h"
#include "SDL_gamecontroller.h"
#include "SDL_haptic.h"
#include "SDL_hints.h"
#include "SDL_loadso.h"
#include "SDL_log.h"
#include "SDL_messagebox.h"
#include "SDL_mutex.h"
#include "SDL_power.h"
#include "SDL_render.h"
#include "SDL_rwops.h"
#include "SDL_system.h"
#include "SDL_thread.h"
#include "SDL_timer.h"
#include "SDL_video.h"
#include "SDL_version.h"
#include "SDL_video.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
......@@ -49,46 +98,57 @@
extern "C" {
#endif
/** @file SDL.h
* @note As of version 0.5, SDL is loaded dynamically into the application
*/
/* As of version 0.5, SDL is loaded dynamically into the application */
/** @name SDL_INIT Flags
* These are the flags which may be passed to SDL_Init() -- you should
/**
* \name SDL_INIT_*
*
* These are the flags which may be passed to SDL_Init(). You should
* specify the subsystems which you will be using in your application.
*/
/*@{*/
#define SDL_INIT_TIMER 0x00000001
#define SDL_INIT_AUDIO 0x00000010
#define SDL_INIT_VIDEO 0x00000020
#define SDL_INIT_CDROM 0x00000100
#define SDL_INIT_JOYSTICK 0x00000200
#define SDL_INIT_NOPARACHUTE 0x00100000 /**< Don't catch fatal signals */
#define SDL_INIT_EVENTTHREAD 0x01000000 /**< Not supported on all OS's */
#define SDL_INIT_EVERYTHING 0x0000FFFF
/*@}*/
/** This function loads the SDL dynamically linked library and initializes
* the subsystems specified by 'flags' (and those satisfying dependencies)
* Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup
* signal handlers for some commonly ignored fatal signals (like SIGSEGV)
/* @{ */
#define SDL_INIT_TIMER 0x00000001
#define SDL_INIT_AUDIO 0x00000010
#define SDL_INIT_VIDEO 0x00000020 /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */
#define SDL_INIT_JOYSTICK 0x00000200 /**< SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS */
#define SDL_INIT_HAPTIC 0x00001000
#define SDL_INIT_GAMECONTROLLER 0x00002000 /**< SDL_INIT_GAMECONTROLLER implies SDL_INIT_JOYSTICK */
#define SDL_INIT_EVENTS 0x00004000
#define SDL_INIT_NOPARACHUTE 0x00100000 /**< Don't catch fatal signals */
#define SDL_INIT_EVERYTHING ( \
SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \
SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER \
)
/* @} */
/**
* This function initializes the subsystems specified by \c flags
* Unless the ::SDL_INIT_NOPARACHUTE flag is set, it will install cleanup
* signal handlers for some commonly ignored fatal signals (like SIGSEGV).
*/
extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags);
/** This function initializes specific SDL subsystems */
/**
* This function initializes specific SDL subsystems
*/
extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags);
/** This function cleans up specific SDL subsystems */
/**
* This function cleans up specific SDL subsystems
*/
extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags);
/** This function returns mask of the specified subsystems which have
* been initialized.
* If 'flags' is 0, it returns a mask of all initialized subsystems.
/**
* This function returns a mask of the specified subsystems which have
* previously been initialized.
*
* If \c flags is 0, it returns a mask of all initialized subsystems.
*/
extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags);
/** This function cleans up all initialized subsystems and unloads the
* dynamically linked library. You should call it upon all exit conditions.
/**
* This function cleans up all initialized subsystems. You should
* call it upon all exit conditions.
*/
extern DECLSPEC void SDLCALL SDL_Quit(void);
......@@ -99,3 +159,5 @@ extern DECLSPEC void SDLCALL SDL_Quit(void);
#include "close_code.h"
#endif /* _SDL_H */
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* @file SDL_active.h
* Include file for SDL application focus event handling
*/
#ifndef _SDL_active_h
#define _SDL_active_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/** @name The available application states */
/*@{*/
#define SDL_APPMOUSEFOCUS 0x01 /**< The app has mouse coverage */
#define SDL_APPINPUTFOCUS 0x02 /**< The app has input focus */
#define SDL_APPACTIVE 0x04 /**< The application is active */
/*@}*/
/* Function prototypes */
/**
* This function returns the current state of the application, which is a
* bitwise combination of SDL_APPMOUSEFOCUS, SDL_APPINPUTFOCUS, and
* SDL_APPACTIVE. If SDL_APPACTIVE is set, then the user is able to
* see your application, otherwise it has been iconified or disabled.
*/
extern DECLSPEC Uint8 SDLCALL SDL_GetAppState(void);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* _SDL_active_h */
/*
Simple DirectMedia Layer
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, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#ifndef _SDL_assert_h
#define _SDL_assert_h
#include "SDL_config.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
#ifndef SDL_ASSERT_LEVEL
#ifdef SDL_DEFAULT_ASSERT_LEVEL
#define SDL_ASSERT_LEVEL SDL_DEFAULT_ASSERT_LEVEL
#elif defined(_DEBUG) || defined(DEBUG) || \
(defined(__GNUC__) && !defined(__OPTIMIZE__))
#define SDL_ASSERT_LEVEL 2
#else
#define SDL_ASSERT_LEVEL 1
#endif
#endif /* SDL_ASSERT_LEVEL */
/*
These are macros and not first class functions so that the debugger breaks
on the assertion line and not in some random guts of SDL, and so each
assert can have unique static variables associated with it.
*/
#if defined(_MSC_VER)
/* Don't include intrin.h here because it contains C++ code */
extern void __cdecl __debugbreak(void);
#define SDL_TriggerBreakpoint() __debugbreak()
#elif (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)))
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
#elif defined(HAVE_SIGNAL_H)
#include <signal.h>
#define SDL_TriggerBreakpoint() raise(SIGTRAP)
#else
/* How do we trigger breakpoints on this platform? */
#define SDL_TriggerBreakpoint()
#endif
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */
# define SDL_FUNCTION __func__
#elif ((__GNUC__ >= 2) || defined(_MSC_VER))
# define SDL_FUNCTION __FUNCTION__
#else
# define SDL_FUNCTION "???"
#endif
#define SDL_FILE __FILE__
#define SDL_LINE __LINE__
/*
sizeof (x) makes the compiler still parse the expression even without
assertions enabled, so the code is always checked at compile time, but
doesn't actually generate code for it, so there are no side effects or
expensive checks at run time, just the constant size of what x WOULD be,
which presumably gets optimized out as unused.
This also solves the problem of...
int somevalue = blah();
SDL_assert(somevalue == 1);
...which would cause compiles to complain that somevalue is unused if we
disable assertions.
*/
#ifdef _MSC_VER /* stupid /W4 warnings. */
#define SDL_NULL_WHILE_LOOP_CONDITION (-1 == __LINE__)
#else
#define SDL_NULL_WHILE_LOOP_CONDITION (0)
#endif
#define SDL_disabled_assert(condition) \
do { (void) sizeof ((condition)); } while (SDL_NULL_WHILE_LOOP_CONDITION)
typedef enum
{
SDL_ASSERTION_RETRY, /**< Retry the assert immediately. */
SDL_ASSERTION_BREAK, /**< Make the debugger trigger a breakpoint. */
SDL_ASSERTION_ABORT, /**< Terminate the program. */
SDL_ASSERTION_IGNORE, /**< Ignore the assert. */
SDL_ASSERTION_ALWAYS_IGNORE /**< Ignore the assert from now on. */
} SDL_assert_state;
typedef struct SDL_assert_data
{
int always_ignore;
unsigned int trigger_count;
const char *condition;
const char *filename;
int linenum;
const char *function;
const struct SDL_assert_data *next;
} SDL_assert_data;
#if (SDL_ASSERT_LEVEL > 0)
/* Never call this directly. Use the SDL_assert* macros. */
extern DECLSPEC SDL_assert_state SDLCALL SDL_ReportAssertion(SDL_assert_data *,
const char *,
const char *, int)
#if defined(__clang__)
#if __has_feature(attribute_analyzer_noreturn)
/* this tells Clang's static analysis that we're a custom assert function,
and that the analyzer should assume the condition was always true past this
SDL_assert test. */
__attribute__((analyzer_noreturn))
#endif
#endif
;
/* the do {} while(0) avoids dangling else problems:
if (x) SDL_assert(y); else blah();
... without the do/while, the "else" could attach to this macro's "if".
We try to handle just the minimum we need here in a macro...the loop,
the static vars, and break points. The heavy lifting is handled in
SDL_ReportAssertion(), in SDL_assert.c.
*/
#define SDL_enabled_assert(condition) \
do { \
while ( !(condition) ) { \
static struct SDL_assert_data assert_data = { \
0, 0, #condition, 0, 0, 0, 0 \
}; \
const SDL_assert_state state = SDL_ReportAssertion(&assert_data, \
SDL_FUNCTION, \
SDL_FILE, \
SDL_LINE); \
if (state == SDL_ASSERTION_RETRY) { \
continue; /* go again. */ \
} else if (state == SDL_ASSERTION_BREAK) { \
SDL_TriggerBreakpoint(); \
} \
break; /* not retrying. */ \
} \
} while (SDL_NULL_WHILE_LOOP_CONDITION)
#endif /* enabled assertions support code */
/* Enable various levels of assertions. */
#if SDL_ASSERT_LEVEL == 0 /* assertions disabled */
# define SDL_assert(condition) SDL_disabled_assert(condition)
# define SDL_assert_release(condition) SDL_disabled_assert(condition)
# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
#elif SDL_ASSERT_LEVEL == 1 /* release settings. */
# define SDL_assert(condition) SDL_disabled_assert(condition)
# define SDL_assert_release(condition) SDL_enabled_assert(condition)
# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
#elif SDL_ASSERT_LEVEL == 2 /* normal settings. */
# define SDL_assert(condition) SDL_enabled_assert(condition)
# define SDL_assert_release(condition) SDL_enabled_assert(condition)
# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
#elif SDL_ASSERT_LEVEL == 3 /* paranoid settings. */
# define SDL_assert(condition) SDL_enabled_assert(condition)
# define SDL_assert_release(condition) SDL_enabled_assert(condition)
# define SDL_assert_paranoid(condition) SDL_enabled_assert(condition)
#else
# error Unknown assertion level.
#endif
/* this assertion is never disabled at any level. */
#define SDL_assert_always(condition) SDL_enabled_assert(condition)
typedef SDL_assert_state (SDLCALL *SDL_AssertionHandler)(
const SDL_assert_data* data, void* userdata);
/**
* \brief Set an application-defined assertion handler.
*
* This allows an app to show its own assertion UI and/or force the
* response to an assertion failure. If the app doesn't provide this, SDL
* will try to do the right thing, popping up a system-specific GUI dialog,
* and probably minimizing any fullscreen windows.
*
* This callback may fire from any thread, but it runs wrapped in a mutex, so
* it will only fire from one thread at a time.
*
* Setting the callback to NULL restores SDL's original internal handler.
*
* This callback is NOT reset to SDL's internal handler upon SDL_Quit()!
*
* \return SDL_assert_state value of how to handle the assertion failure.
*
* \param handler Callback function, called when an assertion fails.
* \param userdata A pointer passed to the callback as-is.
*/
extern DECLSPEC void SDLCALL SDL_SetAssertionHandler(
SDL_AssertionHandler handler,
void *userdata);
/**
* \brief Get the default assertion handler.
*
* This returns the function pointer that is called by default when an
* assertion is triggered. This is an internal function provided by SDL,
* that is used for assertions when SDL_SetAssertionHandler() hasn't been
* used to provide a different function.
*
* \return The default SDL_AssertionHandler that is called when an assert triggers.
*/
extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler(void);
/**
* \brief Get the value assertion handler.
*
* This returns the function pointer that is called when an assertion is
* triggered. This is either the value last passed to
* SDL_SetAssertionHandler(), or if no application-specified function is
* set, is equivalent to calling SDL_GetDefaultAssertionHandler().
*
* \param puserdata Pointer to a void*, which will store the "userdata"
* pointer that was passed to SDL_SetAssertionHandler().
* This value will always be NULL for the default handler.
* If you don't care about this data, it is safe to pass
* a NULL pointer to this function to ignore it.
* \return The SDL_AssertionHandler that is called when an assert triggers.
*/
extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetAssertionHandler(void **puserdata);
/**
* \brief Get a list of all assertion failures.
*
* Get all assertions triggered since last call to SDL_ResetAssertionReport(),
* or the start of the program.
*
* The proper way to examine this data looks something like this:
*
* <code>
* const SDL_assert_data *item = SDL_GetAssertionReport();
* while (item) {
* printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\n",
* item->condition, item->function, item->filename,
* item->linenum, item->trigger_count,
* item->always_ignore ? "yes" : "no");
* item = item->next;
* }
* </code>
*
* \return List of all assertions.
* \sa SDL_ResetAssertionReport
*/
extern DECLSPEC const SDL_assert_data * SDLCALL SDL_GetAssertionReport(void);
/**
* \brief Reset the list of all assertion failures.
*
* Reset list of all assertions triggered.
*
* \sa SDL_GetAssertionReport
*/
extern DECLSPEC void SDLCALL SDL_ResetAssertionReport(void);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* _SDL_assert_h */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
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, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_atomic.h
*
* Atomic operations.
*
* IMPORTANT:
* If you are not an expert in concurrent lockless programming, you should
* only be using the atomic lock and reference counting functions in this
* file. In all other cases you should be protecting your data structures
* with full mutexes.
*
* The list of "safe" functions to use are:
* SDL_AtomicLock()
* SDL_AtomicUnlock()
* SDL_AtomicIncRef()
* SDL_AtomicDecRef()
*
* Seriously, here be dragons!
* ^^^^^^^^^^^^^^^^^^^^^^^^^^^
*
* You can find out a little more about lockless programming and the
* subtle issues that can arise here:
* http://msdn.microsoft.com/en-us/library/ee418650%28v=vs.85%29.aspx
*
* There's also lots of good information here:
* http://www.1024cores.net/home/lock-free-algorithms
* http://preshing.com/
*
* These operations may or may not actually be implemented using
* processor specific atomic operations. When possible they are
* implemented as true processor specific atomic operations. When that
* is not possible the are implemented using locks that *do* use the
* available atomic operations.
*
* All of the atomic operations that modify memory are full memory barriers.
*/
#ifndef _SDL_atomic_h_
#define _SDL_atomic_h_
#include "SDL_stdinc.h"
#include "SDL_platform.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/**
* \name SDL AtomicLock
*
* The atomic locks are efficient spinlocks using CPU instructions,
* but are vulnerable to starvation and can spin forever if a thread
* holding a lock has been terminated. For this reason you should
* minimize the code executed inside an atomic lock and never do
* expensive things like API or system calls while holding them.
*
* The atomic locks are not safe to lock recursively.
*
* Porting Note:
* The spin lock functions and type are required and can not be
* emulated because they are used in the atomic emulation code.
*/
/* @{ */
typedef int SDL_SpinLock;
/**
* \brief Try to lock a spin lock by setting it to a non-zero value.
*
* \param lock Points to the lock.
*
* \return SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already held.
*/
extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTryLock(SDL_SpinLock *lock);
/**
* \brief Lock a spin lock by setting it to a non-zero value.
*
* \param lock Points to the lock.
*/
extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock);
/**
* \brief Unlock a spin lock by setting it to 0. Always returns immediately
*
* \param lock Points to the lock.
*/
extern DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock);
/* @} *//* SDL AtomicLock */
/**
* The compiler barrier prevents the compiler from reordering
* reads and writes to globally visible variables across the call.
*/
#if defined(_MSC_VER) && (_MSC_VER > 1200)
void _ReadWriteBarrier(void);
#pragma intrinsic(_ReadWriteBarrier)
#define SDL_CompilerBarrier() _ReadWriteBarrier()
#elif defined(__GNUC__)
#define SDL_CompilerBarrier() __asm__ __volatile__ ("" : : : "memory")
#else
#define SDL_CompilerBarrier() \
{ SDL_SpinLock _tmp = 0; SDL_AtomicLock(&_tmp); SDL_AtomicUnlock(&_tmp); }
#endif
/**
* Memory barriers are designed to prevent reads and writes from being
* reordered by the compiler and being seen out of order on multi-core CPUs.
*
* A typical pattern would be for thread A to write some data and a flag,
* and for thread B to read the flag and get the data. In this case you
* would insert a release barrier between writing the data and the flag,
* guaranteeing that the data write completes no later than the flag is
* written, and you would insert an acquire barrier between reading the
* flag and reading the data, to ensure that all the reads associated
* with the flag have completed.
*
* In this pattern you should always see a release barrier paired with
* an acquire barrier and you should gate the data reads/writes with a
* single flag variable.
*
* For more information on these semantics, take a look at the blog post:
* http://preshing.com/20120913/acquire-and-release-semantics
*/
#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(__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")
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory")
#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__)
#ifdef __thumb__
/* The mcr instruction isn't available in thumb mode, use real functions */
extern DECLSPEC void SDLCALL SDL_MemoryBarrierRelease();
extern DECLSPEC void SDLCALL SDL_MemoryBarrierAcquire();
#else
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory")
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory")
#endif /* __thumb__ */
#else
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("" : : : "memory")
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("" : : : "memory")
#endif /* __GNUC__ && __arm__ */
#else
/* This is correct for the x86 and x64 CPUs, and we'll expand this over time. */
#define SDL_MemoryBarrierRelease() SDL_CompilerBarrier()
#define SDL_MemoryBarrierAcquire() SDL_CompilerBarrier()
#endif
/**
* \brief A type representing an atomic integer value. It is a struct
* so people don't accidentally use numeric operations on it.
*/
typedef struct { int value; } SDL_atomic_t;
/**
* \brief Set an atomic variable to a new value if it is currently an old value.
*
* \return SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise.
*
* \note If you don't know what this function is for, you shouldn't use it!
*/
extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval);
/**
* \brief Set an atomic variable to a value.
*
* \return The previous value of the atomic variable.
*/
extern DECLSPEC int SDLCALL SDL_AtomicSet(SDL_atomic_t *a, int v);
/**
* \brief Get the value of an atomic variable
*/
extern DECLSPEC int SDLCALL SDL_AtomicGet(SDL_atomic_t *a);
/**
* \brief Add to an atomic variable.
*
* \return The previous value of the atomic variable.
*
* \note This same style can be used for any number operation
*/
extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_atomic_t *a, int v);
/**
* \brief Increment an atomic variable used as a reference count.
*/
#ifndef SDL_AtomicIncRef
#define SDL_AtomicIncRef(a) SDL_AtomicAdd(a, 1)
#endif
/**
* \brief Decrement an atomic variable used as a reference count.
*
* \return SDL_TRUE if the variable reached zero after decrementing,
* SDL_FALSE otherwise
*/
#ifndef SDL_AtomicDecRef
#define SDL_AtomicDecRef(a) (SDL_AtomicAdd(a, -1) == 1)
#endif
/**
* \brief Set a pointer to a new value if it is currently an old value.
*
* \return SDL_TRUE if the pointer was set, SDL_FALSE otherwise.
*
* \note If you don't know what this function is for, you shouldn't use it!
*/
extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr(void **a, void *oldval, void *newval);
/**
* \brief Set a pointer to a value atomically.
*
* \return The previous value of the pointer.
*/
extern DECLSPEC void* SDLCALL SDL_AtomicSetPtr(void **a, void* v);
/**
* \brief Get the value of a pointer atomically.
*/
extern DECLSPEC void* SDLCALL SDL_AtomicGetPtr(void **a);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* _SDL_atomic_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
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, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_bits.h
*
* Functions for fiddling with bits and bitmasks.
*/
#ifndef _SDL_bits_h
#define _SDL_bits_h
#include "SDL_stdinc.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/**
* \file SDL_bits.h
*/
/**
* Get the index of the most significant bit. Result is undefined when called
* with 0. This operation can also be stated as "count leading zeroes" and
* "log base 2".
*
* \return Index of the most significant bit, or -1 if the value is 0.
*/
SDL_FORCE_INLINE int
SDL_MostSignificantBitIndex32(Uint32 x)
{
#if defined(__GNUC__) && __GNUC__ >= 4
/* Count Leading Zeroes builtin in GCC.
* http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/Other-Builtins.html
*/
if (x == 0) {
return -1;
}
return 31 - __builtin_clz(x);
#else
/* Based off of Bit Twiddling Hacks by Sean Eron Anderson
* <seander@cs.stanford.edu>, released in the public domain.
* http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog
*/
const Uint32 b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000};
const int S[] = {1, 2, 4, 8, 16};
int msbIndex = 0;
int i;
if (x == 0) {
return -1;
}
for (i = 4; i >= 0; i--)
{
if (x & b[i])
{
x >>= S[i];
msbIndex |= S[i];
}
}
return msbIndex;
#endif
}
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* _SDL_bits_h */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
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, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_blendmode.h
*
* Header file declaring the SDL_BlendMode enumeration
*/
#ifndef _SDL_blendmode_h
#define _SDL_blendmode_h
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief The blend mode used in SDL_RenderCopy() and drawing operations.
*/
typedef enum
{
SDL_BLENDMODE_NONE = 0x00000000, /**< no blending
dstRGBA = srcRGBA */
SDL_BLENDMODE_BLEND = 0x00000001, /**< alpha blending
dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA))
dstA = srcA + (dstA * (1-srcA)) */
SDL_BLENDMODE_ADD = 0x00000002, /**< additive blending
dstRGB = (srcRGB * srcA) + dstRGB
dstA = dstA */
SDL_BLENDMODE_MOD = 0x00000004 /**< color modulate
dstRGB = srcRGB * dstRGB
dstA = dstA */
} SDL_BlendMode;
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* _SDL_video_h */
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* @file SDL_byteorder.h
* @deprecated Use SDL_endian.h instead
*/
/* DEPRECATED */
#include "SDL_endian.h"
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* @file SDL_cdrom.h
* This is the CD-audio control API for Simple DirectMedia Layer
*/
#ifndef _SDL_cdrom_h
#define _SDL_cdrom_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/**
* @file SDL_cdrom.h
* In order to use these functions, SDL_Init() must have been called
* with the SDL_INIT_CDROM flag. This causes SDL to scan the system
* for CD-ROM drives, and load appropriate drivers.
*/
/** The maximum number of CD-ROM tracks on a disk */
#define SDL_MAX_TRACKS 99
/** @name Track Types
* The types of CD-ROM track possible
*/
/*@{*/
#define SDL_AUDIO_TRACK 0x00
#define SDL_DATA_TRACK 0x04
/*@}*/
/** The possible states which a CD-ROM drive can be in. */
typedef enum {
CD_TRAYEMPTY,
CD_STOPPED,
CD_PLAYING,
CD_PAUSED,
CD_ERROR = -1
} CDstatus;
/** Given a status, returns true if there's a disk in the drive */
#define CD_INDRIVE(status) ((int)(status) > 0)
typedef struct SDL_CDtrack {
Uint8 id; /**< Track number */
Uint8 type; /**< Data or audio track */
Uint16 unused;
Uint32 length; /**< Length, in frames, of this track */
Uint32 offset; /**< Offset, in frames, from start of disk */
} SDL_CDtrack;
/** This structure is only current as of the last call to SDL_CDStatus() */
typedef struct SDL_CD {
int id; /**< Private drive identifier */
CDstatus status; /**< Current drive status */
/** The rest of this structure is only valid if there's a CD in drive */
/*@{*/
int numtracks; /**< Number of tracks on disk */
int cur_track; /**< Current track position */
int cur_frame; /**< Current frame offset within current track */
SDL_CDtrack track[SDL_MAX_TRACKS+1];
/*@}*/
} SDL_CD;
/** @name Frames / MSF Conversion Functions
* Conversion functions from frames to Minute/Second/Frames and vice versa
*/
/*@{*/
#define CD_FPS 75
#define FRAMES_TO_MSF(f, M,S,F) { \
int value = f; \
*(F) = value%CD_FPS; \
value /= CD_FPS; \
*(S) = value%60; \
value /= 60; \
*(M) = value; \
}
#define MSF_TO_FRAMES(M, S, F) ((M)*60*CD_FPS+(S)*CD_FPS+(F))
/*@}*/
/* CD-audio API functions: */
/**
* Returns the number of CD-ROM drives on the system, or -1 if
* SDL_Init() has not been called with the SDL_INIT_CDROM flag.
*/
extern DECLSPEC int SDLCALL SDL_CDNumDrives(void);
/**
* Returns a human-readable, system-dependent identifier for the CD-ROM.
* Example:
* - "/dev/cdrom"
* - "E:"
* - "/dev/disk/ide/1/master"
*/
extern DECLSPEC const char * SDLCALL SDL_CDName(int drive);
/**
* Opens a CD-ROM drive for access. It returns a drive handle on success,
* or NULL if the drive was invalid or busy. This newly opened CD-ROM
* becomes the default CD used when other CD functions are passed a NULL
* CD-ROM handle.
* Drives are numbered starting with 0. Drive 0 is the system default CD-ROM.
*/
extern DECLSPEC SDL_CD * SDLCALL SDL_CDOpen(int drive);
/**
* This function returns the current status of the given drive.
* If the drive has a CD in it, the table of contents of the CD and current
* play position of the CD will be stored in the SDL_CD structure.
*/
extern DECLSPEC CDstatus SDLCALL SDL_CDStatus(SDL_CD *cdrom);
/**
* Play the given CD starting at 'start_track' and 'start_frame' for 'ntracks'
* tracks and 'nframes' frames. If both 'ntrack' and 'nframe' are 0, play
* until the end of the CD. This function will skip data tracks.
* This function should only be called after calling SDL_CDStatus() to
* get track information about the CD.
* For example:
* @code
* // Play entire CD:
* if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
* SDL_CDPlayTracks(cdrom, 0, 0, 0, 0);
* // Play last track:
* if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) {
* SDL_CDPlayTracks(cdrom, cdrom->numtracks-1, 0, 0, 0);
* }
* // Play first and second track and 10 seconds of third track:
* if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
* SDL_CDPlayTracks(cdrom, 0, 0, 2, 10);
* @endcode
*
* @return This function returns 0, or -1 if there was an error.
*/
extern DECLSPEC int SDLCALL SDL_CDPlayTracks(SDL_CD *cdrom,
int start_track, int start_frame, int ntracks, int nframes);
/**
* Play the given CD starting at 'start' frame for 'length' frames.
* @return It returns 0, or -1 if there was an error.
*/
extern DECLSPEC int SDLCALL SDL_CDPlay(SDL_CD *cdrom, int start, int length);
/** Pause play
* @return returns 0, or -1 on error
*/
extern DECLSPEC int SDLCALL SDL_CDPause(SDL_CD *cdrom);
/** Resume play
* @return returns 0, or -1 on error
*/
extern DECLSPEC int SDLCALL SDL_CDResume(SDL_CD *cdrom);
/** Stop play
* @return returns 0, or -1 on error
*/
extern DECLSPEC int SDLCALL SDL_CDStop(SDL_CD *cdrom);
/** Eject CD-ROM
* @return returns 0, or -1 on error
*/
extern DECLSPEC int SDLCALL SDL_CDEject(SDL_CD *cdrom);
/** Closes the handle for the CD-ROM drive */
extern DECLSPEC void SDLCALL SDL_CDClose(SDL_CD *cdrom);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* _SDL_video_h */
/*
Simple DirectMedia Layer
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, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_clipboard.h
*
* Include file for SDL clipboard handling
*/
#ifndef _SDL_clipboard_h
#define _SDL_clipboard_h
#include "SDL_stdinc.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/* Function prototypes */
/**
* \brief Put UTF-8 text into the clipboard
*
* \sa SDL_GetClipboardText()
*/
extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text);
/**
* \brief Get UTF-8 text from the clipboard, which must be freed with SDL_free()
*
* \sa SDL_SetClipboardText()
*/
extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void);
/**
* \brief Returns a flag indicating whether the clipboard exists and contains a text string that is non-empty
*
* \sa SDL_GetClipboardText()
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* _SDL_clipboard_h */
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
Simple DirectMedia Layer
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
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.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#ifndef _SDL_config_h
#define _SDL_config_h
#ifndef _SDL_config_windows_h
#define _SDL_config_windows_h
#include "SDL_platform.h"
/* Add any platform that doesn't build using the configure system */
#if defined(__DREAMCAST__)
#include "SDL_config_dreamcast.h"
#elif defined(__MACOS__)
#include "SDL_config_macos.h"
#elif defined(__MACOSX__)
#include "SDL_config_macosx.h"
#elif defined(__SYMBIAN32__)
#include "SDL_config_symbian.h" /* must be before win32! */
#elif defined(__WIN32__)
#include "SDL_config_win32.h"
#elif defined(__OS2__)
#include "SDL_config_os2.h"
/* This is a set of defines to configure the SDL features */
#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
#if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__)
#define HAVE_STDINT_H 1
#elif defined(_MSC_VER)
typedef signed __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef signed __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef signed __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
#ifndef _UINTPTR_T_DEFINED
#ifdef _WIN64
typedef unsigned __int64 uintptr_t;
#else
typedef unsigned int uintptr_t;
#endif
#define _UINTPTR_T_DEFINED
#endif
/* Older Visual C++ headers don't have the Win64-compatible typedefs... */
#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR)))
#define DWORD_PTR DWORD
#endif
#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR)))
#define LONG_PTR LONG
#endif
#else /* !__GNUC__ && !_MSC_VER */
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef signed short int16_t;
typedef unsigned short uint16_t;
typedef signed int int32_t;
typedef unsigned int uint32_t;
typedef signed long long int64_t;
typedef unsigned long long uint64_t;
#ifndef _SIZE_T_DEFINED_
#define _SIZE_T_DEFINED_
typedef unsigned int size_t;
#endif
typedef unsigned int uintptr_t;
#endif /* __GNUC__ || _MSC_VER */
#endif /* !_STDINT_H_ && !HAVE_STDINT_H */
#ifdef _WIN64
# define SIZEOF_VOIDP 8
#else
# define SIZEOF_VOIDP 4
#endif
/* This is disabled by default to avoid C runtime dependencies and manifest requirements */
#ifdef HAVE_LIBC
/* Useful headers */
#define HAVE_STDIO_H 1
#define STDC_HEADERS 1
#define HAVE_STRING_H 1
#define HAVE_CTYPE_H 1
#define HAVE_MATH_H 1
#define HAVE_SIGNAL_H 1
/* C library functions */
#define HAVE_MALLOC 1
#define HAVE_CALLOC 1
#define HAVE_REALLOC 1
#define HAVE_FREE 1
#define HAVE_ALLOCA 1
#define HAVE_QSORT 1
#define HAVE_ABS 1
#define HAVE_MEMSET 1
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_MEMCMP 1
#define HAVE_STRLEN 1
#define HAVE__STRREV 1
#define HAVE__STRUPR 1
#define HAVE__STRLWR 1
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE__LTOA 1
#define HAVE__ULTOA 1
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
#define HAVE_STRTOD 1
#define HAVE_ATOI 1
#define HAVE_ATOF 1
#define HAVE_STRCMP 1
#define HAVE_STRNCMP 1
#define HAVE__STRICMP 1
#define HAVE__STRNICMP 1
#define HAVE_ATAN 1
#define HAVE_ATAN2 1
#define HAVE_ACOS 1
#define HAVE_ASIN 1
#define HAVE_CEIL 1
#define HAVE_COS 1
#define HAVE_COSF 1
#define HAVE_FABS 1
#define HAVE_FLOOR 1
#define HAVE_LOG 1
#define HAVE_POW 1
#define HAVE_SIN 1
#define HAVE_SINF 1
#define HAVE_SQRT 1
#if _MSC_VER >= 1800
#define HAVE_STRTOLL 1
#define HAVE_VSSCANF 1
#define HAVE_COPYSIGN 1
#define HAVE_SCALBN 1
#endif
#if !defined(_MSC_VER) || defined(_USE_MATH_DEFINES)
#define HAVE_M_PI 1
#endif
#else
#include "SDL_config_minimal.h"
#endif /* platform config */
#define HAVE_STDARG_H 1
#define HAVE_STDDEF_H 1
#endif
/* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_DSOUND 1
#define SDL_AUDIO_DRIVER_XAUDIO2 1
#define SDL_AUDIO_DRIVER_WINMM 1
#define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable various input drivers */
#define SDL_JOYSTICK_DINPUT 1
#define SDL_HAPTIC_DINPUT 1
/* Enable various shared object loading systems */
#define SDL_LOADSO_WINDOWS 1
/* Enable various threading systems */
#define SDL_THREAD_WINDOWS 1
/* Enable various timer systems */
#define SDL_TIMER_WINDOWS 1
/* Enable various video drivers */
#define SDL_VIDEO_DRIVER_DUMMY 1
#define SDL_VIDEO_DRIVER_WINDOWS 1
#ifndef SDL_VIDEO_RENDER_D3D
#define SDL_VIDEO_RENDER_D3D 1
#endif
#ifndef SDL_VIDEO_RENDER_D3D11
#define SDL_VIDEO_RENDER_D3D11 0
#endif
/* Enable OpenGL support */
#ifndef SDL_VIDEO_OPENGL
#define SDL_VIDEO_OPENGL 1
#endif
#ifndef SDL_VIDEO_OPENGL_WGL
#define SDL_VIDEO_OPENGL_WGL 1
#endif
#ifndef SDL_VIDEO_RENDER_OGL
#define SDL_VIDEO_RENDER_OGL 1
#endif
#ifndef SDL_VIDEO_RENDER_OGL_ES2
#define SDL_VIDEO_RENDER_OGL_ES2 1
#endif
#ifndef SDL_VIDEO_OPENGL_ES2
#define SDL_VIDEO_OPENGL_ES2 1
#endif
#ifndef SDL_VIDEO_OPENGL_EGL
#define SDL_VIDEO_OPENGL_EGL 1
#endif
/* Enable system power support */
#define SDL_POWER_WINDOWS 1
/* Enable filesystem support */
#define SDL_FILESYSTEM_WINDOWS 1
/* Enable assembly routines (Win64 doesn't have inline asm) */
#ifndef _WIN64
#define SDL_ASSEMBLY_ROUTINES 1
#endif
#endif /* _SDL_config_h */
#endif /* _SDL_config_windows_h */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_config_amiga_h
#define _SDL_config_amiga_h
#include "SDL_platform.h"
/* This is a set of defines to configure the SDL features */
#define SDL_HAS_64BIT_TYPE 1
/* Useful headers */
#define HAVE_SYS_TYPES_H 1
#define HAVE_STDIO_H 1
#define STDC_HEADERS 1
#define HAVE_STRING_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_SIGNAL_H 1
/* C library functions */
#define HAVE_MALLOC 1
#define HAVE_CALLOC 1
#define HAVE_REALLOC 1
#define HAVE_FREE 1
#define HAVE_ALLOCA 1
#define HAVE_GETENV 1
#define HAVE_PUTENV 1
#define HAVE_MEMSET 1
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_MEMCMP 1
/* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_AHI 1
#define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable various cdrom drivers */
#define SDL_CDROM_DUMMY 1
/* Enable various input drivers */
#define SDL_JOYSTICK_AMIGA 1
/* Enable various shared object loading systems */
#define SDL_LOADSO_DUMMY 1
/* Enable various threading systems */
#define SDL_THREAD_AMIGA 1
/* Enable various timer systems */
#define SDL_TIMER_AMIGA 1
/* Enable various video drivers */
#define SDL_VIDEO_DRIVER_CYBERGRAPHICS 1
#define SDL_VIDEO_DRIVER_DUMMY 1
/* Enable OpenGL support */
#define SDL_VIDEO_OPENGL 1
#endif /* _SDL_config_amiga_h */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_config_dreamcast_h
#define _SDL_config_dreamcast_h
#include "SDL_platform.h"
/* This is a set of defines to configure the SDL features */
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef signed short int16_t;
typedef unsigned short uint16_t;
typedef signed int int32_t;
typedef unsigned int uint32_t;
typedef signed long long int64_t;
typedef unsigned long long uint64_t;
typedef unsigned long uintptr_t;
#define SDL_HAS_64BIT_TYPE 1
/* Useful headers */
#define HAVE_SYS_TYPES_H 1
#define HAVE_STDIO_H 1
#define STDC_HEADERS 1
#define HAVE_STRING_H 1
#define HAVE_CTYPE_H 1
/* C library functions */
#define HAVE_MALLOC 1
#define HAVE_CALLOC 1
#define HAVE_REALLOC 1
#define HAVE_FREE 1
#define HAVE_ALLOCA 1
#define HAVE_GETENV 1
#define HAVE_PUTENV 1
#define HAVE_QSORT 1
#define HAVE_ABS 1
#define HAVE_BCOPY 1
#define HAVE_MEMSET 1
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_MEMCMP 1
#define HAVE_STRLEN 1
#define HAVE_STRDUP 1
#define HAVE_INDEX 1
#define HAVE_RINDEX 1
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_STRTOL 1
#define HAVE_STRTOD 1
#define HAVE_ATOI 1
#define HAVE_ATOF 1
#define HAVE_STRCMP 1
#define HAVE_STRNCMP 1
#define HAVE_STRICMP 1
#define HAVE_STRCASECMP 1
#define HAVE_SSCANF 1
#define HAVE_SNPRINTF 1
#define HAVE_VSNPRINTF 1
/* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_DC 1
#define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable various cdrom drivers */
#define SDL_CDROM_DC 1
/* Enable various input drivers */
#define SDL_JOYSTICK_DC 1
/* Enable various shared object loading systems */
#define SDL_LOADSO_DUMMY 1
/* Enable various threading systems */
#define SDL_THREAD_DC 1
/* Enable various timer systems */
#define SDL_TIMER_DC 1
/* Enable various video drivers */
#define SDL_VIDEO_DRIVER_DC 1
#define SDL_VIDEO_DRIVER_DUMMY 1
#endif /* _SDL_config_dreamcast_h */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_config_macos_h
#define _SDL_config_macos_h
#include "SDL_platform.h"
/* This is a set of defines to configure the SDL features */
#include <MacTypes.h>
typedef SInt8 int8_t;
typedef UInt8 uint8_t;
typedef SInt16 int16_t;
typedef UInt16 uint16_t;
typedef SInt32 int32_t;
typedef UInt32 uint32_t;
typedef SInt64 int64_t;
typedef UInt64 uint64_t;
typedef unsigned long uintptr_t;
#define SDL_HAS_64BIT_TYPE 1
/* Useful headers */
#define HAVE_STDIO_H 1
#define STDC_HEADERS 1
#define HAVE_STRING_H 1
#define HAVE_CTYPE_H 1
#define HAVE_MATH_H 1
#define HAVE_SIGNAL_H 1
/* C library functions */
#define HAVE_MALLOC 1
#define HAVE_CALLOC 1
#define HAVE_REALLOC 1
#define HAVE_FREE 1
#define HAVE_ALLOCA 1
#define HAVE_ABS 1
#define HAVE_MEMSET 1
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_MEMCMP 1
#define HAVE_STRLEN 1
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_ITOA 1
#define HAVE_STRTOL 1
#define HAVE_STRTOD 1
#define HAVE_ATOI 1
#define HAVE_ATOF 1
#define HAVE_STRCMP 1
#define HAVE_STRNCMP 1
#define HAVE_SSCANF 1
/* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_SNDMGR 1
#define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable various cdrom drivers */
#if TARGET_API_MAC_CARBON
#define SDL_CDROM_DUMMY 1
#else
#define SDL_CDROM_MACOS 1
#endif
/* Enable various input drivers */
#if TARGET_API_MAC_CARBON
#define SDL_JOYSTICK_DUMMY 1
#else
#define SDL_JOYSTICK_MACOS 1
#endif
/* Enable various shared object loading systems */
#define SDL_LOADSO_MACOS 1
/* Enable various threading systems */
#define SDL_THREADS_DISABLED 1
/* Enable various timer systems */
#define SDL_TIMER_MACOS 1
/* Enable various video drivers */
#define SDL_VIDEO_DRIVER_DUMMY 1
#define SDL_VIDEO_DRIVER_DRAWSPROCKET 1
#define SDL_VIDEO_DRIVER_TOOLBOX 1
/* Enable OpenGL support */
#define SDL_VIDEO_OPENGL 1
#endif /* _SDL_config_macos_h */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_config_macosx_h
#define _SDL_config_macosx_h
#include "SDL_platform.h"
/* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */
#include <AvailabilityMacros.h>
/* This is a set of defines to configure the SDL features */
#define SDL_HAS_64BIT_TYPE 1
/* Useful headers */
/* If we specified an SDK or have a post-PowerPC chip, then alloca.h exists. */
#if ( (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (!defined(__POWERPC__)) )
#define HAVE_ALLOCA_H 1
#endif
#define HAVE_SYS_TYPES_H 1
#define HAVE_STDIO_H 1
#define STDC_HEADERS 1
#define HAVE_STRING_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_CTYPE_H 1
#define HAVE_MATH_H 1
#define HAVE_SIGNAL_H 1
/* C library functions */
#define HAVE_MALLOC 1
#define HAVE_CALLOC 1
#define HAVE_REALLOC 1
#define HAVE_FREE 1
#define HAVE_ALLOCA 1
#define HAVE_GETENV 1
#define HAVE_PUTENV 1
#define HAVE_UNSETENV 1
#define HAVE_QSORT 1
#define HAVE_ABS 1
#define HAVE_BCOPY 1
#define HAVE_MEMSET 1
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_MEMCMP 1
#define HAVE_STRLEN 1
#define HAVE_STRLCPY 1
#define HAVE_STRLCAT 1
#define HAVE_STRDUP 1
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
#define HAVE_STRTOLL 1
#define HAVE_STRTOULL 1
#define HAVE_STRTOD 1
#define HAVE_ATOI 1
#define HAVE_ATOF 1
#define HAVE_STRCMP 1
#define HAVE_STRNCMP 1
#define HAVE_STRCASECMP 1
#define HAVE_STRNCASECMP 1
#define HAVE_SSCANF 1
#define HAVE_SNPRINTF 1
#define HAVE_VSNPRINTF 1
#define HAVE_SIGACTION 1
#define HAVE_SETJMP 1
#define HAVE_NANOSLEEP 1
/* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_COREAUDIO 1
#define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable various cdrom drivers */
#define SDL_CDROM_MACOSX 1
/* Enable various input drivers */
#define SDL_JOYSTICK_IOKIT 1
/* Enable various shared object loading systems */
#ifdef __ppc__
/* For Mac OS X 10.2 compatibility */
#define SDL_LOADSO_DLCOMPAT 1
#else
#define SDL_LOADSO_DLOPEN 1
#endif
/* Enable various threading systems */
#define SDL_THREAD_PTHREAD 1
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
/* Enable various timer systems */
#define SDL_TIMER_UNIX 1
/* Enable various video drivers */
#define SDL_VIDEO_DRIVER_DUMMY 1
#if ((defined TARGET_API_MAC_CARBON) && (TARGET_API_MAC_CARBON))
#define SDL_VIDEO_DRIVER_TOOLBOX 1
#else
#define SDL_VIDEO_DRIVER_QUARTZ 1
#endif
#define SDL_VIDEO_DRIVER_DGA 1
#define SDL_VIDEO_DRIVER_X11 1
#define SDL_VIDEO_DRIVER_X11_DGAMOUSE 1
#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/usr/X11R6/lib/libX11.6.dylib"
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/usr/X11R6/lib/libXext.6.dylib"
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/usr/X11R6/lib/libXrandr.2.dylib"
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER "/usr/X11R6/lib/libXrender.1.dylib"
#define SDL_VIDEO_DRIVER_X11_VIDMODE 1
#define SDL_VIDEO_DRIVER_X11_XINERAMA 1
#define SDL_VIDEO_DRIVER_X11_XME 1
#define SDL_VIDEO_DRIVER_X11_XRANDR 1
#define SDL_VIDEO_DRIVER_X11_XV 1
/* Enable OpenGL support */
#define SDL_VIDEO_OPENGL 1
#define SDL_VIDEO_OPENGL_GLX 1
/* Disable screensaver */
#define SDL_VIDEO_DISABLE_SCREENSAVER 1
/* Enable assembly routines */
#define SDL_ASSEMBLY_ROUTINES 1
#ifdef __ppc__
#define SDL_ALTIVEC_BLITTERS 1
#endif
#endif /* _SDL_config_macosx_h */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_config_minimal_h
#define _SDL_config_minimal_h
#include "SDL_platform.h"
/* This is the minimal configuration that can be used to build SDL */
#include <stdarg.h>
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef signed short int16_t;
typedef unsigned short uint16_t;
typedef signed int int32_t;
typedef unsigned int uint32_t;
typedef unsigned int size_t;
typedef unsigned long uintptr_t;
/* Enable the dummy audio driver (src/audio/dummy/\*.c) */
#define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */
#define SDL_CDROM_DISABLED 1
/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */
#define SDL_JOYSTICK_DISABLED 1
/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */
#define SDL_LOADSO_DISABLED 1
/* Enable the stub thread support (src/thread/generic/\*.c) */
#define SDL_THREADS_DISABLED 1
/* Enable the stub timer support (src/timer/dummy/\*.c) */
#define SDL_TIMERS_DISABLED 1
/* Enable the dummy video driver (src/video/dummy/\*.c) */
#define SDL_VIDEO_DRIVER_DUMMY 1
#endif /* _SDL_config_minimal_h */
此差异已折叠。
此差异已折叠。
此差异已折叠。
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
此差异已折叠。
此差异已折叠。
此差异已折叠。
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/** @file SDL_getenv.h
* @deprecated Use SDL_stdinc.h instead
*/
/* DEPRECATED */
#include "SDL_stdinc.h"
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
#define SDL_REVISION "hg-8628:b558f99d48f0"
#define SDL_REVISION_NUMBER 8628
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册