Updated SDL 1.3 to the latest libsdl.org - it's now named SDL2

This commit is contained in:
pelya
2012-05-23 17:23:57 +03:00
parent ed8724c8bb
commit 0c1ee22ffa
454 changed files with 4837 additions and 6631 deletions

View File

@@ -1,6 +1,6 @@
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,172 +0,0 @@
Sam - Mon Aug 6 23:02:37 PDT 2007
------
Add color modulation to blitting
Blit convert format X -> format Y (needed for texture upload)
Blit copy / blend / modulate format X -> format X (needed for software renderer)
Create full software renderer for framebuffer interfaces.
Create texture for surface, keep surface around as pixel source, allow
copying / blending / modulating from surface to display (automatically
generate texture?)
At that point, should anyone be using anything besides textures for display?
IRC - Mon Aug 6 23:50:44 PDT 2007
-----
[11:07pm] icculus: so we're clear, "textures" replace "surfaces" from 1.2 when you want to get stuff to the screen? So you have a definitely point where it stops being pixels in memory and starts being an object on the graphics card?
[11:07pm] icculus: Upload once, blit many
[11:07pm] icculus: something like that?
[11:07pm] slouken: That's the idea, yes
[11:07pm] icculus: ok, just making sure
[11:08pm] slouken: Many drivers retain the "texture" as a surface and blit to opaque bits which then get copied into a framebuffer.
[11:08pm] slouken: retain -> would retain
[11:08pm] icculus: yeah, I figured
[11:08pm] slouken: That's why the features for surface blitting need to match the features for texture display.
[11:08pm] icculus: But it gives an abstraction where the app has to make a conscious action: the upload is slow, but then the blit is fast.
[11:09pm] icculus: This couldn't just map to LockSurface, though?
[11:09pm] slouken: Yes, exactly. I wasn't sure whether to make that clear, e.g. can you display any surface, and automatically generate a texture (if necessary)?
[11:09pm] slouken: If not, it simplifies the framebuffer case.
[11:10pm] slouken: But even the framebuffer case will probably still want to convert the bits to the optimal format.
[11:10pm] slouken: And at that point, the non-optimal bits can be thrown away.
[11:11pm] slouken: e.g. SDL_DisplayFormat()
[11:10pm] icculus: oh, that's a good point.
[11:10pm] icculus: hmm
[11:11pm] icculus: yeah, okay
[11:11pm] icculus: I was thinking about if the separation is really necessary, or if LockSurface would imply a texture creation (and you just have much more strict locking requirements than most 1.2 targets had)
[11:11pm] slouken: That's also why I separated the conversion blits from the copy / blend / modulate blits.
[11:12pm] icculus: But I like that the app has to be conscious of when that's happening
[11:12pm] slouken: Yeah, I was really leaning towards making it implicit, but the memory savings is pretty significant for artwork.
[11:12pm] icculus: SDL_compat can wrap the difference for people that can't get their head around it.
[11:13pm] icculus: At the performance cost, that can be a totally external layer that manages it like 1.2's locking.
[11:13pm] slouken: Well, SDL_compat is entirely software on top of a single texture that represents the screen.
[11:14pm] slouken: Yeah, that's the way it's implemented right now.
[11:14pm] slouken: a HWSURFACE is one that is backed by a texture, and lock/unlock is used to synchronize the bits.
[11:14pm] slouken: I'm not sure if that's worth keeping though, if SDL_compat is software only.
[11:15pm] slouken: It would minimize code migration though.
[11:15pm] icculus: yeah
[11:15pm] icculus: I expect SDL_compat to be a complete cesspool
[11:15pm] icculus: just a black box that no one touches or looks at more than necessary
[11:15pm] slouken: more or less, but it's actually pretty clean right now... I think as a side effect of the new API being pretty clean.
[11:15pm] slouken: I'm just unsure how much to use texture vs HWSURFACE
[11:16pm] icculus: Besides, you'd be surprised how quickly you can get people to move if you flag functions as deprecated so that GCC bitches when you use them.
[11:16pm] slouken:
[11:16pm] icculus: how much to use texture vs HWSURFACE in 1.3, or in SDL_compat?
[11:16pm] slouken: in 1.3
[11:17pm] icculus: Pick one or the other, I would say.
[11:17pm] icculus: I don't think it's good to confuse people with both terms
[11:17pm] slouken: yeah
[11:17pm] icculus: Everything is software until it's a texture.
[11:17pm] slouken: I'm just not sure which
[11:17pm] slouken: that's certainly cleanest.
[11:18pm] slouken: and what's currently implemented
[11:18pm] slouken: Let's think through the migration process...
[11:18pm] icculus: Plus dropping the term HWSURFACE gets the point across that a) this isn't 1.2 and b) this is probably going to a 3D api that you should be using anyhow.
[11:18pm] • slouken nods
[11:18pm] icculus: I mean, "texture" is what every API calls these things
[11:18pm] slouken: Yep
[11:19pm] slouken: So let's work through a migration case...
[11:19pm] icculus: ok
[11:19pm] slouken: FooBall loads a big background and a bunch of sprites. They are png, loaded into SDL_Surface with SDL_image, then converted with SDL_DisplayFormat()
[11:20pm] slouken: Then the background is blitted every frame and the sprites are blended on top.
[11:20pm] slouken: In the compat case:
[11:21pm] slouken: SDL_SetVideoMode() creates a single lockable texture for the display. DisplayFormat() converts the bits into the optimal format, all blitting is done in software, and SDL_UpdateRects() pushes the bits into the texture and the texture is rendered.
[11:21pm] slouken: In the 1.3 case:
[11:22pm] slouken: The background and sprites are converted to textures using SDL_CreateTextureFromSurface(), and the appropriate blending flags are set. Each frame copies the textures into place and then the display is presented.
[11:23pm] slouken: compat is software only, 1.3 can be 3D accelerated.
[11:23pm] icculus: wait, why does all blitting have to be done in software in the SDL_compat case?
[11:23pm] icculus: I don't understand why SDL_compat can't move things between surfaces and textures at Lock/Unlock time
[11:24pm] slouken: Because by default the screen isn't created with HWSURFACE, since apps expect to be able to munge the bits. Therefore, the blits to it have to be done locally.
[11:24pm] icculus: And all the surfaces are flagged HWSURFACE, so ->pixels is NULL until locked.
[11:24pm] icculus: oh
[11:24pm] icculus: It wasn't possible to have a HWSURFACE screen?
[11:25pm] slouken: Yes, it was, just nobody did it because alpha blending needs to read from video memory, and poking pixels across the bus is slow.
[11:25pm] slouken: Even in 1.3, the Xlib case needs to be software renderer if you want to do any alpha blending.
[11:26pm] icculus: But arguably there's no reason that can't all be HWSURFACE (that is, they need to get moved to a texture, even if that's still a software renderer on the backend)
[11:26pm] icculus: That sounds like it's only a problem when an app touches SDL_GetVideoSurface()->pixels without checking if they should lock it.
[11:26pm] icculus: Which might be quite common
[11:27pm] slouken: Yep, in 1.2 the app was able to specify it, and most explicitly don't because it's either not available or bad for alpha blending and direct pixel poking.
[11:27pm] icculus: hmm.
[11:28pm] slouken: You see why I've been going round and round for months on this?
[11:28pm] icculus: Well, we're talking about a compatibility layer; if it's going to crash without LockSurface() on the screen, make them lock it. If that makes it slow, so be it.
[11:29pm] icculus: The options are make small changes and take a performance hit, or make bigger changes and get a big performance win.
[11:29pm] icculus: (if touching the framebuffer directly, that is)
[11:29pm] slouken: Well, at that point it's a compatibility layer, why not just leave it software? (devil's advocate here)
[11:29pm] icculus: That's a good point.
[11:30pm] slouken: Unless we leave everything surfaces to get the best of both worlds...
[11:30pm] • slouken gets dizzy
[11:30pm] icculus: From a technical elegance viewpoint, I can see a good mapping between HWSURFACE and textures, but realistically, you want to motivate people to move away from old APIs.
[11:31pm] slouken: Yeah probably. There's a certain attraction to retaining the SDL_Surface usage even for hardware surfaces, simply because of code reuse. You don't have to have separate code for your software composition and your rendering. You also get to keep your old image loading code, etc.
[11:31pm] icculus: man, this really is a pain in the ass, I see what you mean.
[11:32pm] slouken: Yeah.
[11:32pm] icculus: hmm, let me think on this awhile.
[11:32pm] slouken: On the other hand, separating the Texture API for rendering is clearer and allows extension in the future.
[11:32pm] slouken: We could potentially allow you to create a software renderer pointed at an SDL surface....
[11:32pm] slouken: Hmmm
[11:33pm] icculus: well, that's what you have now for something like Doom
[11:33pm] icculus: you render to a shadow surface, and throw a hail-mary with SDL_Flip()
[11:34pm] slouken: Yep. I mean a 1.3 "renderer" with an SDL_Surface or another texture as the target.
[11:34pm] icculus: More or less, that doesn't change. The only important thing there is not generating a new texture every time, but being able to discard what's currently in it for a fresh upload.
[11:34pm] slouken: Yep
[11:34pm] icculus: oh, I see
[11:35pm] icculus: render-to-surface
[11:35pm] slouken: lol
[11:35pm] slouken: yeah
[11:36pm] slouken: So... where to draw the line with surface vs texture...
[11:37pm] icculus: I don't know, I would think that basically you want to get out of surfaces as fast as possible
[11:37pm] icculus: (disregarding SDL_compat for the moment)
[11:37pm] slouken: Yeah, I think so.
[11:37pm] slouken: Load the bits up, throw them into a texture, and go
[11:37pm] icculus: And basically all you really need for that is an "upload" function.
[11:38pm] slouken: Yep
[11:38pm] icculus: I'd even be inclined to not allow "Locking," so there's no readback.
[11:38pm] icculus: well, I'm sure that would cause a fight
[11:38pm] • slouken thinks
[11:40pm] slouken: Let me see where I use SDL_LockTexture() right now.
[11:42pm] slouken: The only time that's useful is to avoid a buffer copy when you're already writing the bits in the correct format.
[11:42pm] slouken: e.g. lock -> software render into bits -> unlock (upload)
[11:43pm] slouken: that may already be taken care of by the upload though.
[11:43pm] slouken: e.g. software render into bits -> upload
[11:44pm] slouken: Oh yeah, there's probably a memory copy of the bits though, so it's: upload = copy into cached bits, copy cached bits to video memory as needed. In that case if you lock to get access to the cached bits directly that's a win.
[11:44pm] icculus: ah, okay
[11:47pm] icculus: I don't know, my head hurts.
[11:47pm] slouken: Yeah, mine too.
[11:47pm] slouken: I was pretty happy with the current setup until I noticed that it's really hard to write a framebuffer driver right now.
[11:49pm] slouken: I think maybe if I clean that up and separate conversion blit and copy / blend / modulate blit, then it may work pretty cleanly.
[11:49pm] icculus: yeah
[11:54pm] slouken: So recapping... SDL_Surface is only used for loading and app composition.
[11:55pm] slouken: SDL surface blitting is enhanced to maintain parity with the renderer features, since it's used as the core of the software renderer.
[11:56pm] slouken: The software renderer is adapted to be a standalone module targeting either an SDL_Surface or an SDL_Texture.
[11:56pm] slouken: SDL_HWSURFACE goes away
[11:57pm] slouken: Anything I'm missing?
[11:58pm] icculus: no, sounds good
[11:58pm] slouken: This means we have the new 1.3 texture API pretty much as it stands.
[11:59pm] slouken: Right?
[11:59pm] icculus: yeah, I think so
[12:00am] slouken: I was trying to see if it was possible to make a pluggable blit API, but I was going insane with trying to figure out how to make it fast.
[12:01am] slouken: If it were software only I could just say, write your own and register it here, but you'd have to maintain parity with the OpenGL and Direct3D renderers as well.
[12:01am] slouken: At that point you might as well be working in surfaces and uploading to texture.
[12:02am] icculus: yeah
TODO
----
Change textures to static/streaming. Static textures are not lockable,
streaming textures are lockable and may have system memory pixels available.
SDL_compat will use a streaming video texture, and will never be HWSURFACE,
but may be PREALLOC, if system memory pixels are available.
*** DONE Thu Aug 16 14:18:42 PDT 2007
The software renderer will be abstracted so the surface management can be
used by any renderer that provides functions to copy surfaces to the window.
Blitters...
----
Copy blit and fill rect are optimized with MMX and SSE now.
Here are the pieces we still need:
- Merging SDL texture capabilities into the SDL surface system
- Generic fallback blitter architecture
- Custom fast path blitters

View File

@@ -3,7 +3,7 @@
(SDL)
Version 1.3
Version 2.0
---
http://www.libsdl.org/

View File

@@ -1,13 +0,0 @@
SDL on BeOS R5
==============
You can build SDL on BeOS like any other GNU style package.
e.g. ./configure && make && make install
By default it is installed in /boot/develop/tools/gnupro/{bin,lib,etc.}
Once you install SDL, you need to copy libSDL.so to /boot/home/config/lib,
so it can be found by the dynamic linker.
Enjoy!
Sam Lantinga (slouken@libsdl.org)

View File

