mirror of https://github.com/libsdl-org/SDL
Sync SDL3 wiki -> header
This commit is contained in:
parent
a6e52f9e48
commit
c6cad07faa
|
@ -0,0 +1,123 @@
|
|||
DirectFB
|
||||
========
|
||||
|
||||
Supports:
|
||||
|
||||
- Hardware YUV overlays
|
||||
- OpenGL - software only
|
||||
- 2D/3D accelerations (depends on directfb driver)
|
||||
- multiple displays
|
||||
- windows
|
||||
|
||||
What you need:
|
||||
|
||||
* DirectFB 1.0.1, 1.2.x, 1.3.0
|
||||
* Kernel-Framebuffer support: required: vesafb, radeonfb ....
|
||||
* Mesa 7.0.x - optional for OpenGL
|
||||
|
||||
The `/etc/directfbrc` file should contain the following lines to make
|
||||
your joystick work and avoid crashes:
|
||||
|
||||
```
|
||||
disable-module=joystick
|
||||
disable-module=cle266
|
||||
disable-module=cyber5k
|
||||
no-linux-input-grab
|
||||
```
|
||||
|
||||
To disable to use x11 backend when DISPLAY variable is found use
|
||||
|
||||
```
|
||||
export SDL_DIRECTFB_X11_CHECK=0
|
||||
```
|
||||
|
||||
To disable the use of linux input devices, i.e. multimice/multikeyboard support,
|
||||
use
|
||||
|
||||
```
|
||||
export SDL_DIRECTFB_LINUX_INPUT=0
|
||||
```
|
||||
|
||||
To use hardware accelerated YUV-overlays for YUV-textures, use:
|
||||
|
||||
```
|
||||
export SDL_DIRECTFB_YUV_DIRECT=1
|
||||
```
|
||||
|
||||
This is disabled by default. It will only support one
|
||||
YUV texture, namely the first. Every other YUV texture will be
|
||||
rendered in software.
|
||||
|
||||
In addition, you may use (directfb-1.2.x)
|
||||
|
||||
```
|
||||
export SDL_DIRECTFB_YUV_UNDERLAY=1
|
||||
```
|
||||
|
||||
to make the YUV texture an underlay. This will make the cursor to
|
||||
be shown.
|
||||
|
||||
Simple Window Manager
|
||||
=====================
|
||||
|
||||
The driver has support for a very, very basic window manager you may
|
||||
want to use when running with `wm=default`. Use
|
||||
|
||||
```
|
||||
export SDL_DIRECTFB_WM=1
|
||||
```
|
||||
|
||||
to enable basic window borders. In order to have the window title rendered,
|
||||
you need to have the following font installed:
|
||||
|
||||
```
|
||||
/usr/share/fonts/truetype/freefont/FreeSans.ttf
|
||||
```
|
||||
|
||||
OpenGL Support
|
||||
==============
|
||||
|
||||
The following instructions will give you *software* OpenGL. However this
|
||||
works at least on all directfb supported platforms.
|
||||
|
||||
As of this writing 20100802 you need to pull Mesa from git and do the following:
|
||||
|
||||
```
|
||||
git clone git://anongit.freedesktop.org/git/mesa/mesa
|
||||
cd mesa
|
||||
git checkout 2c9fdaf7292423c157fc79b5ce43f0f199dd753a
|
||||
```
|
||||
|
||||
Edit `configs/linux-directfb` so that the Directories-section looks like this:
|
||||
|
||||
```
|
||||
# Directories
|
||||
SRC_DIRS = mesa glu
|
||||
GLU_DIRS = sgi
|
||||
DRIVER_DIRS = directfb
|
||||
PROGRAM_DIRS =
|
||||
```
|
||||
|
||||
Then do the following:
|
||||
|
||||
```
|
||||
make linux-directfb
|
||||
make
|
||||
|
||||
echo Installing - please enter sudo pw.
|
||||
|
||||
sudo make install INSTALL_DIR=/usr/local/dfb_GL
|
||||
cd src/mesa/drivers/directfb
|
||||
make
|
||||
sudo make install INSTALL_DIR=/usr/local/dfb_GL
|
||||
```
|
||||
|
||||
To run the SDL - testprograms:
|
||||
|
||||
```
|
||||
export SDL_VIDEODRIVER=directfb
|
||||
export LD_LIBRARY_PATH=/usr/local/dfb_GL/lib
|
||||
export LD_PRELOAD=/usr/local/dfb_GL/libGL.so.7
|
||||
|
||||
./testgl
|
||||
```
|
|
@ -0,0 +1,71 @@
|
|||
Dollar Gestures
|
||||
===========================================================================
|
||||
SDL provides an implementation of the $1 gesture recognition system. This allows for recording, saving, loading, and performing single stroke gestures.
|
||||
|
||||
Gestures can be performed with any number of fingers (the centroid of the fingers must follow the path of the gesture), but the number of fingers must be constant (a finger cannot go down in the middle of a gesture). The path of a gesture is considered the path from the time when the final finger went down, to the first time any finger comes up.
|
||||
|
||||
Dollar gestures are assigned an Id based on a hash function. This is guaranteed to remain constant for a given gesture. There is a (small) chance that two different gestures will be assigned the same ID. In this case, simply re-recording one of the gestures should result in a different ID.
|
||||
|
||||
Recording:
|
||||
----------
|
||||
To begin recording on a touch device call:
|
||||
SDL_RecordGesture(SDL_TouchID touchId), where touchId is the id of the touch device you wish to record on, or -1 to record on all connected devices.
|
||||
|
||||
Recording terminates as soon as a finger comes up. Recording is acknowledged by an SDL_DOLLARRECORD event.
|
||||
A SDL_DOLLARRECORD event is a dgesture with the following fields:
|
||||
|
||||
* event.dgesture.touchId - the Id of the touch used to record the gesture.
|
||||
* event.dgesture.gestureId - the unique id of the recorded gesture.
|
||||
|
||||
|
||||
Performing:
|
||||
-----------
|
||||
As long as there is a dollar gesture assigned to a touch, every finger-up event will also cause an SDL_DOLLARGESTURE event with the following fields:
|
||||
|
||||
* event.dgesture.touchId - the Id of the touch which performed the gesture.
|
||||
* event.dgesture.gestureId - the unique id of the closest gesture to the performed stroke.
|
||||
* event.dgesture.error - the difference between the gesture template and the actual performed gesture. Lower error is a better match.
|
||||
* event.dgesture.numFingers - the number of fingers used to draw the stroke.
|
||||
|
||||
Most programs will want to define an appropriate error threshold and check to be sure that the error of a gesture is not abnormally high (an indicator that no gesture was performed).
|
||||
|
||||
|
||||
|
||||
Saving:
|
||||
-------
|
||||
To save a template, call SDL_SaveDollarTemplate(gestureId, dst) where gestureId is the id of the gesture you want to save, and dst is an SDL_RWops pointer to the file where the gesture will be stored.
|
||||
|
||||
To save all currently loaded templates, call SDL_SaveAllDollarTemplates(dst) where dst is an SDL_RWops pointer to the file where the gesture will be stored.
|
||||
|
||||
Both functions return the number of gestures successfully saved.
|
||||
|
||||
|
||||
Loading:
|
||||
--------
|
||||
To load templates from a file, call SDL_LoadDollarTemplates(touchId,src) where touchId is the id of the touch to load to (or -1 to load to all touch devices), and src is an SDL_RWops pointer to a gesture save file.
|
||||
|
||||
SDL_LoadDollarTemplates returns the number of templates successfully loaded.
|
||||
|
||||
|
||||
|
||||
===========================================================================
|
||||
Multi Gestures
|
||||
===========================================================================
|
||||
SDL provides simple support for pinch/rotate/swipe gestures.
|
||||
Every time a finger is moved an SDL_MULTIGESTURE event is sent with the following fields:
|
||||
|
||||
* event.mgesture.touchId - the Id of the touch on which the gesture was performed.
|
||||
* event.mgesture.x - the normalized x coordinate of the gesture. (0..1)
|
||||
* event.mgesture.y - the normalized y coordinate of the gesture. (0..1)
|
||||
* event.mgesture.dTheta - the amount that the fingers rotated during this motion.
|
||||
* event.mgesture.dDist - the amount that the fingers pinched during this motion.
|
||||
* event.mgesture.numFingers - the number of fingers used in the gesture.
|
||||
|
||||
|
||||
===========================================================================
|
||||
Notes
|
||||
===========================================================================
|
||||
For a complete example see test/testgesture.c
|
||||
|
||||
Please direct questions/comments to:
|
||||
jim.tla+sdl_touch@gmail.com
|
|
@ -0,0 +1,103 @@
|
|||
Native Client
|
||||
================================================================================
|
||||
|
||||
Requirements:
|
||||
|
||||
* Native Client SDK (https://developer.chrome.com/native-client),
|
||||
(tested with Pepper version 33 or higher).
|
||||
|
||||
The SDL backend for Chrome's Native Client has been tested only with the PNaCl
|
||||
toolchain, which generates binaries designed to run on ARM and x86_32/64
|
||||
platforms. This does not mean it won't work with the other toolchains!
|
||||
|
||||
================================================================================
|
||||
Building SDL for NaCl
|
||||
================================================================================
|
||||
|
||||
Set up the right environment variables (see naclbuild.sh), then configure SDL with:
|
||||
|
||||
configure --host=pnacl --prefix some/install/destination
|
||||
|
||||
Then "make".
|
||||
|
||||
As an example of how to create a deployable app a Makefile project is provided
|
||||
in test/nacl/Makefile, which includes some monkey patching of the common.mk file
|
||||
provided by NaCl, without which linking properly to SDL won't work (the search
|
||||
path can't be modified externally, so the linker won't find SDL's binaries unless
|
||||
you dump them into the SDK path, which is inconvenient).
|
||||
Also provided in test/nacl is the required support file, such as index.html,
|
||||
manifest.json, etc.
|
||||
SDL apps for NaCl run on a worker thread using the ppapi_simple infrastructure.
|
||||
This allows for blocking calls on all the relevant systems (OpenGL ES, filesystem),
|
||||
hiding the asynchronous nature of the browser behind the scenes...which is not the
|
||||
same as making it disappear!
|
||||
|
||||
|
||||
================================================================================
|
||||
Running tests
|
||||
================================================================================
|
||||
|
||||
Due to the nature of NaCl programs, building and running SDL tests is not as
|
||||
straightforward as one would hope. The script naclbuild.sh in build-scripts
|
||||
automates the process and should serve as a guide for users of SDL trying to build
|
||||
their own applications.
|
||||
|
||||
Basic usage:
|
||||
|
||||
./naclbuild.sh path/to/pepper/toolchain (i.e. ~/naclsdk/pepper_35)
|
||||
|
||||
This will build testgles2.c by default.
|
||||
|
||||
If you want to build a different test, for example testrendercopyex.c:
|
||||
|
||||
SOURCES=~/sdl/SDL/test/testrendercopyex.c ./naclbuild.sh ~/naclsdk/pepper_35
|
||||
|
||||
Once the build finishes, you have to serve the contents with a web server (the
|
||||
script will give you instructions on how to do that with Python).
|
||||
|
||||
================================================================================
|
||||
RWops and nacl_io
|
||||
================================================================================
|
||||
|
||||
SDL_RWops work transparently with nacl_io. Two functions control the mount points:
|
||||
|
||||
int mount(const char* source, const char* target,
|
||||
const char* filesystemtype,
|
||||
unsigned long mountflags, const void *data);
|
||||
int umount(const char *target);
|
||||
|
||||
For convenience, SDL will by default mount an httpfs tree at / before calling
|
||||
the app's main function. Such setting can be overridden by calling:
|
||||
|
||||
umount("/");
|
||||
|
||||
And then mounting a different filesystem at /
|
||||
|
||||
It's important to consider that the asynchronous nature of file operations on a
|
||||
browser is hidden from the application, effectively providing the developer with
|
||||
a set of blocking file operations just like you get in a regular desktop
|
||||
environment, which eases the job of porting to Native Client, but also introduces
|
||||
a set of challenges of its own, in particular when big file sizes and slow
|
||||
connections are involved.
|
||||
|
||||
For more information on how nacl_io and mount points work, see:
|
||||
|
||||
https://developer.chrome.com/native-client/devguide/coding/nacl_io
|
||||
https://src.chromium.org/chrome/trunk/src/native_client_sdk/src/libraries/nacl_io/nacl_io.h
|
||||
|
||||
To be able to save into the directory "/save/" (like backup of game) :
|
||||
|
||||
mount("", "/save", "html5fs", 0, "type=PERSISTENT");
|
||||
|
||||
And add to manifest.json :
|
||||
|
||||
"permissions": [
|
||||
"unlimitedStorage"
|
||||
]
|
||||
|
||||
================================================================================
|
||||
TODO - Known Issues
|
||||
================================================================================
|
||||
* Testing of all systems with a real application (something other than SDL's tests)
|
||||
* Key events don't seem to work properly
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
Simple DirectMedia Layer 2 for OS/2 & eComStation
|
||||
================================================================================
|
||||
SDL port for OS/2, authored by Andrey Vasilkin <digi@os2.snc.ru>, 2016
|
||||
|
||||
|
||||
OpenGL and audio capture not supported by this port.
|
||||
|
||||
Additional optional environment variables:
|
||||
|
||||
SDL_AUDIO_SHARE
|
||||
Values: 0 or 1, default is 0
|
||||
Initializes the device as shareable or exclusively acquired.
|
||||
|
||||
SDL_VIDEODRIVER
|
||||
Values: DIVE or VMAN, default is DIVE
|
||||
Use video subsystem: Direct interface video extensions (DIVE) or
|
||||
Video Manager (VMAN).
|
||||
|
||||
You may significantly increase video output speed with OS4 kernel and patched
|
||||
files vman.dll and dive.dll or with latest versions of ACPI support and video
|
||||
driver Panorama.
|
||||
|
||||
Latest versions of OS/4 kernel:
|
||||
http://gus.biysk.ru/os4/
|
||||
(Info: https://www.os2world.com/wiki/index.php/Phoenix_OS/4)
|
||||
|
||||
Patched files vman.dll and dive.dll:
|
||||
http://gus.biysk.ru/os4/test/pached_dll/PATCHED_DLL.RAR
|
||||
|
||||
|
||||
Compiling:
|
||||
----------
|
||||
|
||||
Open Watcom 1.9 or newer is tested. For the new Open Watcom V2 fork, see:
|
||||
https://github.com/open-watcom/ and https://open-watcom.github.io
|
||||
WATCOM environment variable must to be set to the Open Watcom install
|
||||
directory. To compile, run: wmake -f Makefile.os2
|
||||
|
||||
|
||||
Installing:
|
||||
-----------
|
||||
|
||||
- eComStation:
|
||||
|
||||
If you have previously installed SDL2, make a Backup copy of SDL2.dll
|
||||
located in D:\ecs\dll (where D: is disk on which installed eComStation).
|
||||
Stop all programs running with SDL2. Copy SDL2.dll to D:\ecs\dll
|
||||
|
||||
- OS/2:
|
||||
|
||||
Copy SDL2.dll to any directory on your LIBPATH. If you have a previous
|
||||
version installed, close all SDL2 applications before replacing the old
|
||||
copy. Also make sure that any other older versions of DLLs are removed
|
||||
from your system.
|
||||
|
||||
|
||||
Joysticks in SDL2:
|
||||
------------------
|
||||
|
||||
The joystick code in SDL2 is a direct forward-port from the SDL-1.2 version.
|
||||
Here is the original documentation from SDL-1.2:
|
||||
|
||||
The Joystick detection only works for standard joysticks (2 buttons, 2 axes
|
||||
and the like). Therefore, if you use a non-standard joystick, you should
|
||||
specify its features in the SDL_OS2_JOYSTICK environment variable in a batch
|
||||
file or CONFIG.SYS, so SDL applications can provide full capability to your
|
||||
device. The syntax is:
|
||||
|
||||
SET SDL_OS2_JOYSTICK=[JOYSTICK_NAME] [AXES] [BUTTONS] [HATS] [BALLS]
|
||||
|
||||
So, it you have a Gravis GamePad with 4 axes, 2 buttons, 2 hats and 0 balls,
|
||||
the line should be:
|
||||
|
||||
SET SDL_OS2_JOYSTICK=Gravis_GamePad 4 2 2 0
|
||||
|
||||
If you want to add spaces in your joystick name, just surround it with
|
||||
quotes or double-quotes:
|
||||
|
||||
SET SDL_OS2_JOYSTICK='Gravis GamePad' 4 2 2 0
|
||||
|
||||
or
|
||||
|
||||
SET SDL_OS2_JOYSTICK="Gravis GamePad" 4 2 2 0
|
||||
|
||||
Note however that Balls and Hats are not supported under OS/2, and the
|
||||
value will be ignored... but it is wise to define these correctly because
|
||||
in the future those can be supported.
|
||||
|
||||
Also the number of buttons is limited to 2 when using two joysticks,
|
||||
4 when using one joystick with 4 axes, 6 when using a joystick with 3 axes
|
||||
and 8 when using a joystick with 2 axes. Notice however these are limitations
|
||||
of the Joystick Port hardware, not OS/2.
|
|
@ -0,0 +1,17 @@
|
|||
Pandora
|
||||
=====================================================================
|
||||
|
||||
( http://openpandora.org/ )
|
||||
- A pandora specific video driver was written to allow SDL 2.0 with OpenGL ES
|
||||
support to work on the pandora under the framebuffer. This driver do not have
|
||||
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
|
||||
the framebuffer, try to set the following variable before starting your application :
|
||||
"export SDL_VIDEODRIVER=pandora"
|
||||
|
||||
- OpenGL ES support was added to the x11 driver, so it's working like the normal
|
||||
x11 driver one with OpenGLX support, with SDL input event's etc..
|
||||
|
||||
|
||||
David Carré (Cpasjuste)
|
||||
cpasjuste@gmail.com
|
|
@ -0,0 +1,10 @@
|
|||
WinCE
|
||||
=====
|
||||
|
||||
Windows CE is no longer supported by SDL.
|
||||
|
||||
We have left the CE support in SDL 1.2 for those that must have it, and we
|
||||
have support for Windows Phone 8 and WinRT in SDL2, as of SDL 2.0.3.
|
||||
|
||||
--ryan.
|
||||
|
Loading…
Reference in New Issue