diff options
Diffstat (limited to '3rdparty/SDL2/docs')
-rw-r--r-- | 3rdparty/SDL2/docs/README-android.md | 25 | ||||
-rw-r--r-- | 3rdparty/SDL2/docs/README-ios.md | 18 | ||||
-rw-r--r-- | 3rdparty/SDL2/docs/README-linux.md | 10 | ||||
-rw-r--r-- | 3rdparty/SDL2/docs/README-macosx.md | 53 | ||||
-rw-r--r-- | 3rdparty/SDL2/docs/README-porting.md | 5 | ||||
-rw-r--r-- | 3rdparty/SDL2/docs/README-raspberrypi.md | 2 | ||||
-rw-r--r-- | 3rdparty/SDL2/docs/README-touch.md | 12 | ||||
-rw-r--r-- | 3rdparty/SDL2/docs/README-winrt.md | 68 |
8 files changed, 115 insertions, 78 deletions
diff --git a/3rdparty/SDL2/docs/README-android.md b/3rdparty/SDL2/docs/README-android.md index 0911eeae4db..1ed37246242 100644 --- a/3rdparty/SDL2/docs/README-android.md +++ b/3rdparty/SDL2/docs/README-android.md @@ -67,13 +67,13 @@ For more complex projects, follow these 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 or symlink this SDL directory into the <project>/jni directory -3. Edit <project>/jni/src/Android.mk to include your source files +2. Move or symlink this SDL directory into the "<project>/jni" directory +3. Edit "<project>/jni/src/Android.mk" to include your source files 4. Run 'ndk-build' (a script provided by the NDK). This compiles the C source If you want to use the Eclipse IDE, skip to the Eclipse section below. -5. Create <project>/local.properties and use that to point to the Android SDK directory, by writing a line with the following form: +5. Create "<project>/local.properties" and use that to point to the Android SDK directory, by writing a line with the following form: sdk.dir=PATH_TO_ANDROID_SDK @@ -121,15 +121,15 @@ This build uses the Android NDK module system. Instructions: 1. Copy the android-project directory wherever you want to keep your projects and rename it to the name of your project. -2. Rename <project>/jni/src/Android_static.mk to <project>/jni/src/Android.mk +2. Rename "<project>/jni/src/Android_static.mk" to "<project>/jni/src/Android.mk" (overwrite the existing one) -3. Edit <project>/jni/src/Android.mk to include your source files +3. Edit "<project>/jni/src/Android.mk" to include your source files 4. create and export an environment variable named NDK_MODULE_PATH that points to the parent directory of this SDL directory. e.g.: export NDK_MODULE_PATH="$PWD"/.. -5. Edit <project>/src/org/libsdl/app/SDLActivity.java and remove the call to +5. Edit "<project>/src/org/libsdl/app/SDLActivity.java" and remove the call to System.loadLibrary("SDL2"). 6. Run 'ndk-build' (a script provided by the NDK). This compiles the C source @@ -420,6 +420,19 @@ When you're done instrumenting with valgrind, you can disable the wrapper: adb shell setprop wrap.org.libsdl.app "" ================================================================================ + Graphics debugging +================================================================================ + +If you are developing on a compatible Tegra-based tablet, NVidia provides +Tegra Graphics Debugger at their website. Because SDL2 dynamically loads EGL +and GLES libraries, you must follow their instructions for installing the +interposer library on a rooted device. The non-rooted instructions are not +compatible with applications that use SDL2 for video. + +The Tegra Graphics Debugger is available from NVidia here: +https://developer.nvidia.com/tegra-graphics-debugger + +================================================================================ Why is API level 10 the minimum required? ================================================================================ diff --git a/3rdparty/SDL2/docs/README-ios.md b/3rdparty/SDL2/docs/README-ios.md index f391d1e23d5..ab226db9ffc 100644 --- a/3rdparty/SDL2/docs/README-ios.md +++ b/3rdparty/SDL2/docs/README-ios.md @@ -74,17 +74,17 @@ By default SDL will not use the full pixel density of the screen on Retina/high-dpi capable devices. Use the SDL_WINDOW_ALLOW_HIGHDPI flag when creating your window to enable high-dpi support. -When high-dpi support is enabled, SDL_GetWindowSize and display mode sizes +When high-dpi support is enabled, SDL_GetWindowSize() and display mode sizes will still be in "screen coordinates" rather than pixels, but the window will have a much greater pixel density when the device supports it, and the -SDL_GL_GetDrawableSize or SDL_GetRendererOutputSize functions (depending on +SDL_GL_GetDrawableSize() or SDL_GetRendererOutputSize() functions (depending on whether raw OpenGL or the SDL_Render API is used) can be queried to determine the size in pixels of the drawable screen framebuffer. Some OpenGL ES functions such as glViewport expect sizes in pixels rather than sizes in screen coordinates. When doing 2D rendering with OpenGL ES, an orthographic projection matrix using the size in screen coordinates -(SDL_GetWindowSize) can be used in order to display content at the same scale +(SDL_GetWindowSize()) can be used in order to display content at the same scale no matter whether a Retina device is used or not. ============================================================================== @@ -156,7 +156,7 @@ Notes -- Accelerometer as Joystick SDL for iPhone supports polling the built in accelerometer as a joystick device. For an example on how to do this, see the accelerometer.c in the demos directory. -The main thing to note when using the accelerometer with SDL is that while the iPhone natively reports accelerometer as floating point values in units of g-force, SDL_JoystickGetAxis reports joystick values as signed integers. Hence, in order to convert between the two, some clamping and scaling is necessary on the part of the iPhone SDL joystick driver. To convert SDL_JoystickGetAxis reported values BACK to units of g-force, simply multiply the values by SDL_IPHONE_MAX_GFORCE / 0x7FFF. +The main thing to note when using the accelerometer with SDL is that while the iPhone natively reports accelerometer as floating point values in units of g-force, SDL_JoystickGetAxis() reports joystick values as signed integers. Hence, in order to convert between the two, some clamping and scaling is necessary on the part of the iPhone SDL joystick driver. To convert SDL_JoystickGetAxis() reported values BACK to units of g-force, simply multiply the values by SDL_IPHONE_MAX_GFORCE / 0x7FFF. ============================================================================== Notes -- OpenGL ES @@ -164,7 +164,7 @@ Notes -- OpenGL ES Your SDL application for iOS uses OpenGL ES for video by default. -OpenGL ES for iOS supports several display pixel formats, such as RGBA8 and RGB565, which provide a 32 bit and 16 bit color buffer respectively. By default, the implementation uses RGB565, but you may use RGBA8 by setting each color component to 8 bits in SDL_GL_SetAttribute. +OpenGL ES for iOS supports several display pixel formats, such as RGBA8 and RGB565, which provide a 32 bit and 16 bit color buffer respectively. By default, the implementation uses RGB565, but you may use RGBA8 by setting each color component to 8 bits in SDL_GL_SetAttribute(). If your application doesn't use OpenGL's depth buffer, you may find significant performance improvement by setting SDL_GL_DEPTH_SIZE to 0. @@ -172,11 +172,11 @@ Finally, if your application completely redraws the screen each frame, you may f OpenGL ES on iOS doesn't use the traditional system-framebuffer setup provided in other operating systems. Special care must be taken because of this: -- The drawable Renderbuffer must be bound to the GL_RENDERBUFFER binding point when SDL_GL_SwapWindow is called. -- The drawable Framebuffer Object must be bound while rendering to the screen and when SDL_GL_SwapWindow is called. +- The drawable Renderbuffer must be bound to the GL_RENDERBUFFER binding point when SDL_GL_SwapWindow() is called. +- The drawable Framebuffer Object must be bound while rendering to the screen and when SDL_GL_SwapWindow() is called. - If multisample antialiasing (MSAA) is used and glReadPixels is used on the screen, the drawable framebuffer must be resolved to the MSAA resolve framebuffer (via glBlitFramebuffer or glResolveMultisampleFramebufferAPPLE), and the MSAA resolve framebuffer must be bound to the GL_READ_FRAMEBUFFER binding point, before glReadPixels is called. -The above objects can be obtained via SDL_GetWindowWMInfo (in SDL_syswm.h). +The above objects can be obtained via SDL_GetWindowWMInfo() (in SDL_syswm.h). ============================================================================== Notes -- Keyboard @@ -219,7 +219,7 @@ Notes -- iPhone SDL limitations ============================================================================== 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). + 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). Textures: The optimal texture formats on iOS are SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, and SDL_PIXELFORMAT_RGB24 pixel formats. diff --git a/3rdparty/SDL2/docs/README-linux.md b/3rdparty/SDL2/docs/README-linux.md index fddabf524b3..caf09992c7a 100644 --- a/3rdparty/SDL2/docs/README-linux.md +++ b/3rdparty/SDL2/docs/README-linux.md @@ -19,10 +19,14 @@ sudo apt-get install build-essential mercurial make cmake autoconf automake \ libtool libasound2-dev libpulse-dev libaudio-dev libx11-dev libxext-dev \ libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxxf86vm-dev \ libxss-dev libgl1-mesa-dev libesd0-dev libdbus-1-dev libudev-dev \ -libgles1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev libibus-1.0-dev +libgles1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev libibus-1.0-dev \ +fcitx-libs-dev -Ubuntu 14.04 can also add "libwayland-dev libmirclient-dev libxkbcommon-dev" -to that command line for Wayland and Mir support. +Ubuntu 16.04 can also add "libwayland-dev libxkbcommon-dev wayland-protocols" +to that command line for Wayland support. + +Ubuntu 16.10 can also add "libmirclient-dev libxkbcommon-dev" to that command +line for Mir support. NOTES: - This includes all the audio targets except arts, because Ubuntu pulled the diff --git a/3rdparty/SDL2/docs/README-macosx.md b/3rdparty/SDL2/docs/README-macosx.md index 32f8eb85ba2..49c168e6390 100644 --- a/3rdparty/SDL2/docs/README-macosx.md +++ b/3rdparty/SDL2/docs/README-macosx.md @@ -11,9 +11,9 @@ command line tools or Apple's IDE Xcode. To build SDL using the command line, use the standard configure and make process: - ./configure - make - sudo make install + ./configure + make + sudo make install You can also build SDL as a Universal library (a single binary for both 32-bit and 64-bit Intel architectures), on Mac OS X 10.7 and newer, by using @@ -21,9 +21,9 @@ the gcc-fat.sh script in build-scripts: mkdir mybuild cd mybuild - CC=$PWD/../build-scripts/gcc-fat.sh CXX=$PWD/../build-scripts/g++fat.sh ../configure - make - sudo make install + CC=$PWD/../build-scripts/gcc-fat.sh CXX=$PWD/../build-scripts/g++-fat.sh ../configure + make + sudo make install This script builds SDL with 10.5 ABI compatibility on i386 and 10.6 ABI compatibility on x86_64 architectures. For best compatibility you @@ -86,17 +86,17 @@ so called "bundle", which basically is a fancy folder with a name like To get this build automatically, add something like the following rule to your Makefile.am: -bundle_contents = APP_NAME.app/Contents -APP_NAME_bundle: EXE_NAME - mkdir -p $(bundle_contents)/MacOS - mkdir -p $(bundle_contents)/Resources - echo "APPL????" > $(bundle_contents)/PkgInfo - $(INSTALL_PROGRAM) $< $(bundle_contents)/MacOS/ + bundle_contents = APP_NAME.app/Contents + APP_NAME_bundle: EXE_NAME + mkdir -p $(bundle_contents)/MacOS + mkdir -p $(bundle_contents)/Resources + echo "APPL????" > $(bundle_contents)/PkgInfo + $(INSTALL_PROGRAM) $< $(bundle_contents)/MacOS/ You should replace EXE_NAME with the name of the executable. APP_NAME is what will be visible to the user in the Finder. Usually it will be the same as EXE_NAME but capitalized. E.g. if EXE_NAME is "testgame" then APP_NAME -usually is "TestGame". You might also want to use @PACKAGE@ to use the package +usually is "TestGame". You might also want to use `@PACKAGE@` to use the package name as specified in your configure.in file. If your project builds more than one application, you will have to do a bit @@ -105,13 +105,13 @@ more. For each of your target applications, you need a separate rule. If you want the created bundles to be installed, you may want to add this rule to your Makefile.am: -install-exec-hook: APP_NAME_bundle - rm -rf $(DESTDIR)$(prefix)/Applications/APP_NAME.app - mkdir -p $(DESTDIR)$(prefix)/Applications/ - cp -r $< /$(DESTDIR)$(prefix)Applications/ + install-exec-hook: APP_NAME_bundle + rm -rf $(DESTDIR)$(prefix)/Applications/APP_NAME.app + mkdir -p $(DESTDIR)$(prefix)/Applications/ + cp -r $< /$(DESTDIR)$(prefix)Applications/ This rule takes the Bundle created by the rule from step 3 and installs them -into $(DESTDIR)$(prefix)/Applications/. +into "$(DESTDIR)$(prefix)/Applications/". Again, if you want to install multiple applications, you will have to augment the make rule accordingly. @@ -126,11 +126,16 @@ there are some more things you should do before shipping your product... unless you also install SDL on that other computer. A good solution for this dilemma is to static link against SDL. On OS X, you can achieve that by linking against the libraries listed by - sdl-config --static-libs + + sdl-config --static-libs + instead of those listed by - sdl-config --libs + + sdl-config --libs + Depending on how exactly SDL is integrated into your build systems, the way to achieve that varies, so I won't describe it here in detail + 2) Add an 'Info.plist' to your application. That is a special XML file which contains some meta-information about your application (like some copyright information, the version of your app, the name of an optional icon file, @@ -156,8 +161,10 @@ The first thing to do is to unpack the Xcode.tar.gz archive in the top level SDL directory (where the Xcode.tar.gz archive resides). Because Stuffit Expander will unpack the archive into a subdirectory, you should unpack the archive manually from the command line: - cd [path_to_SDL_source] - tar zxf Xcode.tar.gz + + cd [path_to_SDL_source] + tar zxf Xcode.tar.gz + This will create a new folder called Xcode, which you can browse normally from the Finder. @@ -227,4 +234,4 @@ following locations: Functionality may be added in the future to help this. -Known bugs are listed in the file "BUGS" +Known bugs are listed in the file "BUGS.txt". diff --git a/3rdparty/SDL2/docs/README-porting.md b/3rdparty/SDL2/docs/README-porting.md index 062cb038ec3..6211f0ce4ff 100644 --- a/3rdparty/SDL2/docs/README-porting.md +++ b/3rdparty/SDL2/docs/README-porting.md @@ -5,7 +5,7 @@ Porting The first thing you have to do when porting to a new platform, is look at include/SDL_platform.h and create an entry there for your operating system. -The standard format is __PLATFORM__, where PLATFORM is the name of the OS. +The standard format is "__PLATFORM__", where PLATFORM is the name of the OS. Ideally SDL_platform.h will be able to auto-detect the system it's building on based on C preprocessor symbols. @@ -15,7 +15,9 @@ There are two basic ways of building SDL at the moment: If you have a GNUish system, then you might try this. Edit configure.in, take a look at the large section labelled: + "Set up the configuration based on the host platform!" + Add a section for your platform, and then re-run autogen.sh and build! 2. Using an IDE: @@ -27,6 +29,7 @@ There are two basic ways of building SDL at the moment: Add the top level include directory to the header search path, and then add the following sources to the project: + src/*.c src/atomic/*.c src/audio/*.c diff --git a/3rdparty/SDL2/docs/README-raspberrypi.md b/3rdparty/SDL2/docs/README-raspberrypi.md index 9ecea9afa18..9ed13a18750 100644 --- a/3rdparty/SDL2/docs/README-raspberrypi.md +++ b/3rdparty/SDL2/docs/README-raspberrypi.md @@ -39,7 +39,7 @@ will be placed in /opt/rpi-tools You'll also need a Rasbian binary image. Get it from: http://downloads.raspberrypi.org/raspbian_latest -After unzipping, you'll get file with a name like: <date>-wheezy-raspbian.img +After unzipping, you'll get file with a name like: "<date>-wheezy-raspbian.img" Let's assume the sysroot will be built in /opt/rpi-sysroot. export SYSROOT=/opt/rpi-sysroot diff --git a/3rdparty/SDL2/docs/README-touch.md b/3rdparty/SDL2/docs/README-touch.md index 20925c41fb0..b6745acd46d 100644 --- a/3rdparty/SDL2/docs/README-touch.md +++ b/3rdparty/SDL2/docs/README-touch.md @@ -42,14 +42,14 @@ Same as SDL_FINGERDOWN. =========================================================================== Functions =========================================================================== -SDL provides the ability to access the underlying Finger structures. +SDL provides the ability to access the underlying SDL_Finger structures. These structures should _never_ be modified. The following functions are included from SDL_touch.h -To get a SDL_TouchID call SDL_GetTouchDevice(index). +To get a SDL_TouchID call SDL_GetTouchDevice(int index). This returns a SDL_TouchID. -IMPORTANT: If the touch has been removed, or there is no touch with the given ID, SDL_GetTouchID will return 0. Be sure to check for this! +IMPORTANT: If the touch has been removed, or there is no touch with the given index, SDL_GetTouchDevice() will return 0. Be sure to check for this! The number of touch devices can be queried with SDL_GetNumTouchDevices(). @@ -64,13 +64,13 @@ The most common reason to access SDL_Finger is to query the fingers outside the -To get a SDL_Finger, call SDL_GetTouchFinger(touchID,index), where touchID is a SDL_TouchID, and index is the requested finger. -This returns a SDL_Finger*, or NULL if the finger does not exist, or has been removed. +To get a SDL_Finger, call SDL_GetTouchFinger(SDL_TouchID touchID, int index), where touchID is a SDL_TouchID, and index is the requested finger. +This returns a SDL_Finger *, or NULL if the finger does not exist, or has been removed. A SDL_Finger is guaranteed to be persistent for the duration of a touch, but it will be de-allocated as soon as the finger is removed. This occurs when the SDL_FINGERUP event is _added_ to the event queue, and thus _before_ the SDL_FINGERUP event is polled. As a result, be very careful to check for NULL return values. A SDL_Finger has the following fields: -* x,y,pressure: +* x, y: The current coordinates of the touch. * pressure: The pressure of the touch. diff --git a/3rdparty/SDL2/docs/README-winrt.md b/3rdparty/SDL2/docs/README-winrt.md index 741def67f3d..cccbbeaa853 100644 --- a/3rdparty/SDL2/docs/README-winrt.md +++ b/3rdparty/SDL2/docs/README-winrt.md @@ -2,11 +2,8 @@ WinRT ===== This port allows SDL applications to run on Microsoft's platforms that require -use of "Windows Runtime", aka. "WinRT", APIs. WinRT apps are currently -full-screen only, and run in what Microsoft sometimes refers to as their -"Modern" (formerly, "Metro"), environment. For Windows 8.x, Microsoft may also -refer to them as "Windows Store" apps, due to them being distributed, -primarily, via a Microsoft-run online store (of the same name). +use of "Windows Runtime", aka. "WinRT", APIs. Microsoft may, in some cases, +refer to them as either "Windows Store", or for Windows 10, "UWP" apps. Some of the operating systems that include WinRT, are: @@ -82,7 +79,9 @@ Here is a rough list of what works, and what doens't: * What partially works: * keyboard input. Most of WinRT's documented virtual keys are supported, as - well as many keys with documented hardware scancodes. + well as many keys with documented hardware scancodes. Converting + SDL_Scancodes to or from SDL_Keycodes may not work, due to missing APIs + (MapVirualKey()) in Microsoft's Windows Store / UWP APIs. * SDLmain. WinRT uses a different signature for each app's main() function. SDL-based apps that use this port must compile in SDL_winrt_main_NonXAML.cpp (in `SDL\src\main\winrt\`) directly in order for their C-style main() @@ -160,7 +159,9 @@ following, at a high-level: the linker, and will copy SDL's .dll files to your app's final output. 4. adjust your app's build settings, at minimum, telling it where to find SDL's header files. -5. add a file that contains a WinRT-appropriate main function. +5. add files that contains a WinRT-appropriate main function, along with some + data to make sure mouse-cursor-hiding (via SDL_ShowCursor(SDL_DISABLE) calls) + work properly. 6. add SDL-specific app code. 7. build and run your app. @@ -268,33 +269,27 @@ To change these settings: 10. close the dialog, saving settings, by clicking the "OK" button -### 5. Add a WinRT-appropriate main function to the app. ### +### 5. Add a WinRT-appropriate main function, and a blank-cursor image, to the app. ### -C/C++-based WinRT apps do contain a `main` function that the OS will invoke when -the app starts launching. The parameters of WinRT main functions are different -than those found on other platforms, Win32 included. SDL/WinRT provides a -platform-appropriate main function that will perform these actions, setup key -portions of the app, then invoke a classic, C/C++-style main function (that take -in "argc" and "argv" parameters). The code for this file is contained inside -SDL's source distribution, under `src/main/winrt/SDL_winrt_main_NonXAML.cpp`. -You'll need to add this file, or a copy of it, to your app's project, and make -sure it gets compiled using a Microsoft-specific set of C++ extensions called -C++/CX. +A few files should be included directly in your app's MSVC project, specifically: +1. a WinRT-appropriate main function (which is different than main() functions on + other platforms) +2. a Win32-style cursor resource, used by SDL_ShowCursor() to hide the mouse cursor + (if and when the app needs to do so). *If this cursor resource is not + included, mouse-position reporting may fail if and when the cursor is + hidden, due to possible bugs/design-oddities in Windows itself.* -**NOTE: C++/CX compilation is currently required in at least one file of your -app's project. This is to make sure that Visual C++'s linker builds a 'Windows -Metadata' file (.winmd) for your app. Not doing so can lead to build errors.** - -To include `SDL_winrt_main_NonXAML.cpp`: +To include these files: 1. right-click on your project (again, in Visual C++'s Solution Explorer), navigate to "Add", then choose "Existing Item...". -2. open `SDL_winrt_main_NonXAML.cpp`, which is found inside SDL's source - distribution, under `src/main/winrt/`. Make sure that the open-file dialog - closes, either by double-clicking on the file, or single-clicking on it and - then clicking Add. -3. right-click on the file (as listed in your project), then click on - "Properties...". +2. navigate to the directory containing SDL's source code, then into its + subdirectory, 'src/main/winrt/'. Select, then add, the following files: + - `SDL_winrt_main_NonXAML.cpp` + - `SDL2-WinRTResources.rc` + - `SDL2-WinRTResource_BlankCursor.cur` +3. right-click on the file `SDL_winrt_main_NonXAML.cpp` (as listed in your + project), then click on "Properties...". 4. in the drop-down box next to "Configuration", choose, "All Configurations" 5. in the drop-down box next to "Platform", choose, "All Platforms" 6. in the left-hand list, click on "C/C++" @@ -302,6 +297,11 @@ To include `SDL_winrt_main_NonXAML.cpp`: 8. click the OK button. This will close the dialog. +**NOTE: C++/CX compilation is currently required in at least one file of your +app's project. This is to make sure that Visual C++'s linker builds a 'Windows +Metadata' file (.winmd) for your app. Not doing so can lead to build errors.** + + ### 6. Add app code and assets ### At this point, you can add in SDL-specific source code. Be sure to include a @@ -466,3 +466,13 @@ section. /nodefaultlib:vccorlibd /nodefaultlib:msvcrtd vccorlibd.lib msvcrtd.lib + +#### Mouse-motion events fail to get sent, or SDL_GetMouseState() fails to return updated values + +This may be caused by a bug in Windows itself, whereby hiding the mouse +cursor can cause mouse-position reporting to fail. + +SDL provides a workaround for this, but it requires that an app links to a +set of Win32-style cursor image-resource files. A copy of suitable resource +files can be found in `src/main/winrt/`. Adding them to an app's Visual C++ +project file should be sufficient to get the app to use them. |