@@ -1,139 +0,0 @@
Using SDL 1.3 under Windows with the OpenWatcom compiler
====================================================
Prerequisites
-------------
I have done the port under Windows XP Professional with SP2 installed.
Windows 2000 should also be working. I'm not so sure about ancient Windows NT,
since only DirectX 3 is available there. Building should be possible,
but running the compiled applications will probalbly fail with
SDL_VIDEODRIVER=directx. The windib driver should work, though.
To compile and use the SDL with Open Watcom you will need the following:
- Open Watcom compiler. I used version 1.8. The environment variables
PATH, WATCOM and INCLUDE need to be set appropriately - please consult
the OpenWatcom documentation and instructions given during the
installation of the compiler.
My setup looks like this in owvars.bat:
set WATCOM=C:\dev\ow18
set INCLUDE=%WATCOM%\h;%WATCOM%\h\nt
set PATH=%PATH%;%WATCOM%\binnt;%WATCOM%\binw
- A recent DirectX SDK. The library needs D3d9.h so at leat the
directx 9 sdk is to be used. I used DirectX 10 SDK from August 2009
taken directly from the microsoft site.
- The SDL 1.3 sources from Subversion
- The file Watcom-Win32.zip (now available in Subversion)
Building the Library
--------------------
1) In the SDL base directory extract the archive Watcom-Win32.zip. This
creates a subdirectory named 'watcom'.
2) The makefile expects the environment variable DXDIR to be set to the
base directory of a DirectX SDK. I have tried the August 2009
DirectX SDK from Microsoft
You can also edit the makefile directly and hard code your path to
the SDK on your system.
I have this in my setup:
set DXDIR=..\dx10
3) Enter the watcom directory and run
wmake sdl
4) All tests from the test directory are working and can be built by
running
wmake tests
Notes:
The makefile offers some options to tweak the way the library is built.
You have at your disposal the option to build a static (default)
library, or a DLL (with tgt=dll). You can also choose whether to build
a Release (default) or a Debug version (with build=debug) of the tests
and library. Please consult the usage comment at the top of the
makefile for usage instructions.
If you specify a test target (i.e. 'wmake tests' for all tests, or
selected targets like 'wmake testgl testvidinfo testoverlay2'), the
tests are always freshly compiled and linked. This is done to
minimise hassle when switching between library versions (static vs.
DLL), because they require subtly different options.
Also, the test executables are put directly into the test directory,
so they can find their data files. The clean target of the makefile
removes the test executables and the SDL.dll file from the test
directory.
To use the library in your own projects with Open Watcom, you can use
the way the tests are built as base of your own build environment.
The library can also be built with the stack calling convention of the
compiler (-6s instead of -6r).
Test applications
-----------------
$FixME: which test works ? which one compiles ?
I've tried to make all tests work. The following table gives an overview
of the current status.
Testname Status
~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
checkkeys +
graywin +
loopwave +
testalpha +
testbitmap +
testdyngl +
testerror +
testfile +
testgamma +
testgl +
testhread +
testiconv - (all failed)
testkeys +
testlock +
testoverlay + (needs 'set SDL_VIDEODRIVER=directx')
testoverlay2 + (needs 'set SDL_VIDEODRIVER=directx')
testpalette +
testplatform +
testsem +
testsprite +
testtimer +
testver +
testvidinfo +
testwin ? (fading doesn't seem right)
testwm +
torturethread +
testcdrom +
testjoystick not tested
threadwin +
testcursor +
TODO
----
There is room for further improvement:
- Test joystick functionality.
- Investigate fading issue in 'testwin' test.
- Fix the UTF-8 support.
- Adapt the makefile/object file list to support more target systems
- Use "#pragma aux" syntax for the CPU info functions.
Questions and Comments
----------------------
Please direct any questions or comments to me:
ow_sdl [at] digitalfantasy [dot] it
The original porting to the open watcom compiler was made by
Marc Peter <mailto:macpete@gmx.de>
Happy Coding!
Daniele Forghieri

View File

@@ -39,7 +39,8 @@ src/main/android/SDL_android_main.cpp
Instructions:
1. Copy the android-project directory wherever you want to keep your projects and rename it to the name of your project.
2. Move this SDL directory into the <project>/jni directory
2. Move this SDL directory into the <project>/jni directory and then copy
SDL_config_android.h to SDL_config.h inside the include folder
3. Place your application source files in the <project>/jni/src directory
4. Edit <project>/jni/src/Android.mk to include your source files
5. Run 'ndk-build' (a script provided by the NDK). This compiles the C source

View File

@@ -6,11 +6,8 @@ Simple DirectMedia Layer for Nintendo DS
* The devkitpro SDK available at http://devkitpro.org.
Read the information at http://devkitpro.org/wiki/Getting_Started/devkitARM
The necessary packages are devkitARM, libnds, libfat and default arm7.
* The hardware renderer is using the libgl2d abstraction library that can be found at:
http://rel.phatcode.net/junk.php?id=117
Build it, and install the library and the header where SDL can find them (ie. in
the libnds/lib and libnds/include directories).
* Optionally, use a DS emulator, such as desmume (http://desmume.org/)
to program and debug.
-Building SDL-
@@ -18,23 +15,31 @@ After setting the devkitpro environment, cd into your SDL directory and type:
make -f Makefile.ds
This will compile and install the library and headers into the
devkitpro's portlibs directory. Additionnaly it will compile several
tests that you can run either on the DS or with desmume. For instance:
devkitpro's portlibs directory (../portlibs/arm/lib/ and
../portlibs/arm/include/). Additionally it will compile several tests
that you can run either on the DS or with desmume. For instance:
desmume --cflash-path=test/ test/nds-test-progs/testsprite2/testsprite2.nds
desmume --cflash-path=test/ test/nds-test-progs/testspriteminimal/testspriteminimal.nds
desmume --cflash-path=test/ test/nds-test-progs/testscale/testscale.nds
desmume test/nds-test-progs/general/general.nds
-Notes-
* The renderer code is based on the gl like engine. It's not using the sprite engine.
* The hardware renderer is using the parts of the libgl2d abstraction library that can be found at:
http://rel.phatcode.net/junk.php?id=117
Used with the author's permission.
* The port is very basic and incomplete:
- SDL currently has to be compiled for either framebuffer mode or render mode.
- SDL currently has to be compiled for either framebuffer mode or renderer mode.
See USE_HW_RENDERER in Makefile.ds.
- some optional renderer functions are not implemented.
- no sound
-Limitations-
* in hardware renderer mode, don't load too many textures. The internal format is
2 bytes per pixel. And there is only 256KB reserved for the textures. For instance,
testscale won't display sample.bmp, unless it's resized to a smaller picture.
* the screen size is 256 x 384. Anything else won't work.
* there is no 8 bits/pixel mode because SDL 1.3 doesn't support palettes.
* there is no 8 bits/pixel mode because SDL 2.0 doesn't support palettes.
-Joystick mapping-
The Joystick presented to SDL has 2 axes and 8 buttons

View File

@@ -5,30 +5,31 @@ Building the Simple DirectMedia Layer for iPhone OS 2.0
Requirements: Mac OS X v10.5 or later and the iPhone SDK.
Instructions:
1. Open SDLiPhoneOS.xcodeproj (located in Xcode-iPhoneOS/SDL) in XCode.
2. Set Project->Set Active SDK to "Use Project Settings"
3. Select your desired target, and hit build.
1. Open SDL.xcodeproj (located in Xcode-iOS/SDL) in XCode.
2. Select your desired target, and hit build.
There are three build targets:
- StaticLibiPhoneOS:
Build SDL as a statically linked (armv6) library for iPhone OS 2.0.
- StaticLibSimulator:
Build SDL as a statically linked (x86) library for the iPhone Simulator
- libSDL.a:
Build SDL as a statically linked library
- testsdl
Build a test program (there are known test failures which are fine)
- Template:
Package a project template together with the SDL for iPhone static libraries and copies of the SDL headers. The template includes proper references to the SDL library and headers, skeleton code for a basic SDL program, and placeholder graphics for the application icon and startup screen.
==============================================================================
Using the Simple DirectMedia Layer for iPhone OS 2.0
Using the Simple DirectMedia Layer for iOS
==============================================================================
FIXME: This needs to be updated for the latest methods
Here is the easiest method:
1. Build the SDL libraries (libSDLiPhoneOS.a and libSDLSimulator.a) and the iPhone SDL Application template.
1. Install the iPhone SDL Application template by copying it to one of XCode's template directories. I recommend creating a directory called "SDL" in "/Developer/Platforms/iPhoneOS.platform/Developer/Library/XCode/Project Templates/" and placing it there.
1. Build the SDL libraries (libSDL.a and libSDLSimulator.a) and the iPhone SDL Application template.
1. Install the iPhone SDL Application template by copying it to one of XCode's template directories. I recommend creating a directory called "SDL" in "/Developer/Platforms/iOS.platform/Developer/Library/XCode/Project Templates/" and placing it there.
2. Start a new project using the template. The project should be immediately ready for use with SDL.
Here is a more manual method:
1. Create a new iPhone view based application.
2. Build the SDL static libraries (libSDLiPhoneOS.a and libSDLSimulator.a) for iPhone and include them in your project. XCode will ignore the library that is not currently of the correct architecture, hence your app will work both on iPhone and in the iPhone Simulator.
2. Build the SDL static libraries (libSDL.a and libSDLSimulator.a) for iPhone and include them in your project. XCode will ignore the library that is not currently of the correct architecture, hence your app will work both on iPhone and in the iPhone Simulator.
3. Include the SDL header files in your project.
4. Remove the ApplicationDelegate.h and ApplicationDelegate.m files -- SDL for iPhone provides its own UIApplicationDelegate. Remove MainWindow.xib -- SDL for iPhone produces its user interface programmatically.
5. Delete the contents of main.m and program your app as a regular SDL program instead. You may replace main.m with your own main.c, but you must tell XCode not to use the project prefix file, as it includes Objective-C code.
@@ -86,7 +87,7 @@ MySDLApp Home/
When your SDL based iPhone application starts up, it sets the working directory to the main bundle (MySDLApp Home/MySDLApp.app), where your application resources are stored. You cannot write to this directory. Instead, I advise you to write document files to "../Documents/" and preferences to "../Library/Preferences".
More information on this subject is available here:
http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/ApplicationEnvironment/chapter_6_section_3.html#//apple_ref/doc/uid/TP40007072-CH7-SW21
http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Introduction/Introduction.html
==============================================================================
Notes -- iPhone SDL limitations
@@ -96,7 +97,7 @@ Windows:
Full-size, single window applications only. You cannot create multi-window SDL applications for iPhone OS. The application window will fill the display, though you have the option of turning on or off the menu-bar (pass SDL_CreateWindow the flag SDL_WINDOW_BORDERLESS). Presently, landscape mode is not supported.
Video:
For real time frame-rates, you are advised to use strictly SDL 1.3 video calls. Using compatibility video calls uploads an OpenGL texture for each frame drawn, and this operation is excruciatingly slow.
For real time frame-rates, you are advised to use strictly SDL 2.0 video calls. Using compatibility video calls uploads an OpenGL texture for each frame drawn, and this operation is excruciatingly slow.
Textures:
SDL for iPhone Textures supports only SDL_PIXELFORMAT_ABGR8888 and SDL_PIXELFORMAT_RGB24 pixel formats. This is because texture support in SDL for iPhone is done through OpenGL ES, which supports fewer pixel formats than OpenGL, will not re-order pixel data for you, and has no support for color-paletted formats (without extensions).
@@ -107,5 +108,3 @@ Audio:
Loading Shared Objects:
This is disabled by default since it seems to break the terms of the iPhone SDK agreement. It can be re-enabled in SDL_config_iphoneos.h.

View File

@@ -1,7 +1,7 @@
SDL 1.3 with open pandora console support ( http://openpandora.org/ )
SDL 2.0 with open pandora console support ( http://openpandora.org/ )
=====================================================================
- A pandora specific video driver was writed to allow SDL 1.3 with OpenGL ES
- A pandora specific video driver was writed to allow SDL 2.0 with OpenGL ES
support to work on the pandora under the framebuffer. This driver do not have
input support for now, so if you use it you will have to add your own control code.
The video driver name is "pandora" so if you have problem running it from

View File

@@ -1,35 +1,9 @@
Eli Gottlieb's checklist for the GSOC shaped windows project. Dated July 9, 2010.
1. Enable proper linking of the X11 implementation and test it.
--> Find the place in the build system for platform-specific linking flags. STATUS: DONE
--> Add a linker flag to bring in libXext.a. STATUS: DONE.
2. Build the Win32 implementation of shaped-windows functionality.
--> Add driver functions to the SDL_ShapeDriver in the Win32 driver's SDL_DisplayDevice at the proper point in the code. STATUS: CHECK.
--> Add a hook in the Windows resize-window code to call Win32_ResizeWindowShape(). STATUS: CHECK.
--> Get the Windows code to build and run properly. STATUS: IN PROGRESS.
3. Enable building the testeyes program.
--> Reprogram it to use the latest shaped-windows API. STATUS: CHECK.
--> Get it, along with the rest of the test suite in my branch, building successfully. STATUS: DONE.
--> Debug testeyes and the platform-specific shaped-window implementations in tandem. STATUS: IN PROGRESS.
4. Implement the SDL shaped-windows API for Mac OS X using Cocoa. STATUS: IN PROGRESS
--> Locate (once more) the API documentation for shaped windows under Cocoa. STATUS: NEARLY FINISHED.
--> Design and encode a version of SDL_ShapeData for Cocoa. STATUS: IN PROGRESS.
--> Write Cocoa_CreateShaper(). STATUS: MOSTLY DONE, AFAIK.
--> Write Cocoa_ResizeWindowShape(). STATUS: DONE, AFAIK.
--> Write Cocoa_SetWindowShape(). STATUS: IN PROGRESS.
--> If necessary, implement functionality adjunct to SDL_CalculateShapeBitmap() for Cocoa usage.
5. Use testeyes to debug all implementations. STATUS: SPRINT + 2.
--> Debug Cocoa implementation.
--> Debug Win32 implementation.
--> Debug X11 implementation (again).
1.3 release checklist:
2.0 release checklist:
* http://wiki.libsdl.org/moin.cgi/Roadmap
* See why windows are being rearranged. Is the shield window not up?
* Make sure you can create and show a fullscreen window in one step
* Figure out how to handle OpenGL context lost on Mac OS X (does it happen?)
* Write automated test case for multi-draw APIs
* Make sure you can build SDL without the renderer to slim it down a bunch
* Implement assertion code on iPhone
* Add __WINDOWS__ in addition to __WIN32__

View File

@@ -1,709 +1,3 @@
This is a list of API changes in SDL's version history.
1.3.0:
Added SDL_GetNumVideoDrivers() and SDL_GetVideoDriver().
Replaced SDL_VideoDriverName() with SDL_GetCurrentVideoDriver()
Added SDL_GetNumAudioDrivers() and SDL_GetAudioDriver().
Replaced SDL_AudioDriverName() with SDL_GetCurrentAudioDriver()
1.2.10:
If SDL_OpenAudio() is passed zero for the desired format
fields, the following environment variables will be used
to fill them in:
SDL_AUDIO_FREQUENCY
SDL_AUDIO_FORMAT
SDL_AUDIO_CHANNELS
SDL_AUDIO_SAMPLES
If an environment variable is not specified, it will be set
to a reasonable default value.
Added support for the SDL_VIDEO_FULLSCREEN_HEAD environment
variable, currently supported on X11 Xinerama configurations.
Added SDL_GL_SWAP_CONTROL to wait for vsync in OpenGL applications.
Added SDL_GL_ACCELERATED_VISUAL to guarantee hardware acceleration.
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.
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.)
Added SDL_GetKeyRepeat()
Added SDL_config.h, with defaults for various build environments.
1.2.7:
Added CPU feature detection functions to SDL_cpuinfo.h:
SDL_HasRDTSC(), SDL_HasMMX(), SDL_Has3DNow(), SDL_HasSSE(),
SDL_HasAltiVec()
Added function to create RWops from const memory: SDL_RWFromConstMem()
1.2.6:
Added SDL_LoadObject(), SDL_LoadFunction(), and SDL_UnloadObject()
Added SDL_GL_MULTISAMPLEBUFFERS and SDL_GL_MULTISAMPLESAMPLES for FSAA
1.2.5:
Added SDL_BUTTON_WHEELUP (4) and SDL_BUTTON_WHEELDOWN (5)
Added SDL_GL_STEREO for stereoscopic OpenGL contexts
1.2.0:
Added SDL_VIDEOEXPOSE event to signal that the screen needs to
be redrawn. This is currently only delivered to OpenGL windows
on X11, though it may be delivered in the future when the video
memory is lost under DirectX.
1.1.8:
You can pass SDL_NOFRAME to SDL_VideoMode() to create a window
that has no title bar or frame decoration. Fullscreen video
modes automatically have this flag set.
Added a function to query the clipping rectangle for a surface:
void SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect)
Added a function to query the current event filter:
SDL_EventFilter SDL_GetEventFilter(void)
If you pass -1 to SDL_ShowCursor(), it won't change the current
cursor visibility state, but will still return it.
SDL_LockSurface() and SDL_UnlockSurface() are recursive, meaning
you can nest them as deep as you want, as long as each lock call
has a matching unlock call. The surface remains locked until the
last matching unlock call.
Note that you may not blit to or from a locked surface.
1.1.7:
The SDL_SetGammaRamp() and SDL_GetGammaRamp() functions now take
arrays of Uint16 values instead of Uint8 values. For the most part,
you can just take your old values and shift them up 8 bits to get
new correct values for your gamma ramps.
You can pass SDL_RLEACCEL in flags passed to SDL_ConvertSurface()
and SDL will try to RLE accelerate colorkey and alpha blits in the
resulting surface.
1.1.6:
Added a function to return the thread ID of a specific thread:
Uint32 SDL_GetThreadID(SDL_Thread *thread)
If 'thread' is NULL, this function returns the id for this thread.
1.1.5:
The YUV overlay structure has been changed to use an array of
pitches and pixels representing the planes of a YUV image, to
better enable hardware acceleration. The YV12 and IYUV formats
each have three planes, corresponding to the Y, U, and V portions
of the image, while packed pixel YUV formats just have one plane.
For palettized mode (8bpp), the screen colormap is now split in
a physical and a logical palette. The physical palette determines
what colours the screen pixels will get when displayed, and the
logical palette controls the mapping from blits to/from the screen.
A new function, SDL_SetPalette() has been added to change
logical and physical palettes separately. SDL_SetColors() works
just as before, and is equivalent to calling SDL_SetPalette() with
a flag argument of (SDL_LOGPAL|SDL_PHYSPAL).
SDL_BlitSurface() no longer modifies the source rectangle, only the
destination rectangle. The width/height members of the destination
rectangle are ignored, only the position is used.
The old source clipping function SDL_SetClipping() has been replaced
with a more useful function to set the destination clipping rectangle:
SDL_bool SDL_SetClipRect(SDL_Surface *surface, SDL_Rect *rect)
Added a function to see what subsystems have been initialized:
Uint32 SDL_WasInit(Uint32 flags)
The Big Alpha Flip: SDL now treats alpha as opacity like everybody
else, and not as transparency:
A new cpp symbol: SDL_ALPHA_OPAQUE is defined as 255
A new cpp symbol: SDL_ALPHA_TRANSPARENT is defined as 0
Values between 0 and 255 vary from fully transparent to fully opaque.
New functions:
SDL_DisplayFormatAlpha()
Returns a surface converted to a format with alpha-channel
that can be blit efficiently to the screen. (In other words,
like SDL_DisplayFormat() but the resulting surface has
an alpha channel.) This is useful for surfaces with alpha.
SDL_MapRGBA()
Works as SDL_MapRGB() but takes an additional alpha parameter.
SDL_GetRGBA()
Works as SDL_GetRGB() but also returns the alpha value
(SDL_ALPHA_OPAQUE for formats without an alpha channel)
Both SDL_GetRGB() and SDL_GetRGBA() now always return values in
the [0..255] interval. Previously, SDL_GetRGB() would return
(0xf8, 0xfc, 0xf8) for a completely white pixel in RGB565 format.
(N.B.: This is broken for bit fields < 3 bits.)
SDL_MapRGB() returns pixels in which the alpha channel is set opaque.
SDL_SetAlpha() can now be used for both setting the per-surface
alpha, using the new way of thinking of alpha, and also to enable
and disable per-pixel alpha blending for surfaces with an alpha
channel:
To disable alpha blending:
SDL_SetAlpha(surface, 0, 0);
To re-enable alpha blending:
SDL_SetAlpha(surface, SDL_SRCALPHA, 0);
Surfaces with an alpha channel have blending enabled by default.
SDL_SetAlpha() now accepts SDL_RLEACCEL as a flag, which requests
RLE acceleration of blits, just as like with SDL_SetColorKey().
This flag can be set for both surfaces with an alpha channel
and surfaces with an alpha value set by SDL_SetAlpha().
As always, RLE surfaces must be locked before pixel access is
allowed, and unlocked before any other SDL operations are done
on it.
The blit semantics for surfaces with and without alpha and colorkey
have now been defined:
RGBA->RGB:
SDL_SRCALPHA set:
alpha-blend (using alpha-channel).
SDL_SRCCOLORKEY ignored.
SDL_SRCALPHA not set:
copy RGB.
if SDL_SRCCOLORKEY set, only copy the pixels matching the
RGB values of the source colour key, ignoring alpha in the
comparison.
RGB->RGBA:
SDL_SRCALPHA set:
alpha-blend (using the source per-surface alpha value);
set destination alpha to opaque.
SDL_SRCALPHA not set:
copy RGB, set destination alpha to opaque.
both:
if SDL_SRCCOLORKEY set, only copy the pixels matching the
source colour key.
RGBA->RGBA:
SDL_SRCALPHA set:
alpha-blend (using the source alpha channel) the RGB values;
leave destination alpha untouched. [Note: is this correct?]
SDL_SRCCOLORKEY ignored.
SDL_SRCALPHA not set:
copy all of RGBA to the destination.
if SDL_SRCCOLORKEY set, only copy the pixels matching the
RGB values of the source colour key, ignoring alpha in the
comparison.
RGB->RGB:
SDL_SRCALPHA set:
alpha-blend (using the source per-surface alpha value).
SDL_SRCALPHA not set:
copy RGB.
both:
if SDL_SRCCOLORKEY set, only copy the pixels matching the
source colour key.
As a special case, blits from surfaces with per-surface alpha
value of 128 (50% transparency) are optimised and much faster
than other alpha values. This does not apply to surfaces with
alpha channels (per-pixel alpha).
New functions for manipulating the gamma of the display have
been added:
int SDL_SetGamma(float red, float green, float blue);
int SDL_SetGammaRamp(Uint8 *red, Uint8 *green, Uint8 *blue);
int SDL_GetGammaRamp(Uint8 *red, Uint8 *green, Uint8 *blue);
Gamma ramps are tables with 256 entries which map the screen color
components into actually displayed colors. For an example of
implementing gamma correction and gamma fades, see test/testgamma.c
Gamma control is not supported on all hardware.
1.1.4:
The size of the SDL_CDtrack structure changed from 8 to 12 bytes
as the size of the length member was extended to 32 bits.
You can now use SDL for 2D blitting with a GL mode by passing the
SDL_OPENGLBLIT flag to SDL_SetVideoMode(). You can specify 16 or
32 bpp, and the data in the framebuffer is put into the GL scene
when you call SDL_UpdateRects(), and the scene will be visible
when you call SDL_GL_SwapBuffers().
Run the "testgl" test program with the -logo command line option
to see an example of this blending of 2D and 3D in SDL.
1.1.3:
Added SDL_FreeRW() to the API, to complement SDL_AllocRW()
Added resizable window support - just add SDL_RESIZABLE to the
SDL_SetVideoMode() flags, and then wait for SDL_VIDEORESIZE events.
See SDL_events.h for details on the new SDL_ResizeEvent structure.
Added condition variable support, based on mutexes and semaphores.
SDL_CreateCond()
SDL_DestroyCond()
SDL_CondSignal()
SDL_CondBroadcast()
SDL_CondWait()
SDL_CondTimedWait()
The new function prototypes are in SDL_mutex.h
Added counting semaphore support, based on the mutex primitive.
SDL_CreateSemaphore()
SDL_DestroySemaphore()
SDL_SemWait()
SDL_SemTryWait()
SDL_SemWaitTimeout()
SDL_SemPost()
SDL_SemValue()
The new function prototypes are in SDL_mutex.h
Added support for asynchronous blitting. To take advantage of this,
you must set the SDL_ASYNCBLIT flag when setting the video mode and
creating surfaces that you want accelerated in this way. You must
lock surfaces that have this flag set, and the lock will block until
any queued blits have completed.
Added YUV video overlay support.
The supported YUV formats are: YV12, IYUV, YUY2, UYVY, and YVYU.
This function creates an overlay surface:
SDL_CreateYUVOverlay()
You must lock and unlock the overlay to get access to the data:
SDL_LockYUVOverlay() SDL_UnlockYUVOverlay()
You can then display the overlay:
SDL_DisplayYUVOverlay()
You must free the overlay when you are done using it:
SDL_FreeYUVOverlay()
See SDL_video.h for the full function prototypes.
The joystick hat position constants have been changed:
Old constant New constant
------------ ------------
0 SDL_HAT_CENTERED
1 SDL_HAT_UP
2 SDL_HAT_RIGHTUP
3 SDL_HAT_RIGHT
4 SDL_HAT_RIGHTDOWN
5 SDL_HAT_DOWN
6 SDL_HAT_LEFTDOWN
7 SDL_HAT_LEFT
8 SDL_HAT_LEFTUP
The new constants are bitmasks, so you can check for the
individual axes like this:
if ( hat_position & SDL_HAT_UP ) {
}
and you'll catch left-up, up, and right-up.
1.1.2:
Added multiple timer support:
SDL_AddTimer() and SDL_RemoveTimer()
SDL_WM_SetIcon() now respects the icon colorkey if mask is NULL.
1.1.0:
Added initial OpenGL support.
First set GL attributes (such as RGB depth, alpha depth, etc.)
SDL_GL_SetAttribute()
Then call SDL_SetVideoMode() with the SDL_OPENGL flag.
Perform all of your normal GL drawing.
Finally swap the buffers with the new SDL function:
SDL_GL_SwapBuffers()
See the new 'testgl' test program for an example of using GL with SDL.
You can load GL extension functions by using the function:
SDL_GL_LoadProcAddress()
Added functions to initialize and cleanup specific SDL subsystems:
SDL_InitSubSystem() and SDL_QuitSubSystem()
Added user-defined event type:
typedef struct {
Uint8 type;
int code;
void *data1;
void *data2;
} SDL_UserEvent;
This structure is in the "user" member of an SDL_Event.
Added a function to push events into the event queue:
SDL_PushEvent()
Example of using the new SDL user-defined events:
{
SDL_Event event;
event.type = SDL_USEREVENT;
event.user.code = my_event_code;
event.user.data1 = significant_data;
event.user.data2 = 0;
SDL_PushEvent(&event);
}
Added a function to get mouse deltas since last query:
SDL_GetRelativeMouseState()
Added a boolean datatype to SDL_types.h:
SDL_bool = { SDL_TRUE, SDL_FALSE }
Added a function to get the current audio status:
SDL_GetAudioState();
It returns one of:
SDL_AUDIO_STOPPED,
SDL_AUDIO_PLAYING,
SDL_AUDIO_PAUSED
Added an AAlib driver (ASCII Art) - by Stephane Peter.
1.0.6:
The input grab state is reset after each call to SDL_SetVideoMode().
The input is grabbed by default in fullscreen mode, and ungrabbed in
windowed mode. If you want to set input grab to a particular value,
you should set it after each call to SDL_SetVideoMode().
1.0.5:
Exposed SDL_AudioInit(), SDL_VideoInit()
Added SDL_AudioDriverName() and SDL_VideoDriverName()
Added new window manager function:
SDL_WM_ToggleFullScreen()
This is currently implemented only on Linux
The ALT-ENTER code has been removed - it's not appropriate for a
lib to bind keys when they aren't even emergency escape sequences.
ALT-ENTER functionality can be implemented with the following code:
int Handle_AltEnter(const SDL_Event *event)
{
if ( event->type == SDL_KEYDOWN ) {
if ( (event->key.keysym.sym == SDLK_RETURN) &&
(event->key.keysym.mod & KMOD_ALT) ) {
SDL_WM_ToggleFullScreen(SDL_GetVideoSurface());
return(0);
}
}
return(1);
}
SDL_SetEventFilter(Handle_AltEnter);
1.0.3:
Under X11, if you grab the input and hide the mouse cursor,
the mouse will go into a "relative motion" mode where you
will always get relative motion events no matter how far in
each direction you move the mouse - relative motion is not
bounded by the edges of the window (though the absolute values
of the mouse positions are clamped by the size of the window).
The SVGAlib, framebuffer console, and DirectInput drivers all
have this behavior naturally, and the GDI and BWindow drivers
never go into "relative motion" mode.
1.0.2:
Added a function to enable keyboard repeat:
SDL_EnableKeyRepeat()
Added a function to grab the mouse and keyboard input
SDL_WM_GrabInput()
Added a function to iconify the window.
SDL_WM_IconifyWindow()
If this function succeeds, the application will receive an event
signaling SDL_APPACTIVE event
1.0.1:
Added constants to SDL_audio.h for 16-bit native byte ordering:
AUDIO_U16SYS, AUDIO_S16SYS
1.0.0:
New public release
0.11.5:
A new function SDL_GetVideoSurface() has been added, and returns
a pointer to the current display surface.
SDL_AllocSurface() has been renamed SDL_CreateRGBSurface(), and
a new function SDL_CreateRGBSurfaceFrom() has been added to allow
creating an SDL surface from an existing pixel data buffer.
Added SDL_GetRGB() to the headers and documentation.
0.11.4:
SDL_SetLibraryPath() is no longer meaningful, and has been removed.
0.11.3:
A new flag for SDL_Init(), SDL_INIT_NOPARACHUTE, prevents SDL from
installing fatal signal handlers on operating systems that support
them.
0.9.15:
SDL_CreateColorCursor() has been removed. Color cursors should
be implemented as sprites, blitted by the application when the
cursor moves. To get smooth color cursor updates when the app
is busy, pass the SDL_INIT_EVENTTHREAD flag to SDL_Init(). This
allows you to handle the mouse motion in another thread from an
event filter function, but is currently only supported by Linux
and BeOS. Note that you'll have to protect the display surface
from multi-threaded access by using mutexes if you do this.
Thread-safe surface support has been removed from SDL.
This makes blitting somewhat faster, by removing SDL_MiddleBlit().
Code that used SDL_MiddleBlit() should use SDL_LowerBlit() instead.
You can make your surfaces thread-safe by allocating your own
mutex and making lock/unlock calls around accesses to your surface.
0.9.14:
SDL_GetMouseState() now takes pointers to int rather than Uint16.
If you set the SDL_WINDOWID environment variable under UNIX X11,
SDL will use that as the main window instead of creating it's own.
This is an unsupported extension to SDL, and not portable at all.
0.9.13:
Added a function SDL_SetLibraryPath() which can be used to specify
the directory containing the SDL dynamic libraries. This is useful
for commercial applications which ship with particular versions
of the libraries, and for security on multi-user systems.
If this function is not used, the default system directories are
searched using the native dynamic object loading mechanism.
In order to support C linkage under Visual C++, you must declare
main() without any return type:
main(int argc, char *argv[]) {
/* Do the program... */
return(0);
}
C++ programs should also return a value if compiled under VC++.
The blit_endian member of the SDL_VideoInfo struct has been removed.
SDL_SymToASCII() has been replaced with SDL_GetKeyName(), so there
is now no longer any function to translate a keysym to a character.
The SDL_keysym structure has been extended with a 'scancode' and
'unicode' member. The 'scancode' is a hardware specific scancode
for the key that was pressed, and may be 0. The 'unicode' member
is a 16-bit UNICODE translation of the key that was pressed along
with any modifiers or compose keys that have been pressed.
If no UNICODE translation exists for the key, 'unicode' will be 0.
Added a function SDL_EnableUNICODE() to enable/disable UNICODE
translation of character keypresses. Translation defaults off.
To convert existing code to use the new API, change code which
uses SDL_SymToASCII() to get the keyname to use SDL_GetKeyName(),
and change code which uses it to get the ASCII value of a sym to
use the 'unicode' member of the event keysym.
0.9.12:
There is partial support for 64-bit datatypes. I don't recommend
you use this if you have a choice, because 64-bit datatypes are not
supported on many platforms. On platforms for which it is supported,
the SDL_HAS_64BIT_TYPE C preprocessor define will be enabled, and
you can use the Uint64 and Sint64 datatypes.
Added functions to SDL_endian.h to support 64-bit datatypes:
SDL_SwapLE64(), SDL_SwapBE64(),
SDL_ReadLE64(), SDL_ReadBE64(), SDL_WriteLE64(), SDL_WriteBE64()
A new member "len_ratio" has been added to the SDL_AudioCVT structure,
and allows you to determine either the original buffer length or the
converted buffer length, given the other.
A new function SDL_FreeWAV() has been added to the API to free data
allocated by SDL_LoadWAV_RW(). This is necessary under Win32 since
the gcc compiled DLL uses a different heap than VC++ compiled apps.
SDL now has initial support for international keyboards using the
Latin character set.
If a particular mapping is desired, you can set the DEFAULT_KEYBOARD
compile-time variable, or you can set the environment variable
"SDL_KEYBOARD" to a string identifying the keyboard mapping you desire.
The valid values for these variables can be found in SDL_keyboard.c
Full support for German and French keyboards under X11 is implemented.
0.9.11:
The THREADED_EVENTS compile-time define has been replaced with the
SDL_INIT_EVENTTHREAD flag. If this flag is passed to SDL_Init(),
SDL will create a separate thread to perform input event handling.
If this flag is passed to SDL_Init(), and the OS doesn't support
event handling in a separate thread, SDL_Init() will fail.
Be sure to add calls to SDL_Delay() in your main thread to allow
the OS to schedule your event thread, or it may starve, leading
to slow event delivery and/or dropped events.
Currently MacOS and Win32 do not support this flag, while BeOS
and Linux do support it. I recommend that your application only
use this flag if absolutely necessary.
The SDL thread function passed to SDL_CreateThread() now returns a
status. This status can be retrieved by passing a non-NULL pointer
as the 'status' argument to SDL_WaitThread().
The volume parameter to SDL_MixAudio() has been increased in range
from (0-8) to (0-128)
SDL now has a data source abstraction which can encompass a file,
an area of memory, or any custom object you can envision. It uses
these abstractions, SDL_RWops, in the endian read/write functions,
and the built-in WAV and BMP file loaders. This means you can load
WAV chunks from memory mapped files, compressed archives, network
pipes, or anything else that has a data read abstraction.
There are three built-in data source abstractions:
SDL_RWFromFile(), SDL_RWFromFP(), SDL_RWFromMem()
along with a generic data source allocation function:
SDL_AllocRW()
These data sources can be used like stdio file pointers with the
following convenience functions:
SDL_RWseek(), SDL_RWread(), SDL_RWwrite(), SDL_RWclose()
These functions are defined in the new header file "SDL_rwops.h"
The endian swapping functions have been turned into macros for speed
and SDL_CalculateEndian() has been removed. SDL_endian.h now defines
SDL_BYTEORDER as either SDL_BIG_ENDIAN or SDL_LIL_ENDIAN depending on
the endianness of the host system.
The endian read/write functions now take an SDL_RWops pointer
instead of a stdio FILE pointer, to support the new data source
abstraction.
The SDL_*LoadWAV() functions have been replaced with a single
SDL_LoadWAV_RW() function that takes a SDL_RWops pointer as it's
first parameter, and a flag whether or not to automatically
free it as the second parameter. SDL_LoadWAV() is a macro for
backward compatibility and convenience:
SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...);
The SDL_*LoadBMP()/SDL_*SaveBMP() functions have each been replaced
with a single function that takes a SDL_RWops pointer as it's
first parameter, and a flag whether or not to automatically
free it as the second parameter. SDL_LoadBMP() and SDL_SaveBMP()
are macros for backward compatibility and convenience:
SDL_LoadBMP_RW(SDL_RWFromFile("sample.bmp", "rb"), 1, ...);
SDL_SaveBMP_RW(SDL_RWFromFile("sample.bmp", "wb"), 1, ...);
Note that these functions use SDL_RWseek() extensively, and should
not be used on pipes or other non-seekable data sources.
0.9.10:
The Linux SDL_SysWMInfo and SDL_SysWMMsg structures have been
extended to support multiple types of display drivers, as well as
safe access to the X11 display when THREADED_EVENTS is enabled.
The new structures are documented in the SDL_syswm.h header file.
Thanks to John Elliott <jce@seasip.demon.co.uk>, the UK keyboard
should now work properly, as well as the "Windows" keys on US
keyboards.
The Linux CD-ROM code now reads the CD-ROM devices from /etc/fstab
instead of trying to open each block device on the system.
The CD must be listed in /etc/fstab as using the iso9660 filesystem.
On Linux, if you define THREADED_EVENTS at compile time, a separate
thread will be spawned to gather X events asynchronously from the
graphics updates. This hasn't been extensively tested, but it does
provide a means of handling keyboard and mouse input in a separate
thread from the graphics thread. (This is now enabled by default.)
A special access function SDL_PeepEvents() allows you to manipulate
the event queue in a thread-safe manner, including peeking at events,
removing events of a specified type, and adding new events of arbitrary
type to the queue (use the new 'user' member of the SDL_Event type).
If you use SDL_PeepEvents() to gather events, then the main graphics
thread needs to call SDL_PumpEvents() periodically to drive the event
loop and generate input events. This is not necessary if SDL has been
compiled with THREADED_EVENTS defined, but doesn't hurt.
A new function SDL_ThreadID() returns the identifier associated with
the current thread.
0.9.9:
The AUDIO_STEREO format flag has been replaced with a new 'channels'
member of the SDL_AudioSpec structure. The channels are 1 for mono
audio, and 2 for stereo audio. In the future more channels may be
supported for 3D surround sound.
The SDL_MixAudio() function now takes an additional volume parameter,
which should be set to SDL_MIX_MAXVOLUME for compatibility with the
original function.
The CD-ROM functions which take a 'cdrom' parameter can now be
passed NULL, and will act on the last successfully opened CD-ROM.
0.9.8:
No changes, bugfixes only.
0.9.7:
No changes, bugfixes only.
0.9.6:
Added a fast rectangle fill function: SDL_FillRect()
Addition of a useful function for getting info on the video hardware:
const SDL_VideoInfo *SDL_GetVideoInfo(void)
This function replaces SDL_GetDisplayFormat().
Initial support for double-buffering:
Use the SDL_DOUBLEBUF flag in SDL_SetVideoMode()
Update the screen with a new function: SDL_Flip()
SDL_AllocSurface() takes two new flags:
SDL_SRCCOLORKEY means that the surface will be used for colorkey blits
and if the hardware supports hardware acceleration of colorkey blits
between two surfaces in video memory, to place the surface in video
memory if possible, otherwise it will be placed in system memory.
SDL_SRCALPHA means that the surface will be used for alpha blits and
if the hardware supports hardware acceleration of alpha blits between
two surfaces in video memory, to place the surface in video memory
if possible, otherwise it will be placed in system memory.
SDL_HWSURFACE now means that the surface will be created with the
same format as the display surface, since having surfaces in video
memory is only useful for fast blitting to the screen, and you can't
blit surfaces with different surface formats in video memory.
0.9.5:
You can now pass a NULL mask to SDL_WM_SetIcon(), and it will assume
that the icon consists of the entire image.
SDL_LowerBlit() is back -- but don't use it on the display surface.
It is exactly the same as SDL_MiddleBlit(), but doesn't check for
thread safety.
Added SDL_FPLoadBMP(), SDL_FPSaveBMP(), SDL_FPLoadWAV(), which take
a FILE pointer instead of a file name.
Added CD-ROM audio control API:
SDL_CDNumDrives()
SDL_CDName()
SDL_CDOpen()
SDL_CDStatus()
SDL_CDPlayTracks()
SDL_CDPlay()
SDL_CDPause()
SDL_CDResume()
SDL_CDStop()
SDL_CDEject()
SDL_CDClose()
0.9.4:
No changes, bugfixes only.
0.9.3:
Mouse motion event now includes relative motion information:
Sint16 event->motion.xrel, Sint16 event->motion.yrel
X11 keyrepeat handling can be disabled by defining IGNORE_X_KEYREPEAT
(Add -DIGNORE_X_KEYREPEAT to CFLAGS line in obj/x11Makefile)
0.9.2:
No changes, bugfixes only.
0.9.1:
Removed SDL_MapSurface() and SDL_UnmapSurface() -- surfaces are now
automatically mapped on blit.
0.8.0:
SDL stable release

View File

@@ -1 +0,0 @@
.

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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
@@ -90,7 +90,6 @@
#include "SDL_timer.h"
#include "SDL_version.h"
#include "SDL_video.h"
#include "SDL_compat.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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
@@ -61,7 +61,7 @@ extern "C" {
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
\endverbatim
*
* There are macros in SDL 1.3 and later to query these bits.
* There are macros in SDL 2.0 and later to query these bits.
*/
typedef Uint16 SDL_AudioFormat;

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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
@@ -55,7 +55,7 @@ extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text);
extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void);
/**
* \brief Returns a flag indicating whether the clipboard exists and contains a text string that it non-empty
* \brief Returns a flag indicating whether the clipboard exists and contains a text string that is non-empty
*
* \sa SDL_GetClipboardText()
*/

View File

@@ -1,365 +0,0 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \defgroup Compatibility SDL 1.2 Compatibility API
*/
/*@{*/
/**
* \file SDL_compat.h
*
* This file contains functions for backwards compatibility with SDL 1.2.
*/
/**
* \def SDL_NO_COMPAT
*
* #define SDL_NO_COMPAT to prevent SDL_compat.h from being included.
* SDL_NO_COMPAT is intended to make it easier to covert SDL 1.2 code to
* SDL 1.3/2.0.
*/
/*@}*/
#ifdef SDL_NO_COMPAT
#define _SDL_compat_h
#endif
#ifndef _SDL_compat_h
#define _SDL_compat_h
#include "SDL_video.h"
#include "SDL_version.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern "C" {
/* *INDENT-ON* */
#endif
/**
* \addtogroup Compatibility
*/
/*@{*/
/* Platform */
#ifdef __WIN32__
#undef __WIN32__
#define __WIN32__ 1
#endif
/**
* \name Surface flags
*/
/*@{*/
#define SDL_SWSURFACE 0x00000000 /**< \note Not used */
#define SDL_SRCALPHA 0x00010000
#define SDL_SRCCOLORKEY 0x00020000
#define SDL_ANYFORMAT 0x00100000
#define SDL_HWPALETTE 0x00200000
#define SDL_DOUBLEBUF 0x00400000
#define SDL_FULLSCREEN 0x00800000
#define SDL_RESIZABLE 0x01000000
#define SDL_NOFRAME 0x02000000
#define SDL_OPENGL 0x04000000
#define SDL_HWSURFACE 0x08000001 /**< \note Not used */
#define SDL_ASYNCBLIT 0x08000000 /**< \note Not used */
#define SDL_RLEACCELOK 0x08000000 /**< \note Not used */
#define SDL_HWACCEL 0x08000000 /**< \note Not used */
/*@}*//*Surface flags*/
#define SDL_APPMOUSEFOCUS 0x01
#define SDL_APPINPUTFOCUS 0x02
#define SDL_APPACTIVE 0x04
#define SDL_LOGPAL 0x01
#define SDL_PHYSPAL 0x02
#define SDL_ACTIVEEVENT SDL_EVENT_COMPAT1
#define SDL_VIDEORESIZE SDL_EVENT_COMPAT2
#define SDL_VIDEOEXPOSE SDL_EVENT_COMPAT3
#define SDL_ACTIVEEVENTMASK SDL_ACTIVEEVENT, SDL_ACTIVEEVENT
#define SDL_VIDEORESIZEMASK SDL_VIDEORESIZE, SDL_VIDEORESIZE
#define SDL_VIDEOEXPOSEMASK SDL_VIDEOEXPOSE, SDL_VIDEOEXPOSE
#define SDL_WINDOWEVENTMASK SDL_WINDOWEVENT, SDL_WINDOWEVENT
#define SDL_KEYDOWNMASK SDL_KEYDOWN, SDL_KEYDOWN
#define SDL_KEYUPMASK SDL_KEYUP, SDL_KEYUP
#define SDL_KEYEVENTMASK SDL_KEYDOWN, SDL_KEYUP
#define SDL_TEXTEDITINGMASK SDL_TEXTEDITING, SDL_TEXTEDITING
#define SDL_TEXTINPUTMASK SDL_TEXTINPUT, SDL_TEXTINPUT
#define SDL_MOUSEMOTIONMASK SDL_MOUSEMOTION, SDL_MOUSEMOTION
#define SDL_MOUSEBUTTONDOWNMASK SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONDOWN
#define SDL_MOUSEBUTTONUPMASK SDL_MOUSEBUTTONUP, SDL_MOUSEBUTTONUP
#define SDL_MOUSEWHEELMASK SDL_MOUSEWHEEL, SDL_MOUSEWHEEL
#define SDL_MOUSEEVENTMASK SDL_MOUSEMOTION, SDL_MOUSEBUTTONUP
#define SDL_JOYAXISMOTIONMASK SDL_JOYAXISMOTION, SDL_JOYAXISMOTION
#define SDL_JOYBALLMOTIONMASK SDL_JOYBALLMOTION, SDL_JOYBALLMOTION
#define SDL_JOYHATMOTIONMASK SDL_JOYHATMOTION, SDL_JOYHATMOTION
#define SDL_JOYBUTTONDOWNMASK SDL_JOYBUTTONDOWN, SDL_JOYBUTTONDOWN
#define SDL_JOYBUTTONUPMASK SDL_JOYBUTTONUP, SDL_JOYBUTTONUP
#define SDL_JOYEVENTMASK SDL_JOYAXISMOTION, SDL_JOYBUTTONUP
#define SDL_QUITMASK SDL_QUIT, SDL_QUIT
#define SDL_SYSWMEVENTMASK SDL_SYSWMEVENT, SDL_SYSWMEVENT
#define SDL_PROXIMITYINMASK SDL_PROXIMITYIN, SDL_PROXIMITYIN
#define SDL_PROXIMITYOUTMASK SDL_PROXIMITYOUT, SDL_PROXIMITYOUT
#define SDL_ALLEVENTS SDL_FIRSTEVENT, SDL_LASTEVENT
#define SDL_BUTTON_WHEELUP 4
#define SDL_BUTTON_WHEELDOWN 5
#define SDL_DEFAULT_REPEAT_DELAY 500
#define SDL_DEFAULT_REPEAT_INTERVAL 30
typedef struct SDL_VideoInfo
{
Uint32 hw_available:1;
Uint32 wm_available:1;
Uint32 UnusedBits1:6;
Uint32 UnusedBits2:1;
Uint32 blit_hw:1;
Uint32 blit_hw_CC:1;
Uint32 blit_hw_A:1;
Uint32 blit_sw:1;
Uint32 blit_sw_CC:1;
Uint32 blit_sw_A:1;
Uint32 blit_fill:1;
Uint32 UnusedBits3:16;
Uint32 video_mem;
SDL_PixelFormat *vfmt;
int current_w;
int current_h;
} SDL_VideoInfo;
/**
* \name Overlay formats
*
* The most common video overlay formats.
*
* For an explanation of these pixel formats, see:
* http://www.webartz.com/fourcc/indexyuv.htm
*
* For information on the relationship between color spaces, see:
* http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html
*/
/*@{*/
#define SDL_YV12_OVERLAY 0x32315659 /**< Planar mode: Y + V + U (3 planes) */
#define SDL_IYUV_OVERLAY 0x56555949 /**< Planar mode: Y + U + V (3 planes) */
#define SDL_YUY2_OVERLAY 0x32595559 /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */
#define SDL_UYVY_OVERLAY 0x59565955 /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */
#define SDL_YVYU_OVERLAY 0x55595659 /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */
/*@}*//*Overlay formats*/
/**
* The YUV hardware video overlay.
*/
typedef struct SDL_Overlay
{
Uint32 format; /**< Read-only */
int w, h; /**< Read-only */
int planes; /**< Read-only */
Uint16 *pitches; /**< Read-only */
Uint8 **pixels; /**< Read-write */
/**
* \name Hardware-specific surface info
*/
/*@{*/
struct private_yuvhwfuncs *hwfuncs;
struct private_yuvhwdata *hwdata;
/*@}*//*Hardware-specific surface info*/
/**
* \name Special flags
*/
/*@{*/
Uint32 hw_overlay:1; /**< Flag: This overlay hardware accelerated? */
Uint32 UnusedBits:31;
/*@}*//*Special flags*/
} SDL_Overlay;
typedef enum
{
SDL_GRAB_QUERY = -1,
SDL_GRAB_OFF = 0,
SDL_GRAB_ON = 1
} SDL_GrabMode;
struct SDL_SysWMinfo;
/**
* \name Obsolete or renamed key codes
*/
/*@{*/
#define SDL_keysym SDL_Keysym
#define SDL_KeySym SDL_Keysym
#define SDL_scancode SDL_Scancode
#define SDL_ScanCode SDL_Scancode
#define SDLKey SDL_Keycode
#define SDLMod SDL_Keymod
/**
* \name Renamed keys
*
* These key constants were renamed for clarity or consistency.
*/
/*@{*/
#define SDLK_KP0 SDLK_KP_0
#define SDLK_KP1 SDLK_KP_1
#define SDLK_KP2 SDLK_KP_2
#define SDLK_KP3 SDLK_KP_3
#define SDLK_KP4 SDLK_KP_4
#define SDLK_KP5 SDLK_KP_5
#define SDLK_KP6 SDLK_KP_6
#define SDLK_KP7 SDLK_KP_7
#define SDLK_KP8 SDLK_KP_8
#define SDLK_KP9 SDLK_KP_9
#define SDLK_NUMLOCK SDLK_NUMLOCKCLEAR
#define SDLK_SCROLLOCK SDLK_SCROLLLOCK
#define SDLK_PRINT SDLK_PRINTSCREEN
#define SDLK_LMETA SDLK_LGUI
#define SDLK_RMETA SDLK_RGUI
/*@}*//*Renamed keys*/
/**
* \name META modifier
*
* The META modifier is equivalent to the GUI modifier from the USB standard.
*/
/*@{*/
#define KMOD_LMETA KMOD_LGUI
#define KMOD_RMETA KMOD_RGUI
#define KMOD_META KMOD_GUI
/*@}*//*META modifier*/
/**
* \name Not in USB
*
* These keys don't appear in the USB specification (or at least not under
* those names). I'm unsure if the following assignments make sense or if these
* codes should be defined as actual additional SDLK_ constants.
*/
/*@{*/
#define SDLK_LSUPER SDLK_LMETA
#define SDLK_RSUPER SDLK_RMETA
#define SDLK_COMPOSE SDLK_APPLICATION
#define SDLK_BREAK SDLK_STOP
#define SDLK_EURO SDLK_2
/*@}*//*Not in USB*/
/*@}*//*Obsolete or renamed key codes*/
#define SDL_SetModuleHandle(x)
#define SDL_AllocSurface SDL_CreateRGBSurface
extern DECLSPEC const SDL_version *SDLCALL SDL_Linked_Version(void);
extern DECLSPEC const char *SDLCALL SDL_AudioDriverName(char *namebuf, int maxlen);
extern DECLSPEC const char *SDLCALL SDL_VideoDriverName(char *namebuf, int maxlen);
extern DECLSPEC const SDL_VideoInfo *SDLCALL SDL_GetVideoInfo(void);
extern DECLSPEC int SDLCALL SDL_VideoModeOK(int width,
int height,
int bpp, Uint32 flags);
extern DECLSPEC SDL_Rect **SDLCALL SDL_ListModes(const SDL_PixelFormat *
format, Uint32 flags);
extern DECLSPEC SDL_Surface *SDLCALL SDL_SetVideoMode(int width, int height,
int bpp, Uint32 flags);
extern DECLSPEC SDL_Surface *SDLCALL SDL_GetVideoSurface(void);
extern DECLSPEC void SDLCALL SDL_UpdateRects(SDL_Surface * screen,
int numrects, SDL_Rect * rects);
extern DECLSPEC void SDLCALL SDL_UpdateRect(SDL_Surface * screen,
Sint32 x,
Sint32 y, Uint32 w, Uint32 h);
extern DECLSPEC int SDLCALL SDL_Flip(SDL_Surface * screen);
extern DECLSPEC int SDLCALL SDL_SetAlpha(SDL_Surface * surface,
Uint32 flag, Uint8 alpha);
extern DECLSPEC SDL_Surface *SDLCALL SDL_DisplayFormat(SDL_Surface * surface);
extern DECLSPEC SDL_Surface *SDLCALL SDL_DisplayFormatAlpha(SDL_Surface *
surface);
extern DECLSPEC void SDLCALL SDL_WM_SetCaption(const char *title,
const char *icon);
extern DECLSPEC void SDLCALL SDL_WM_GetCaption(const char **title,
const char **icon);
extern DECLSPEC void SDLCALL SDL_WM_SetIcon(SDL_Surface * icon, Uint8 * mask);
extern DECLSPEC int SDLCALL SDL_WM_IconifyWindow(void);
extern DECLSPEC int SDLCALL SDL_WM_ToggleFullScreen(SDL_Surface * surface);
extern DECLSPEC SDL_GrabMode SDLCALL SDL_WM_GrabInput(SDL_GrabMode mode);
extern DECLSPEC int SDLCALL SDL_SetPalette(SDL_Surface * surface,
int flags,
const SDL_Color * colors,
int firstcolor, int ncolors);
extern DECLSPEC int SDLCALL SDL_SetColors(SDL_Surface * surface,
const SDL_Color * colors,
int firstcolor, int ncolors);
extern DECLSPEC int SDLCALL SDL_GetWMInfo(struct SDL_SysWMinfo *info);
extern DECLSPEC Uint8 SDLCALL SDL_GetAppState(void);
extern DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y);
extern DECLSPEC SDL_Overlay *SDLCALL SDL_CreateYUVOverlay(int width,
int height,
Uint32 format,
SDL_Surface *
display);
extern DECLSPEC int SDLCALL SDL_LockYUVOverlay(SDL_Overlay * overlay);
extern DECLSPEC void SDLCALL SDL_UnlockYUVOverlay(SDL_Overlay * overlay);
extern DECLSPEC int SDLCALL SDL_DisplayYUVOverlay(SDL_Overlay * overlay,
SDL_Rect * dstrect);
extern DECLSPEC void SDLCALL SDL_FreeYUVOverlay(SDL_Overlay * overlay);
extern DECLSPEC void SDLCALL SDL_GL_SwapBuffers(void);
extern DECLSPEC int SDLCALL SDL_SetGamma(float red, float green, float blue);
extern DECLSPEC int SDLCALL SDL_SetGammaRamp(const Uint16 * red,
const Uint16 * green,
const Uint16 * blue);
extern DECLSPEC int SDLCALL SDL_GetGammaRamp(Uint16 * red, Uint16 * green,
Uint16 * blue);
extern DECLSPEC int SDLCALL SDL_EnableKeyRepeat(int delay, int interval);
extern DECLSPEC void SDLCALL SDL_GetKeyRepeat(int *delay, int *interval);
extern DECLSPEC int SDLCALL SDL_EnableUNICODE(int enable);
typedef SDL_Window* SDL_WindowID;
#define SDL_KillThread(X)
/* The timeslice and timer resolution are no longer relevant */
#define SDL_TIMESLICE 10
#define TIMER_RESOLUTION 10
typedef Uint32 (SDLCALL * SDL_OldTimerCallback) (Uint32 interval);
extern DECLSPEC int SDLCALL SDL_SetTimer(Uint32 interval, SDL_OldTimerCallback callback);
extern DECLSPEC int SDLCALL SDL_putenv(const char *variable);
/*@}*//*Compatibility*/
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif /* _SDL_compat_h */
/* vi: set ts=4 sw=4 expandtab: */

View File

@@ -1,23 +1,22 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
Simple DirectMedia Layer
Copyright (C) 1997-2011 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
@@ -26,24 +25,27 @@
#include "SDL_platform.h"
/**
* \file SDL_config.h.default
*
* SDL_config.h for any platform that doesn't build using the configure system.
* \file SDL_config.h
*/
/* Add any platform that doesn't build using the configure system. */
#if defined(__NINTENDODS__)
#include "SDL_config_nintendods.h"
#elif defined(__IPHONEOS__)
#include "SDL_config_iphoneos.h"
#if defined(__WIN32__)
#include "SDL_config_windows.h"
#elif defined(__MACOSX__)
#include "SDL_config_macosx.h"
#elif defined(__WIN32__)
#include "SDL_config_win32.h"
#elif defined(ANDROID)
#elif defined(__IPHONEOS__)
#include "SDL_config_iphoneos.h"
#elif defined(__ANDROID__)
#include "SDL_config_android.h"
#elif defined(__NINTENDODS__)
#include "SDL_config_nintendods.h"
#else
/* This is a minimal configuration just to get SDL running on new platforms */
#include "SDL_config_minimal.h"
#endif /* platform config */
#ifdef USING_GENERATED_CONFIG_H
#error Wrong SDL_config.h, check your include path?
#endif
#endif /* _SDL_config_h */

View File

@@ -1,49 +0,0 @@
/*
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_h
#define _SDL_config_h
#include "SDL_platform.h"
/**
* \file SDL_config.h.default
*
* SDL_config.h for any platform that doesn't build using the configure system.
*/
/* Add any platform that doesn't build using the configure system. */
#if defined(__NINTENDODS__)
#include "SDL_config_nintendods.h"
#elif defined(__ANDROID__)
#include "SDL_config_android.h"
#elif defined(__IPHONEOS__)
#include "SDL_config_iphoneos.h"
#elif defined(__MACOSX__)
#include "SDL_config_macosx.h"
#elif defined(__WIN32__)
#include "SDL_config_win32.h"
#else
#include "SDL_config_minimal.h"
#endif /* platform config */
#endif /* _SDL_config_h */

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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
@@ -151,6 +151,7 @@
#undef HAVE_ICONV
#undef HAVE_PTHREAD_SETNAME_NP
#undef HAVE_PTHREAD_SET_NAME_NP
#undef HAVE_SEM_TIMEDWAIT
#else
/* We may need some replacement for stdarg.h here */
@@ -271,6 +272,7 @@
#undef SDL_VIDEO_RENDER_D3D
#undef SDL_VIDEO_RENDER_OGL
#undef SDL_VIDEO_RENDER_OGL_ES
#undef SDL_VIDEO_RENDER_OGL_ES2
#undef SDL_VIDEO_RENDER_DIRECTFB
/* Enable OpenGL support */

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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
@@ -33,7 +33,7 @@
#include <stddef.h>
#include <stdarg.h>
#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
#if !defined(_STDINT_H_) && !defined(_STDINT_H) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
typedef unsigned int size_t;
typedef signed char int8_t;
typedef unsigned char uint8_t;
@@ -44,7 +44,7 @@ typedef unsigned int uint32_t;
typedef signed long long int64_t;
typedef unsigned long long uint64_t;
typedef unsigned long uintptr_t;
#endif /* !_STDINT_H_ && !HAVE_STDINT_H */
#endif /* if (stdint.h isn't available) */
#ifdef __GNUC__
#define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,199 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 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_win32_h
#define _SDL_config_win32_h
#include "SDL_platform.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
#define SDL_HAS_64BIT_TYPE 1
/* Enabled for SDL 1.2 (binary compatibility) */
//#define HAVE_LIBC 1
#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
#ifndef _WIN32_WCE
#define HAVE_SIGNAL_H 1
#endif
/* 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_ITOA 1
#define HAVE__LTOA 1
#define HAVE__ULTOA 1
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
#define HAVE_STRTOLL 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_SSCANF 1
#define HAVE_M_PI 1
#define HAVE_ATAN 1
#define HAVE_ATAN2 1
#define HAVE_CEIL 1
#define HAVE_COPYSIGN 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_SCALBN 1
#define HAVE_SIN 1
#define HAVE_SINF 1
#define HAVE_SQRT 1
#else
#define HAVE_STDARG_H 1
#define HAVE_STDDEF_H 1
#endif
/* Enable various audio drivers */
#ifndef _WIN32_WCE
#define SDL_AUDIO_DRIVER_DSOUND 1
#endif
#define SDL_AUDIO_DRIVER_WINWAVEOUT 1
#define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable various input drivers */
#ifdef _WIN32_WCE
#define SDL_JOYSTICK_DISABLED 1
#define SDL_HAPTIC_DUMMY 1
#else
#define SDL_JOYSTICK_DINPUT 1
#define SDL_HAPTIC_DINPUT 1
#endif
/* Enable various shared object loading systems */
#define SDL_LOADSO_WIN32 1
/* Enable various threading systems */
#define SDL_THREAD_WIN32 1
/* Enable various timer systems */
#ifdef _WIN32_WCE
#define SDL_TIMER_WINCE 1
#else
#define SDL_TIMER_WIN32 1
#endif
/* Enable various video drivers */
#define SDL_VIDEO_DRIVER_DUMMY 1
#define SDL_VIDEO_DRIVER_WIN32 1
#define SDL_VIDEO_RENDER_D3D 1
#define SDL_VIDEO_RENDER_GDI 1
/* Enable OpenGL support */
#ifndef _WIN32_WCE
#define SDL_VIDEO_OPENGL 1
#define SDL_VIDEO_OPENGL_WGL 1
#define SDL_VIDEO_RENDER_OGL 1
#endif
/* Enable system power support */
#define SDL_POWER_WINDOWS 1
/* Enable assembly routines (Win64 doesn't have inline asm) */
#ifndef _WIN64
#define SDL_ASSEMBLY_ROUTINES 1
#endif
#endif /* _SDL_config_win32_h */

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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
@@ -91,10 +91,10 @@ SDL_Swap16(Uint16 x)
static __inline__ Uint16
SDL_Swap16(Uint16 x)
{
Uint16 result;
int result;
__asm__("rlwimi %0,%2,8,16,23": "=&r"(result):"0"(x >> 8), "r"(x));
return result;
return (Uint16)result;
}
#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__)
static __inline__ Uint16

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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
@@ -109,12 +109,6 @@ typedef enum
/* Drag and drop events */
SDL_DROPFILE = 0x1000, /**< The system requests a file open */
/* Obsolete events */
SDL_EVENT_COMPAT1 = 0x7000, /**< SDL 1.2 events for compatibility */
SDL_EVENT_COMPAT2,
SDL_EVENT_COMPAT3,
/** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use,
* and should be allocated with SDL_RegisterEvents()
*/
@@ -132,6 +126,7 @@ typedef enum
typedef struct SDL_WindowEvent
{
Uint32 type; /**< ::SDL_WINDOWEVENT */
Uint32 timestamp;
Uint32 windowID; /**< The associated window */
Uint8 event; /**< ::SDL_WindowEventID */
Uint8 padding1;
@@ -147,6 +142,7 @@ typedef struct SDL_WindowEvent
typedef struct SDL_KeyboardEvent
{
Uint32 type; /**< ::SDL_KEYDOWN or ::SDL_KEYUP */
Uint32 timestamp;
Uint32 windowID; /**< The window with keyboard focus, if any */
Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
Uint8 repeat; /**< Non-zero if this is a key repeat */
@@ -162,6 +158,7 @@ typedef struct SDL_KeyboardEvent
typedef struct SDL_TextEditingEvent
{
Uint32 type; /**< ::SDL_TEXTEDITING */
Uint32 timestamp;
Uint32 windowID; /**< The window with keyboard focus, if any */
char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE]; /**< The editing text */
int start; /**< The start cursor of selected editing text */
@@ -176,6 +173,7 @@ typedef struct SDL_TextEditingEvent
typedef struct SDL_TextInputEvent
{
Uint32 type; /**< ::SDL_TEXTINPUT */
Uint32 timestamp;
Uint32 windowID; /**< The window with keyboard focus, if any */
char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; /**< The input text */
} SDL_TextInputEvent;
@@ -186,6 +184,7 @@ typedef struct SDL_TextInputEvent
typedef struct SDL_MouseMotionEvent
{
Uint32 type; /**< ::SDL_MOUSEMOTION */
Uint32 timestamp;
Uint32 windowID; /**< The window with mouse focus, if any */
Uint8 state; /**< The current button state */
Uint8 padding1;
@@ -203,6 +202,7 @@ typedef struct SDL_MouseMotionEvent
typedef struct SDL_MouseButtonEvent
{
Uint32 type; /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */
Uint32 timestamp;
Uint32 windowID; /**< The window with mouse focus, if any */
Uint8 button; /**< The mouse button index */
Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
@@ -218,6 +218,7 @@ typedef struct SDL_MouseButtonEvent
typedef struct SDL_MouseWheelEvent
{
Uint32 type; /**< ::SDL_MOUSEWHEEL */
Uint32 timestamp;
Uint32 windowID; /**< The window with mouse focus, if any */
int x; /**< The amount scrolled horizontally */
int y; /**< The amount scrolled vertically */
@@ -229,6 +230,7 @@ typedef struct SDL_MouseWheelEvent
typedef struct SDL_JoyAxisEvent
{
Uint32 type; /**< ::SDL_JOYAXISMOTION */
Uint32 timestamp;
Uint8 which; /**< The joystick device index */
Uint8 axis; /**< The joystick axis index */
Uint8 padding1;
@@ -242,6 +244,7 @@ typedef struct SDL_JoyAxisEvent
typedef struct SDL_JoyBallEvent
{
Uint32 type; /**< ::SDL_JOYBALLMOTION */
Uint32 timestamp;
Uint8 which; /**< The joystick device index */
Uint8 ball; /**< The joystick trackball index */
Uint8 padding1;
@@ -256,6 +259,7 @@ typedef struct SDL_JoyBallEvent
typedef struct SDL_JoyHatEvent
{
Uint32 type; /**< ::SDL_JOYHATMOTION */
Uint32 timestamp;
Uint8 which; /**< The joystick device index */
Uint8 hat; /**< The joystick hat index */
Uint8 value; /**< The hat position value.
@@ -274,6 +278,7 @@ typedef struct SDL_JoyHatEvent
typedef struct SDL_JoyButtonEvent
{
Uint32 type; /**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */
Uint32 timestamp;
Uint8 which; /**< The joystick device index */
Uint8 button; /**< The joystick button index */
Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
@@ -288,6 +293,7 @@ typedef struct SDL_TouchFingerEvent
{
Uint32 type; /**< ::SDL_FINGERMOTION OR
SDL_FINGERDOWN OR SDL_FINGERUP*/
Uint32 timestamp;
Uint32 windowID; /**< The window with mouse focus, if any */
SDL_TouchID touchId; /**< The touch device id */
SDL_FingerID fingerId;
@@ -309,6 +315,7 @@ typedef struct SDL_TouchFingerEvent
typedef struct SDL_TouchButtonEvent
{
Uint32 type; /**< ::SDL_TOUCHBUTTONUP OR SDL_TOUCHBUTTONDOWN */
Uint32 timestamp;
Uint32 windowID; /**< The window with mouse focus, if any */
SDL_TouchID touchId; /**< The touch device index */
Uint8 state; /**< The current button state */
@@ -324,6 +331,7 @@ typedef struct SDL_TouchButtonEvent
typedef struct SDL_MultiGestureEvent
{
Uint32 type; /**< ::SDL_MULTIGESTURE */
Uint32 timestamp;
Uint32 windowID; /**< The window with mouse focus, if any */
SDL_TouchID touchId; /**< The touch device index */
float dTheta;
@@ -338,6 +346,7 @@ typedef struct SDL_MultiGestureEvent
typedef struct SDL_DollarGestureEvent
{
Uint32 type; /**< ::SDL_DOLLARGESTURE */
Uint32 timestamp;
Uint32 windowID; /**< The window with mouse focus, if any */
SDL_TouchID touchId; /**< The touch device index */
SDL_GestureID gestureId;
@@ -359,6 +368,7 @@ typedef struct SDL_DollarGestureEvent
typedef struct SDL_DropEvent
{
Uint32 type; /**< ::SDL_DROPFILE */
Uint32 timestamp;
char *file; /**< The file name, which should be freed with SDL_free() */
} SDL_DropEvent;
@@ -369,6 +379,7 @@ typedef struct SDL_DropEvent
typedef struct SDL_QuitEvent
{
Uint32 type; /**< ::SDL_QUIT */
Uint32 timestamp;
} SDL_QuitEvent;
@@ -378,6 +389,7 @@ typedef struct SDL_QuitEvent
typedef struct SDL_UserEvent
{
Uint32 type; /**< ::SDL_USEREVENT through ::SDL_NUMEVENTS-1 */
Uint32 timestamp;
Uint32 windowID; /**< The associated window if any */
int code; /**< User defined event code */
void *data1; /**< User defined data pointer */
@@ -397,37 +409,10 @@ typedef struct SDL_SysWMmsg SDL_SysWMmsg;
typedef struct SDL_SysWMEvent
{
Uint32 type; /**< ::SDL_SYSWMEVENT */
Uint32 timestamp;
SDL_SysWMmsg *msg; /**< driver dependent data, defined in SDL_syswm.h */
} SDL_SysWMEvent;
#ifndef SDL_NO_COMPAT
/**
* \addtogroup Compatibility
*/
/*@{*/
/**
* \name Typedefs for backwards compatibility
*/
/*@{*/
typedef struct SDL_ActiveEvent
{
Uint32 type;
Uint8 gain;
Uint8 state;
} SDL_ActiveEvent;
typedef struct SDL_ResizeEvent
{
Uint32 type;
int w;
int h;
} SDL_ResizeEvent;
/*@}*/
/*@}*//*Compatibility*/
#endif
/**
* \brief General event structure
*/
@@ -453,14 +438,6 @@ typedef union SDL_Event
SDL_MultiGestureEvent mgesture; /**< Multi Finger Gesture data */
SDL_DollarGestureEvent dgesture; /**< Multi Finger Gesture data */
SDL_DropEvent drop; /**< Drag and drop event data */
/** Temporarily here for backwards compatibility */
/*@{*/
#ifndef SDL_NO_COMPAT
SDL_ActiveEvent active;
SDL_ResizeEvent resize;
#endif
/*@}*/
} SDL_Event;

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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
@@ -65,8 +65,10 @@ typedef enum
SDL_RENDERER_SOFTWARE = 0x00000001, /**< The renderer is a software fallback */
SDL_RENDERER_ACCELERATED = 0x00000002, /**< The renderer uses hardware
acceleration */
SDL_RENDERER_PRESENTVSYNC = 0x00000004 /**< Present is synchronized
SDL_RENDERER_PRESENTVSYNC = 0x00000004, /**< Present is synchronized
with the refresh rate */
SDL_RENDERER_TARGETTEXTURE = 0x00000008 /**< The renderer supports
rendering to texture */
} SDL_RendererFlags;
/**
@@ -88,7 +90,8 @@ typedef struct SDL_RendererInfo
typedef enum
{
SDL_TEXTUREACCESS_STATIC, /**< Changes rarely, not lockable */
SDL_TEXTUREACCESS_STREAMING /**< Changes frequently, lockable */
SDL_TEXTUREACCESS_STREAMING, /**< Changes frequently, lockable */
SDL_TEXTUREACCESS_TARGET /**< Texture can be used as a render target */
} SDL_TextureAccess;
/**
@@ -144,6 +147,22 @@ extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void);
extern DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index,
SDL_RendererInfo * info);
/**
* \brief Create a window and default renderer
*
* \param width The width of the window
* \param height The height of the window
* \param window_flags The flags used to create the window
* \param window A pointer filled with the window, or NULL on error
* \param renderer A pointer filled with the renderer, or NULL on error
*
* \return 0 on success, or -1 on error
*/
extern DECLSPEC int SDLCALL SDL_CreateWindowAndRenderer(
int width, int height, Uint32 window_flags,
SDL_Window **window, SDL_Renderer **renderer);
/**
* \brief Create a 2D rendering context for a window.
*
@@ -369,6 +388,25 @@ extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture * texture,
*/
extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture * texture);
/**
* \brief Determines whether a window supports the use of render targets
*
* \param renderer The renderer that will be checked
*
* \return SDL_TRUE if supported, SDL_FALSE if not.
*/
extern DECLSPEC SDL_bool SDLCALL SDL_RenderTargetSupported(SDL_Renderer *renderer);
/**
* \brief Set a texture as the current rendering target.
*
* \param texture The targeted texture, which must be created with the SDL_TEXTUREACCESS_TARGET flag, or NULL for the default render target
*
* \return 0 on success, or -1 on error
*/
extern DECLSPEC int SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer,
SDL_Texture *texture);
/**
* \brief Set the drawing area for rendering on the current target.
*
@@ -561,6 +599,7 @@ extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_Renderer * renderer,
const SDL_Rect * srcrect,
const SDL_Rect * dstrect);
/**
* \brief Read pixels from the current rendering target.
*

View File

@@ -1,2 +1,2 @@
#define SDL_REVISION "hg-5868:33245988e8a2"
#define SDL_REVISION_NUMBER 5868
#define SDL_REVISION "hg-6305:601b0e251822"
#define SDL_REVISION_NUMBER 6305

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,69 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 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_scalemode.h
*
* Header file declaring the SDL_ScaleMode enumeration
*/
#ifndef _SDL_scalemode_h
#define _SDL_scalemode_h
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern "C" {
/* *INDENT-ON* */
#endif
/**
* \brief The texture scale mode used in SDL_RenderCopy().
*/
typedef enum
{
SDL_SCALEMODE_NONE = 0x00000000, /**< No scaling, rectangles must
match dimensions */
SDL_SCALEMODE_FAST = 0x00000001, /**< Point sampling or
equivalent algorithm */
SDL_SCALEMODE_SLOW = 0x00000002, /**< Linear filtering or
equivalent algorithm */
SDL_SCALEMODE_BEST = 0x00000004 /**< Bicubic filtering or
equivalent algorithm */
} SDL_ScaleMode;
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif /* _SDL_video_h */
/* vi: set ts=4 sw=4 expandtab: */

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,95 +0,0 @@
/*
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_screenkeyboard_h
#define _SDL_screenkeyboard_h
#include "SDL_stdinc.h"
#include "SDL_video.h"
#if SDL_VERSION_ATLEAST(1,3,0)
#include "SDL_keycode.h"
#include "SDL_compat.h"
#else
#include "SDL_keysym.h"
#endif
/* On-screen keyboard exposed to the application, it's yet available on Android platform only */
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/* Button IDs */
enum {
SDL_ANDROID_SCREENKEYBOARD_BUTTON_DPAD = 0, /* Joystick/D-Pad button */
SDL_ANDROID_SCREENKEYBOARD_BUTTON_0, /* Main (usually Fire) button */
SDL_ANDROID_SCREENKEYBOARD_BUTTON_1,
SDL_ANDROID_SCREENKEYBOARD_BUTTON_2,
SDL_ANDROID_SCREENKEYBOARD_BUTTON_3,
SDL_ANDROID_SCREENKEYBOARD_BUTTON_4,
SDL_ANDROID_SCREENKEYBOARD_BUTTON_5,
SDL_ANDROID_SCREENKEYBOARD_BUTTON_TEXT, /* Button to show screen keyboard */
SDL_ANDROID_SCREENKEYBOARD_BUTTON_NUM
};
/* All functions return 0 on failure and 1 on success, contrary to other SDL API */
extern DECLSPEC int SDLCALL SDL_ANDROID_SetScreenKeyboardButtonPos(int buttonId, SDL_Rect * pos);
extern DECLSPEC int SDLCALL SDL_ANDROID_GetScreenKeyboardButtonPos(int buttonId, SDL_Rect * pos);
extern DECLSPEC int SDLCALL SDL_ANDROID_SetScreenKeyboardButtonKey(int buttonId, SDLKey key);
/* Returns SDLK_UNKNOWN on failure */
extern DECLSPEC SDLKey SDLCALL SDL_ANDROID_GetScreenKeyboardButtonKey(int buttonId);
/* Buttons 0 and 1 may have auto-fire state */
extern DECLSPEC int SDLCALL SDL_ANDROID_SetScreenKeyboardAutoFireButtonsAmount(int nbuttons);
extern DECLSPEC int SDLCALL SDL_ANDROID_GetScreenKeyboardAutoFireButtonsAmount();
extern DECLSPEC int SDLCALL SDL_ANDROID_SetScreenKeyboardShown(int shown);
extern DECLSPEC int SDLCALL SDL_ANDROID_GetScreenKeyboardShown();
extern DECLSPEC int SDLCALL SDL_ANDROID_GetScreenKeyboardSize();
/* Show Android on-screen keyboard, and pass entered text back to application as SDL keypress events,
previousText is UTF-8 encoded, it may be NULL, only 256 first bytes will be used, and this call will not block */
extern DECLSPEC int SDLCALL SDL_ANDROID_ToggleScreenKeyboardTextInput(const char * previousText);
/* Show Android on-screen keyboard, and pass entered text back to application in a buffer,
using buffer contents as previous text (UTF-8 encoded), the buffer may be of any size -
this call will block until user typed all text. */
extern DECLSPEC int SDLCALL SDL_ANDROID_GetScreenKeyboardTextInput(char * textBuf, int textBufSize);
/* Whether user redefined on-screen keyboard layout via SDL menu, app should not enforce it's own layout in that case */
extern DECLSPEC int SDLCALL SDL_ANDROID_GetScreenKeyboardRedefinedByUser();
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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
@@ -51,6 +51,7 @@ extern "C" {
* Used internally (read-only).
*/
/*@{*/
#define SDL_SWSURFACE 0 /**< Just here for compatibility */
#define SDL_PREALLOC 0x00000001 /**< Surface uses preallocated memory */
#define SDL_RLEACCEL 0x00000002 /**< Surface is RLE encoded */
#define SDL_DONTFREE 0x00000004 /**< Surface is referenced internally */
@@ -208,10 +209,12 @@ extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface * surface,
* \brief Sets the color key (transparent pixel) in a blittable surface.
*
* \param surface The surface to update
* \param flag Non-zero to enable colorkey and 0 to disable colorkey
* \param flag Non-zero to enable colorkey and 0 to disable colorkey
* \param key The transparent pixel in the native surface format
*
* \return 0 on success, or -1 if the surface is not valid
*
* You can pass SDL_RLEACCEL to enable RLE accelerated blits.
*/
extern DECLSPEC int SDLCALL SDL_SetColorKey(SDL_Surface * surface,
int flag, Uint32 key);

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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
@@ -92,7 +92,7 @@ extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval,
*
* \warning It is not safe to remove a timer multiple times.
*/
extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID t);
extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID id);
/* Ends C function definitions when using C++ */

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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
@@ -59,8 +59,8 @@ typedef struct SDL_version
/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
*/
#define SDL_MAJOR_VERSION 1
#define SDL_MINOR_VERSION 3
#define SDL_MAJOR_VERSION 2
#define SDL_MINOR_VERSION 0
#define SDL_PATCHLEVEL 0
/**

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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
@@ -182,9 +182,25 @@ typedef enum
SDL_GL_ACCELERATED_VISUAL,
SDL_GL_RETAINED_BACKING,
SDL_GL_CONTEXT_MAJOR_VERSION,
SDL_GL_CONTEXT_MINOR_VERSION
SDL_GL_CONTEXT_MINOR_VERSION,
SDL_GL_CONTEXT_FLAGS,
SDL_GL_CONTEXT_PROFILE_MASK
} SDL_GLattr;
typedef enum
{
SDL_GL_CONTEXT_PROFILE_CORE = 0x0001,
SDL_GL_CONTEXT_PROFILE_COMPATIBILITY = 0x0002,
SDL_GL_CONTEXT_PROFILE_ES2 = 0x0004
} SDL_GLprofile;
typedef enum
{
SDL_GL_CONTEXT_DEBUG_FLAG = 0x0001,
SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = 0x0002,
SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG = 0x0004
} SDL_GLcontextFlag;
/* Function prototypes */

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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
@@ -87,7 +87,12 @@
#ifdef __BORLANDC__
#pragma nopackwarning
#endif
#ifdef _M_X64
/* Use 8-byte alignment on 64-bit architectures, so pointers are aligned */
#pragma pack(push,8)
#else
#pragma pack(push,4)
#endif
#endif /* Compiler needs structure packing set */
/* Set up compiler-specific options for inlining functions */

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

View File

@@ -31,7 +31,7 @@ PROJECT_NAME = SDL
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = 1.3.0
PROJECT_NUMBER = 2.0.0
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
@@ -635,7 +635,7 @@ EXCLUDE = ../doxy \
../Xcode \
../VisualC \
../VisualCE \
../Xcode-iPhoneOS
../Xcode-iOS
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
# directories that are symbolic links (a Unix filesystem feature) are excluded

52
project/jni/sdl-1.3/src/SDL.c Normal file → Executable file
View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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
@@ -49,6 +49,25 @@ static Uint32 ticks_started = 0;
int
SDL_InitSubSystem(Uint32 flags)
{
#if !SDL_TIMERS_DISABLED
/* Initialize the timer subsystem */
if (!ticks_started) {
SDL_StartTicks();
ticks_started = 1;
}
if ((flags & SDL_INIT_TIMER) && !(SDL_initialized & SDL_INIT_TIMER)) {
if (SDL_TimerInit() < 0) {
return (-1);
}
SDL_initialized |= SDL_INIT_TIMER;
}
#else
if (flags & SDL_INIT_TIMER) {
SDL_SetError("SDL not built with timer support");
return (-1);
}
#endif
#if !SDL_VIDEO_DISABLED
/* Initialize the video/event subsystem */
if ((flags & SDL_INIT_VIDEO) && !(SDL_initialized & SDL_INIT_VIDEO)) {
@@ -79,25 +98,6 @@ SDL_InitSubSystem(Uint32 flags)
}
#endif
#if !SDL_TIMERS_DISABLED
/* Initialize the timer subsystem */
if (!ticks_started) {
SDL_StartTicks();
ticks_started = 1;
}
if ((flags & SDL_INIT_TIMER) && !(SDL_initialized & SDL_INIT_TIMER)) {
if (SDL_TimerInit() < 0) {
return (-1);
}
SDL_initialized |= SDL_INIT_TIMER;
}
#else
if (flags & SDL_INIT_TIMER) {
SDL_SetError("SDL not built with timer support");
return (-1);
}
#endif
#if !SDL_JOYSTICK_DISABLED
/* Initialize the joystick subsystem */
if ((flags & SDL_INIT_JOYSTICK) && !(SDL_initialized & SDL_INIT_JOYSTICK)) {
@@ -175,12 +175,6 @@ SDL_QuitSubSystem(Uint32 flags)
SDL_initialized &= ~SDL_INIT_HAPTIC;
}
#endif
#if !SDL_TIMERS_DISABLED
if ((flags & SDL_initialized & SDL_INIT_TIMER)) {
SDL_TimerQuit();
SDL_initialized &= ~SDL_INIT_TIMER;
}
#endif
#if !SDL_AUDIO_DISABLED
if ((flags & SDL_initialized & SDL_INIT_AUDIO)) {
SDL_AudioQuit();
@@ -193,6 +187,12 @@ SDL_QuitSubSystem(Uint32 flags)
SDL_initialized &= ~SDL_INIT_VIDEO;
}
#endif
#if !SDL_TIMERS_DISABLED
if ((flags & SDL_initialized & SDL_INIT_TIMER)) {
SDL_TimerQuit();
SDL_initialized &= ~SDL_INIT_TIMER;
}
#endif
}
Uint32

7
project/jni/sdl-1.3/src/SDL_assert.c Normal file → Executable file
View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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
@@ -18,6 +18,7 @@
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "SDL_config.h"
#include "SDL.h"
#include "SDL_atomic.h"
@@ -254,9 +255,9 @@ static void SDL_GenerateAssertionReport(void)
static void SDL_ExitProcess(int exitcode)
{
#ifdef __WIN32__
ExitProcess(42);
ExitProcess(exitcode);
#else
_exit(42);
_exit(exitcode);
#endif
}

2
project/jni/sdl-1.3/src/SDL_assert_c.h Normal file → Executable file
View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

File diff suppressed because it is too large Load Diff

2
project/jni/sdl-1.3/src/SDL_error.c Normal file → Executable file
View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

2
project/jni/sdl-1.3/src/SDL_error_c.h Normal file → Executable file
View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

2
project/jni/sdl-1.3/src/SDL_fatal.c Normal file → Executable file
View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

2
project/jni/sdl-1.3/src/SDL_fatal.h Normal file → Executable file
View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

2
project/jni/sdl-1.3/src/SDL_hints.c Normal file → Executable file
View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

2
project/jni/sdl-1.3/src/SDL_hints_c.h Normal file → Executable file
View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

4
project/jni/sdl-1.3/src/SDL_log.c Normal file → Executable file
View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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
@@ -34,7 +34,7 @@
#include <android/log.h>
#endif
#define DEFAULT_PRIORITY SDL_LOG_PRIORITY_ERROR
#define DEFAULT_PRIORITY SDL_LOG_PRIORITY_CRITICAL
#define DEFAULT_APPLICATION_PRIORITY SDL_LOG_PRIORITY_INFO
typedef struct SDL_LogLevel

View File

@@ -1,207 +0,0 @@
These are changes of my Android SDL port over the official SDL port, at the last point where I've synced them
TODO: merge this
--- SDL_renderer_gles.c 2011-12-05 14:18:19.517975982 +0200
+++ /home/pelya/src/endless_space/SDL-android/video/SDL_renderer_gles.c 2011-12-05 13:57:25.000000000 +0200
@@ -20,15 +20,29 @@
slouken@libsdl.org
*/
#include "SDL_config.h"
+#include "SDL_version.h"
#if SDL_VIDEO_RENDER_OGL_ES
+#if SDL_VERSION_ATLEAST(1,3,0)
#include "SDL_video.h"
#include "SDL_opengles.h"
#include "SDL_sysvideo.h"
+#else
+#include "SDL_video-1.3.h"
+#include "SDL_sysvideo-1.3.h"
+#endif
+#include "SDL_opengles.h"
#include "SDL_pixels_c.h"
#include "SDL_rect_c.h"
+#if SDL_VERSION_ATLEAST(1,3,0)
#include "SDL_yuv_sw_c.h"
+#endif
+#ifdef ANDROID
+#include <android/log.h>
+#else
+#define __android_log_print(...)
+#endif
#if defined(__QNXNTO__)
/* Include QNX system header to check QNX version later */
@@ -112,15 +126,14 @@
SDL_TEXTUREMODULATE_ALPHA),
(SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK |
SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD),
- (SDL_SCALEMODE_NONE | SDL_SCALEMODE_FAST | SDL_SCALEMODE_SLOW), 6,
+ (SDL_SCALEMODE_NONE | SDL_SCALEMODE_FAST | SDL_SCALEMODE_SLOW), 5,
{
/* OpenGL ES 1.x supported formats list */
SDL_PIXELFORMAT_RGBA4444,
SDL_PIXELFORMAT_RGBA5551,
SDL_PIXELFORMAT_RGB565,
SDL_PIXELFORMAT_RGB24,
- SDL_PIXELFORMAT_BGR888,
- SDL_PIXELFORMAT_ABGR8888},
+ SDL_PIXELFORMAT_RGBA8888},
0,
0}
};
@@ -213,11 +226,13 @@
GLint value;
int doublebuffer;
+#if SDL_VERSION_ATLEAST(1,3,0)
if (!(window->flags & SDL_WINDOW_OPENGL)) {
if (SDL_RecreateWindow(window, window->flags | SDL_WINDOW_OPENGL) < 0) {
return NULL;
}
}
+#endif
renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer));
if (!renderer) {
@@ -295,11 +310,15 @@
renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
}
+#if SDL_VERSION_ATLEAST(1,3,0)
+ // Always double-buffered
+#else
if (SDL_GL_GetAttribute(SDL_GL_DOUBLEBUFFER, &doublebuffer) == 0) {
if (!doublebuffer) {
renderer->info.flags |= SDL_RENDERER_SINGLEBUFFER;
}
}
+#endif
#if SDL_VIDEO_DRIVER_PANDORA
data->GL_OES_draw_texture_supported = SDL_FALSE;
data->useDrawTexture = SDL_FALSE;
@@ -311,6 +330,10 @@
data->GL_OES_draw_texture_supported = SDL_FALSE;
data->useDrawTexture = SDL_FALSE;
}
+#ifdef ANDROID
+ data->GL_OES_draw_texture_supported = SDL_TRUE;
+ data->useDrawTexture = SDL_TRUE;
+#endif
#endif
data->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &value);
@@ -337,14 +360,27 @@
if (SDL_GL_MakeCurrent(window, data->context) < 0) {
return -1;
}
+
+ /* Set up parameters for rendering */
+ data->blendMode = -1;
+ data->glDisable(GL_DEPTH_TEST);
+ data->glDisable(GL_CULL_FACE);
+ data->updateSize = SDL_TRUE;
+
if (data->updateSize) {
data->glMatrixMode(GL_PROJECTION);
data->glLoadIdentity();
data->glMatrixMode(GL_MODELVIEW);
data->glLoadIdentity();
+#if SDL_VIDEO_RENDER_RESIZE
+ data->glViewport(0, 0, window->display->desktop_mode.w, window->display->desktop_mode.h);
+ data->glOrthof(0.0, (GLfloat) window->display->desktop_mode.w, (GLfloat) window->display->desktop_mode.h,
+ 0.0, 0.0, 1.0);
+#else
data->glViewport(0, 0, window->w, window->h);
- data->glOrthof(0.0, (GLfloat) window->w, (GLfloat) window->h, 0.0,
- 0.0, 1.0);
+ data->glOrthof(0.0, (GLfloat) window->w, (GLfloat) window->h,
+ 0.0, 0.0, 1.0);
+#endif
data->updateSize = SDL_FALSE;
}
return 0;
@@ -388,6 +424,7 @@
break;
case SDL_PIXELFORMAT_BGR888:
case SDL_PIXELFORMAT_ABGR8888:
+ case SDL_PIXELFORMAT_RGBA8888:
internalFormat = GL_RGBA;
format = GL_RGBA;
type = GL_UNSIGNED_BYTE;
@@ -419,7 +456,8 @@
return -1;
}
- if (texture->access == SDL_TEXTUREACCESS_STREAMING) {
+ if (texture->access == SDL_TEXTUREACCESS_STREAMING)
+ {
data->pitch = texture->w * SDL_BYTESPERPIXEL(texture->format);
data->pixels = SDL_malloc(texture->h * data->pitch);
if (!data->pixels) {
@@ -441,6 +479,11 @@
texture_h = power_of_2(texture->h);
data->texw = (GLfloat) texture->w / texture_w;
data->texh = (GLfloat) texture->h / texture_h;
+ if( renderer->info.max_texture_width < texture_w || renderer->info.max_texture_height < texture_h )
+ __android_log_print(ANDROID_LOG_WARN, "libSDL", "GLES: Allocated texture of size %dx%d which is bigger than largest possible device texture %dx%d",
+ texture_w, texture_h, renderer->info.max_texture_width, renderer->info.max_texture_height );
+ else if( texture_w > 1024 || texture_h > 1024 )
+ __android_log_print(ANDROID_LOG_WARN, "libSDL", "GLES: Allocated texture of size %dx%d which is bigger than 1024x1024 - this code will not work on HTC G1", texture_w, texture_h );
data->format = format;
data->formattype = type;
@@ -557,13 +600,36 @@
GLES_RenderData *renderdata = (GLES_RenderData *) renderer->driverdata;
GLES_TextureData *data = (GLES_TextureData *) texture->driverdata;
GLenum result;
+ int bpp = SDL_BYTESPERPIXEL(texture->format);
+ void * temp_buffer;
+ void * temp_ptr;
+ int i;
renderdata->glGetError();
renderdata->glEnable(data->type);
SetupTextureUpdate(renderdata, texture, pitch);
+
+ if( rect->w * bpp == pitch ) {
+ temp_buffer = (void *)pixels; /* No need to reformat */
+ } else {
+ /* Reformatting of mem area required */
+ temp_buffer = SDL_malloc(rect->w * rect->h * bpp);
+ temp_ptr = temp_buffer;
+ for (i = 0; i < rect->h; i++) {
+ SDL_memcpy(temp_ptr, pixels, rect->w * bpp);
+ temp_ptr += rect->w * bpp;
+ pixels += pitch;
+ }
+ }
+
renderdata->glTexSubImage2D(data->type, 0, rect->x, rect->y, rect->w,
rect->h, data->format, data->formattype,
- pixels);
+ temp_buffer);
+
+ if( temp_buffer != pixels ) {
+ SDL_free(temp_buffer);
+ }
+
renderdata->glDisable(data->type);
result = renderdata->glGetError();
if (result != GL_NO_ERROR) {
@@ -887,7 +953,13 @@
cropRect[3] = -srcrect->h;
data->glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES,
cropRect);
- data->glDrawTexiOES(dstrect->x, window->h - dstrect->y - dstrect->h,
+ //__android_log_print(ANDROID_LOG_INFO, "libSDL", "GLES_RenderCopy glDrawTexiOES(%d, %d, %d, %d) cropRect %d:%d:%d:%d", dstrect->x, window->display->desktop_mode.h - dstrect->y - dstrect->h, dstrect->w, dstrect->h, cropRect[0], cropRect[1], cropRect[2], cropRect[3]);
+ data->glDrawTexiOES(dstrect->x,
+#if SDL_VIDEO_RENDER_RESIZE
+ window->display->desktop_mode.h - dstrect->y - dstrect->h,
+#else
+ window->h - dstrect->y - dstrect->h,
+#endif
0, dstrect->w, dstrect->h);
} else {

View File

@@ -1,288 +0,0 @@
These are changes of my Android SDL port over the official SDL port, at the last point where I've synced them
TODO: merge this
--- SDL_video.c 2011-12-05 14:18:19.537975981 +0200
+++ /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.3/src/video/SDL_video.c 2011-12-05 14:20:10.817974963 +0200
@@ -33,6 +33,9 @@
#include "SDL_renderer_sw.h"
#include "../events/SDL_sysevents.h"
#include "../events/SDL_events_c.h"
+#ifdef ANDROID
+#include <android/log.h>
+#endif
#if SDL_VIDEO_DRIVER_WIN32
#include "win32/SDL_win32video.h"
@@ -98,15 +101,15 @@
#if SDL_VIDEO_DRIVER_UIKIT
&UIKIT_bootstrap,
#endif
+#if SDL_VIDEO_DRIVER_ANDROID
+ &ANDROID_bootstrap,
+#endif
#if SDL_VIDEO_DRIVER_DUMMY
&DUMMY_bootstrap,
#endif
#if SDL_VIDEO_DRIVER_PANDORA
&PND_bootstrap,
#endif
-#if SDL_VIDEO_DRIVER_ANDROID
- &Android_bootstrap,
-#endif
NULL
};
@@ -2396,6 +2399,36 @@
return renderer->RenderClear(renderer);
}
+#if SDL_VIDEO_RENDER_RESIZE
+
+static inline void
+SDL_RESIZE_resizePoints(int realW, int fakeW, int realH, int fakeH,
+ const SDL_Point * src, SDL_Point * dest, int count )
+{
+ int i;
+ for( i = 0; i < count; i++ ) {
+ dest[i].x = src[i].x * realW / fakeW;
+ dest[i].y = src[i].y * realH / fakeH;
+ }
+}
+
+static inline void
+SDL_RESIZE_resizeRects(int realW, int fakeW, int realH, int fakeH,
+ const SDL_Rect ** src, SDL_Rect * dest, int count )
+{
+ int i;
+ for( i = 0; i < count; i++ ) {
+ // Calculate bottom-right corner instead of width/height, and substract upper-left corner,
+ // otherwise we'll have rounding errors and holes between textures
+ dest[i].x = src[i]->x * realW / fakeW;
+ dest[i].y = src[i]->y * realH / fakeH;
+ dest[i].w = (src[i]->w + src[i]->x) * realW / fakeW - dest[i].x;
+ dest[i].h = (src[i]->h + src[i]->y) * realH / fakeH - dest[i].y;
+ }
+}
+
+#endif
+
int
SDL_RenderDrawPoint(int x, int y)
{
@@ -2403,6 +2436,7 @@
point.x = x;
point.y = y;
+
return SDL_RenderDrawPoints(&point, 1);
}
@@ -2410,6 +2444,9 @@
SDL_RenderDrawPoints(const SDL_Point * points, int count)
{
SDL_Renderer *renderer;
+#if SDL_VIDEO_RENDER_RESIZE
+ int realW, realH, fakeW, fakeH, ret;
+#endif
if (!points) {
SDL_SetError("SDL_RenderDrawPoints(): Passed NULL points");
@@ -2427,6 +2464,26 @@
if (count < 1) {
return 0;
}
+
+#if SDL_VIDEO_RENDER_RESIZE
+ realW = renderer->window->display->desktop_mode.w;
+ realH = renderer->window->display->desktop_mode.h;
+ fakeW = renderer->window->w;
+ fakeH = renderer->window->h;
+ //if( fakeW > realW || fakeH > realH )
+ {
+ SDL_Point * resized = SDL_stack_alloc( SDL_Point, count );
+ if( ! resized ) {
+ SDL_OutOfMemory();
+ return -1;
+ }
+ SDL_RESIZE_resizePoints( realW, fakeW, realH, fakeH, points, resized, count );
+ ret = renderer->RenderDrawPoints(renderer, resized, count);
+ SDL_stack_free(resized);
+ return ret;
+ }
+#endif
+
return renderer->RenderDrawPoints(renderer, points, count);
}
@@ -2446,6 +2503,9 @@
SDL_RenderDrawLines(const SDL_Point * points, int count)
{
SDL_Renderer *renderer;
+#if SDL_VIDEO_RENDER_RESIZE
+ int realW, realH, fakeW, fakeH, ret;
+#endif
if (!points) {
SDL_SetError("SDL_RenderDrawLines(): Passed NULL points");
@@ -2463,6 +2523,26 @@
if (count < 2) {
return 0;
}
+
+#if SDL_VIDEO_RENDER_RESIZE
+ realW = renderer->window->display->desktop_mode.w;
+ realH = renderer->window->display->desktop_mode.h;
+ fakeW = renderer->window->w;
+ fakeH = renderer->window->h;
+ //if( fakeW > realW || fakeH > realH )
+ {
+ SDL_Point * resized = SDL_stack_alloc( SDL_Point, count );
+ if( ! resized ) {
+ SDL_OutOfMemory();
+ return -1;
+ }
+ SDL_RESIZE_resizePoints( realW, fakeW, realH, fakeH, points, resized, count );
+ ret = renderer->RenderDrawLines(renderer, resized, count);
+ SDL_stack_free(resized);
+ return ret;
+ }
+#endif
+
return renderer->RenderDrawLines(renderer, points, count);
}
@@ -2477,6 +2557,9 @@
{
SDL_Renderer *renderer;
int i;
+#if SDL_VIDEO_RENDER_RESIZE
+ int realW, realH, fakeW, fakeH, ret;
+#endif
if (!rects) {
SDL_SetError("SDL_RenderDrawRects(): Passed NULL rects");
@@ -2509,6 +2592,37 @@
return renderer->RenderDrawRects(renderer, &rect, 1);
}
}
+
+#if SDL_VIDEO_RENDER_RESIZE
+ realW = renderer->window->display->desktop_mode.w;
+ realH = renderer->window->display->desktop_mode.h;
+ fakeW = renderer->window->w;
+ fakeH = renderer->window->h;
+ //if( fakeW > realW || fakeH > realH )
+ {
+ SDL_Rect * resized = SDL_stack_alloc( SDL_Rect, count );
+ if( ! resized ) {
+ SDL_OutOfMemory();
+ return -1;
+ }
+
+ const SDL_Rect ** resizedPtrs = SDL_stack_alloc( const SDL_Rect *, count );
+ if( ! resizedPtrs ) {
+ SDL_OutOfMemory();
+ return -1;
+ }
+
+ for( i = 0; i < count; i++ ) {
+ resizedPtrs[i] = &(resized[i]);
+ }
+ SDL_RESIZE_resizeRects( realW, fakeW, realH, fakeH, rects, resized, count );
+ ret = renderer->RenderDrawRects(renderer, resizedPtrs, count);
+ SDL_stack_free(resizedPtrs);
+ SDL_stack_free(resized);
+ return ret;
+ }
+#endif
+
return renderer->RenderDrawRects(renderer, rects, count);
}
@@ -2523,6 +2637,9 @@
{
SDL_Renderer *renderer;
int i;
+#if SDL_VIDEO_RENDER_RESIZE
+ int realW, realH, fakeW, fakeH, ret;
+#endif
if (!rects) {
SDL_SetError("SDL_RenderFillRects(): Passed NULL rects");
@@ -2555,6 +2672,37 @@
return renderer->RenderFillRects(renderer, &rect, 1);
}
}
+
+#if SDL_VIDEO_RENDER_RESIZE
+ realW = renderer->window->display->desktop_mode.w;
+ realH = renderer->window->display->desktop_mode.h;
+ fakeW = renderer->window->w;
+ fakeH = renderer->window->h;
+ //if( fakeW > realW || fakeH > realH )
+ {
+ SDL_Rect * resized = SDL_stack_alloc( SDL_Rect, count );
+ if( ! resized ) {
+ SDL_OutOfMemory();
+ return -1;
+ }
+
+ const SDL_Rect ** resizedPtrs = SDL_stack_alloc( const SDL_Rect *, count );
+ if( ! resizedPtrs ) {
+ SDL_OutOfMemory();
+ return -1;
+ }
+
+ for( i = 0; i < count; i++ ) {
+ resizedPtrs[i] = &(resized[i]);
+ }
+ SDL_RESIZE_resizeRects( realW, fakeW, realH, fakeH, rects, resized, count );
+ ret = renderer->RenderFillRects(renderer, resizedPtrs, count);
+ SDL_stack_free(resizedPtrs);
+ SDL_stack_free(resized);
+ return ret;
+ }
+#endif
+
return renderer->RenderFillRects(renderer, rects, count);
}
@@ -2566,6 +2714,12 @@
SDL_Window *window;
SDL_Rect real_srcrect;
SDL_Rect real_dstrect;
+#if SDL_VIDEO_RENDER_RESIZE
+ int realW;
+ int realH;
+ int fakeW;
+ int fakeH;
+#endif
CHECK_TEXTURE_MAGIC(texture, -1);
@@ -2616,6 +2770,25 @@
}
}
+#if SDL_VIDEO_RENDER_RESIZE
+ realW = window->display->desktop_mode.w;
+ realH = window->display->desktop_mode.h;
+ fakeW = window->w;
+ fakeH = window->h;
+ //if( fakeW > realW || fakeH > realH )
+ {
+ // Calculate bottom-right corner instead of width/height, and substract upper-left corner,
+ // otherwise we'll have rounding errors and holes between textures
+ real_dstrect.w = (real_dstrect.w + real_dstrect.x) * realW / fakeW;
+ real_dstrect.h = (real_dstrect.h + real_dstrect.y) * realH / fakeH;
+ real_dstrect.x = real_dstrect.x * realW / fakeW;
+ real_dstrect.y = real_dstrect.y * realH / fakeH;
+ real_dstrect.w -= real_dstrect.x;
+ real_dstrect.h -= real_dstrect.y;
+ //__android_log_print(ANDROID_LOG_INFO, "libSDL", "SDL_RenderCopy dest %d:%d+%d+%d desktop_mode %d:%d", (int)real_dstrect.x, (int)real_dstrect.y, (int)real_dstrect.w, (int)real_dstrect.h, (int)realW, (int)realH);
+ }
+#endif
+
return renderer->RenderCopy(renderer, texture, &real_srcrect,
&real_dstrect);
}

4
project/jni/sdl-1.3/src/atomic/SDL_atomic.c Normal file → Executable file
View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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
@@ -18,7 +18,7 @@
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "SDL_stdinc.h"
#include "SDL_config.h"
#include "SDL_atomic.h"

4
project/jni/sdl-1.3/src/atomic/SDL_spinlock.c Normal file → Executable file
View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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
@@ -18,7 +18,7 @@
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "SDL_stdinc.h"
#include "SDL_config.h"
#include "SDL_atomic.h"
#include "SDL_mutex.h"

2
project/jni/sdl-1.3/src/audio/SDL_audio.c Normal file → Executable file
View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

2
project/jni/sdl-1.3/src/audio/SDL_audio_c.h Normal file → Executable file
View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

18
project/jni/sdl-1.3/src/audio/SDL_audiocvt.c Normal file → Executable file
View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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
@@ -25,12 +25,9 @@
#include "SDL_audio.h"
#include "SDL_audio_c.h"
/* #define DEBUG_CONVERT */
#include "SDL_assert.h"
/* !!! FIXME */
#ifndef assert
#define assert(x)
#endif
/* #define DEBUG_CONVERT */
/* Effectively mix right and left channels into a single channel */
static void SDLCALL
@@ -295,8 +292,9 @@ SDL_ConvertStereo(SDL_AudioCVT * cvt, SDL_AudioFormat format)
{ \
const type *src = (const type *) (cvt->buf + cvt->len_cvt); \
type *dst = (type *) (cvt->buf + cvt->len_cvt * 2); \
for (i = cvt->len_cvt / 2; i; --i, --src) { \
for (i = cvt->len_cvt / sizeof(type); i; --i) { \
const type val = *src; \
src -= 1; \
dst -= 2; \
dst[0] = dst[1] = val; \
} \
@@ -880,9 +878,9 @@ SDL_FindFrequencyMultiple(const int src_rate, const int dst_rate)
int lo, hi;
int div;
assert(src_rate != 0);
assert(dst_rate != 0);
assert(src_rate != dst_rate);
SDL_assert(src_rate != 0);
SDL_assert(dst_rate != 0);
SDL_assert(src_rate != dst_rate);
if (src_rate < dst_rate) {
lo = src_rate;

2
project/jni/sdl-1.3/src/audio/SDL_audiodev.c Normal file → Executable file
View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

2
project/jni/sdl-1.3/src/audio/SDL_audiodev_c.h Normal file → Executable file
View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

2
project/jni/sdl-1.3/src/audio/SDL_audiomem.h Normal file → Executable file
View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

2482
project/jni/sdl-1.3/src/audio/SDL_audiotypecvt.c Normal file → Executable file

File diff suppressed because it is too large Load Diff

2
project/jni/sdl-1.3/src/audio/SDL_mixer.c Normal file → Executable file
View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

2
project/jni/sdl-1.3/src/audio/SDL_sysaudio.h Normal file → Executable file
View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

2
project/jni/sdl-1.3/src/audio/SDL_wave.c Normal file → Executable file
View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

2
project/jni/sdl-1.3/src/audio/SDL_wave.h Normal file → Executable file
View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2012 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

Some files were not shown because too many files have changed in this diff Show More