Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 21-installer-nodd
  • 2210-pre1
  • 2210-pre2
  • 2210-rc1
  • 2210-rc2
  • 2210-rc3
  • 2211-pre1
  • 2211-pre2
  • 2211-rc1
  • 2212-pre1
  • 2212-pre2
  • 2212-pre3
  • 2212-rc1
  • 2213
  • 2214-pre1
  • 2214-pre2
  • 2214-pre3
  • 2214-pre4
  • 2_2_12
  • 64-gl-log
  • COM_ImmedExecute-lua
  • DJGPP
  • accel-momentum
  • acs
  • action-args
  • alpha-fixes
  • any-resolution
  • appveyor
  • better-distance-math
  • blend-locking
  • blentran
  • blua-unary-not-fix
  • boost-tickrate
  • bustablesoundz
  • cleanup-opengl
  • cleanupmusic
  • clipmidtex
  • cmake-valgrind
  • crawlacommander-sprites
  • custom-map-names
  • custom-teams
  • cutscene-cleanup
  • dd-music-bypass
  • dd-music-fix
  • delfile2
  • deprecate-lua-dedicated-server
  • dpl-2
  • dropshadows-spawning
  • dynabsp
  • emblem-drawing
  • exchndl-xp-fix
  • extra-textures
  • few-kart-lua-changes
  • ffloorclip
  • fix-167
  • fix-cvar-conflicts
  • fix-opengl-parameter-crash
  • fix-opengl-shear-roll
  • flipfuncpointers
  • fof-lightlist-fixes
  • font-FUCK
  • frictionrefactor
  • fuck-macros-1
  • gamepad-luakeydown
  • gamepad-morefixes
  • gamepad_experiments
  • gametype-refactor
  • gametype-refactor-1
  • gametype-refactor-player-spawns
  • ghost-networking
  • gif-splitting
  • grr-lj
  • hitboxviewer
  • hwr-texture-cache-refactor
  • hwrender2
  • improve-439
  • increase-maxconditionsets
  • increase-packet-tics
  • input-display
  • input-display-translucency
  • io
  • joystick-juggling-maz
  • just-in-case
  • keycodes-only
  • ksf-wadfiles
  • ld413-mp-fix
  • levelstruct
  • libpng-version-support
  • linedef-actions
  • lj-test
  • lol-states
  • loopedsounds
  • lower-unpegged-fix
  • lua-change-gametype
  • lua-command-netids
  • lua-gfx-2
  • lua-gfx-sprites
  • lua-local
  • makefile-auto-mingw-gcc
  • makefile-tinkering
  • SRB2_release_2.1
  • SRB2_release_2.1.1
  • SRB2_release_2.1.10
  • SRB2_release_2.1.11
  • SRB2_release_2.1.12
  • SRB2_release_2.1.14
  • SRB2_release_2.1.15
  • SRB2_release_2.1.16
  • SRB2_release_2.1.16a
  • SRB2_release_2.1.17
  • SRB2_release_2.1.18
  • SRB2_release_2.1.19
  • SRB2_release_2.1.2
  • SRB2_release_2.1.20
  • SRB2_release_2.1.21
  • SRB2_release_2.1.22
  • SRB2_release_2.1.23
  • SRB2_release_2.1.24
  • SRB2_release_2.1.25
  • SRB2_release_2.1.3
  • SRB2_release_2.1.4
  • SRB2_release_2.1.5
  • SRB2_release_2.1.6
  • SRB2_release_2.1.7
  • SRB2_release_2.1.8
  • SRB2_release_2.1.9
  • SRB2_release_2.2.0
  • SRB2_release_2.2.1
  • SRB2_release_2.2.10
  • SRB2_release_2.2.11
  • SRB2_release_2.2.12
  • SRB2_release_2.2.13
  • SRB2_release_2.2.15
  • SRB2_release_2.2.2
  • SRB2_release_2.2.3
  • SRB2_release_2.2.4
  • SRB2_release_2.2.5
  • SRB2_release_2.2.6
  • SRB2_release_2.2.7
  • SRB2_release_2.2.8
  • SRB2_release_2.2.9
  • td-release-v1.0.0
142 results

Target

Select target project
  • STJr/SRB2
  • Sryder/SRB2
  • wolfy852/SRB2
  • Alpha2244/SRB2
  • Inuyasha/SRB2
  • yoshibot/SRB2
  • TehRealSalt/SRB2
  • PrisimaTF/SRB2
  • Hatninja/SRB2
  • SteelT/SRB2
  • james/SRB2
  • ShaderWraith/SRB2
  • SinnamonLat/SRB2
  • mazmazz_/SRB2
  • filpAM/SRB2
  • chaoloveicemdboy/SRB2
  • Whooa21/SRB2
  • Machturne/SRB2
  • Golden/SRB2
  • Tatsuru/SRB2
  • Snu/SRB2
  • Zwip-Zwap_Zapony/SRB2
  • fickleheart/SRB2
  • alphaRexJames/SRB2
  • JJK/SRB2
  • diskpoppy/SRB2
  • Hannu_Hanhi/SRB2
  • ZipperQR/SRB2
  • kays/SRB2
  • spherallic/SRB2
  • Zippy_Zolton/SRB2
  • namiishere/SRB2
  • Ors/SRB2
  • SMS_Alfredo/SRB2
  • sonic_edge/SRB2
  • lavla/SRB2
  • ashi/SRB2
  • X.organic/SRB2
  • Fafabis/SRB2
  • Meziu/SRB2
  • v-rob/SRB2
  • tertu/SRB2
  • bitten2up/SRB2
  • flarn2006/SRB2
  • Krabs/SRB2
  • clairebun/SRB2
  • Lactozilla/SRB2
  • thehackstack/SRB2
  • Spice/SRB2
  • win8linux/SRB2
  • JohnFrostFox/SRB2
  • talktoneon726/SRB2
  • Wane/SRB2
  • Lamibe/SRB2
  • spectrumuk2/srb-2
  • nerdyminer18/srb-2
  • 256nil/SRB2
  • ARJr/SRB2
  • Alam/SRB2
  • Zenya/srb-2-marathon-demos
  • Acelite/srb-2-archivedmodifications
  • MIDIMan/SRB2
  • Lach/SRB2
  • Frostiikin/bounce-tweaks
  • Jaden/SRB2
  • Tyron/SRB2
  • Astronight/SRB2
  • Mari0shi06/SRB2
  • aiire/SRB2
  • Galactice/SRB2
  • srb2-ports/srb2-dreamcast
  • sdasdas/SRB2
  • chreas/srb-2-vr
  • StarManiaKG/the-story-of-sinically-rocketing-and-botching-the-2nd
  • LoganAir/SRB2
  • NepDisk/srb-2
  • alufolie91/SRB2
  • Felicia.iso/SRB2
  • twi/SRB2
  • BarrelsOFun/SRB2
  • Speed2411/SRB2
  • Leather_Realms/SRB2
  • Ayemar/SRB2
  • Acelite/SRB2
  • VladDoc/SRB2
  • kaldrum/model-features
  • strawberryfox417/SRB2
  • Lugent/SRB2
  • Rem/SRB2
  • Refrag/SRB2
  • Henry_3230/srb-3230
  • TehPuertoRicanSpartan2/tprs-srb2
  • Leminn/srb-2-marathon-stuff
  • chromaticpipe2/SRB2
  • MiguelGustavo15/SRB2
  • Maru/srb-2-tests
  • SilicDev/SRB2
  • UnmatchedBracket/SRB2
  • HybridDog/SRB2
  • xordspar0/SRB2
  • jsjhbewfhh/SRB2
  • Fancy2209/SRB2
  • Lorsoen/SRB2
  • shindoukin/SRB2
  • GamerOfDays/SRB2
  • Craftyawesome/SRB2
  • tenshi-tensai-tennoji/SRB2
  • Scarfdudebalder/SRB2
  • luigi-budd/srb-2-fix-interplag-lockon
  • mskluesner/SRB2
  • johnpetersa19/SRB2
  • Pheazant/SRB2
  • chromaticpipe2/srb2classic
  • romoney5/SRB2
  • PAS/SRB2Classic
  • BlueStaggo/SRB2
  • Jisk/srb-2-beef-jerky
  • voltybystorm/SRB2
  • ZenithNeko/srb-2-xp
  • Nep2Disk/SRB2
  • Cloudeon/SRB2
121 results
Select Git revision
  • 22_drawindex
  • 22_io
  • DJGPP
  • SRB2-CHAT
  • angles
  • appveyor
  • automap-fix
  • cleanup-opengl
  • cmake-use-internal-libs
  • drawscaledpatch-solid
  • fof-slope-skew-backport
  • gamepad_experiments
  • io
  • jimita-shaders-modifs
  • kart-net-improvements-port
  • libpng-version-support
  • lower-unpegged-fix
  • lua-hudlib-addition
  • lua-slopes
  • map-components-signedness-fixes
  • master
  • mp-menu-playername-fix
  • next
  • ogl-fof-slope-skewing-jfif
  • opengl-projectsprite-fix
  • parser-fixes
  • public_flatsprite
  • reduced_palette
  • srb2p_22
  • srb2p_22-moreskins
  • srb2p_22-next
  • srb2p_22_12
  • srb2p_22_13beta
  • srb2p_22_uncapped
  • srb2persona-main
  • thokker
  • thokker_next
  • thokker_rebase
  • timer_sdl2
  • toast_fixes
  • SRB2P-exe-1.3.5
  • SRB2P-exe-1.3.6
  • SRB2_release_2.1
  • SRB2_release_2.1.1
  • SRB2_release_2.1.10
  • SRB2_release_2.1.11
  • SRB2_release_2.1.12
  • SRB2_release_2.1.14
  • SRB2_release_2.1.15
  • SRB2_release_2.1.16
  • SRB2_release_2.1.16a
  • SRB2_release_2.1.17
  • SRB2_release_2.1.18
  • SRB2_release_2.1.19
  • SRB2_release_2.1.2
  • SRB2_release_2.1.20
  • SRB2_release_2.1.3
  • SRB2_release_2.1.4
  • SRB2_release_2.1.5
  • SRB2_release_2.1.6
  • SRB2_release_2.1.7
  • SRB2_release_2.1.8
  • SRB2_release_2.1.9
  • td-release-v1.0.0
64 results
Show changes
Showing
with 860 additions and 260 deletions
Nokia N-Gage
============
SDL2 port for Symbian S60v1 and v2 with a main focus on the Nokia N-Gage
(Classic and QD) by [Michael Fitzmayer](https://github.com/mupfdev).
Compiling
---------
SDL is part of the [N-Gage SDK.](https://github.com/ngagesdk) project.
The library is included in the
[toolchain](https://github.com/ngagesdk/ngage-toolchain) as a
sub-module.
A complete example project based on SDL2 can be found in the GitHub
account of the SDK: [Wordle](https://github.com/ngagesdk/wordle).
Current level of implementation
-------------------------------
The video driver currently provides full screen video support with
keyboard input.
At the moment only the software renderer works.
Audio is not yet implemented.
Acknowledgements
----------------
Thanks to Hannu Viitala, Kimmo Kinnunen and Markus Mertama for the
valuable insight into Symbian programming. Without the SDL 1.2 port
which was specially developed for CDoom (Doom for the Nokia 9210), this
adaptation would not have been possible.
I would like to thank my friends
[Razvan](https://twitter.com/bewarerazvan) and [Dan
Whelan](https://danwhelan.ie/), for their continuous support. Without
you and the [N-Gage community](https://discord.gg/dbUzqJ26vs), I would
have lost my patience long ago.
Last but not least, I would like to thank the development team of
[EKA2L1](https://12z1.com/) (an experimental Symbian OS emulator). Your
patience and support in troubleshooting helped me a lot.
Simple DirectMedia Layer 2 for OS/2 & eComStation
================================================================================
SDL port for OS/2, authored by Andrey Vasilkin <digi@os2.snc.ru>, 2016
OpenGL 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.
...@@ -13,7 +13,7 @@ There are two basic ways of building SDL at the moment: ...@@ -13,7 +13,7 @@ There are two basic ways of building SDL at the moment:
1. The "UNIX" way: ./configure; make; make install 1. The "UNIX" way: ./configure; make; make install
If you have a GNUish system, then you might try this. Edit configure.in, If you have a GNUish system, then you might try this. Edit configure.ac,
take a look at the large section labelled: take a look at the large section labelled:
"Set up the configuration based on the host platform!" "Set up the configuration based on the host platform!"
......
PS2
======
SDL2 port for the Sony Playstation 2 contributed by:
- Francisco Javier Trujillo Mata
Credit to
- The guys that ported SDL to PSP & Vita because I'm taking them as reference.
- David G. F. for helping me with several issues and tests.
## Building
To build SDL2 library for the PS2, make sure you have the latest PS2Dev status and run:
```bash
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$PS2DEV/ps2sdk/ps2dev.cmake
cmake --build build
cmake --install build
```
## Hints
The PS2 port has a special Hint for having a dynamic VSYNC. The Hint is `SDL_HINT_PS2_DYNAMIC_VSYNC`.
If you enabled the dynamic vsync having as well `SDL_RENDERER_PRESENTVSYNC` enabled, then if the app is not able to run at 60 FPS, automatically the `vsync` will be disabled having a better performance, instead of droping FPS to 30.
## Notes
If you trying to debug a SDL app through [ps2client](https://github.com/ps2dev/ps2client) you need to avoid the IOP reset, otherwise you will lose the conection with your computer.
So to avoid the reset of the IOP CPU, you need to call to the macro `SDL_PS2_SKIP_IOP_RESET();`.
It could be something similar as:
```c
.....
SDL_PS2_SKIP_IOP_RESET();
int main(int argc, char *argv[])
{
.....
```
For a release binary is recommendable to reset the IOP always.
Remember to do a clean compilation everytime you enable or disable the `SDL_PS2_SKIP_IOP_RESET` otherwise the change won't be reflected.
## Getting PS2 Dev
[Installing PS2 Dev](https://github.com/ps2dev/ps2dev)
## Running on PCSX2 Emulator
[PCSX2](https://github.com/PCSX2/pcsx2)
[More PCSX2 information](https://pcsx2.net/)
## To Do
- PS2 Screen Keyboard
- Dialogs
- Others
PSP PSP
====== ======
SDL port for the Sony PSP contributed by SDL2 port for the Sony PSP contributed by:
Captian Lex - Captian Lex
- Francisco Javier Trujillo Mata
- Wouter Wijsman
Credit to Credit to
Marcus R.Brown,Jim Paris,Matthew H for the original SDL 1.2 for PSP Marcus R.Brown,Jim Paris,Matthew H for the original SDL 1.2 for PSP
Geecko for his PSP GU lib "Glib2d" Geecko for his PSP GU lib "Glib2d"
Building ## Building
-------- To build SDL2 library for the PSP, make sure you have the latest PSPDev status and run:
To build for the PSP, make sure psp-config is in the path and run: ```bash
make -f Makefile.psp cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake
cmake --build build
cmake --install build
```
## Getting PSP Dev
[Installing PSP Dev](https://github.com/pspdev/pspdev)
## Running on PPSSPP Emulator
[PPSSPP](https://github.com/hrydgard/ppsspp)
[Build Instructions](https://github.com/hrydgard/ppsspp/wiki/Build-instructions)
## Compiling a HelloWorld
[PSP Hello World](https://psp-dev.org/doku.php?id=tutorial:hello_world)
To Do ## To Do
------ - PSP Screen Keyboard
PSP Screen Keyboard - Dialogs
Raspberry Pi Raspberry Pi
================================================================================ ============
Requirements: Requirements:
Raspbian (other Linux distros may work as well). Raspbian (other Linux distros may work as well).
================================================================================
Features Features
================================================================================ --------
* Works without X11 * Works without X11
* Hardware accelerated OpenGL ES 2.x * Hardware accelerated OpenGL ES 2.x
...@@ -16,9 +15,8 @@ Raspbian (other Linux distros may work as well). ...@@ -16,9 +15,8 @@ Raspbian (other Linux distros may work as well).
* Hotplugging of input devices via UDEV * Hotplugging of input devices via UDEV
================================================================================
Raspbian Build Dependencies Raspbian Build Dependencies
================================================================================ ---------------------------
sudo apt-get install libudev-dev libasound2-dev libdbus-1-dev sudo apt-get install libudev-dev libasound2-dev libdbus-1-dev
...@@ -27,9 +25,18 @@ OpenGL ES 2.x, it usually comes pre-installed, but in any case: ...@@ -27,9 +25,18 @@ OpenGL ES 2.x, it usually comes pre-installed, but in any case:
sudo apt-get install libraspberrypi0 libraspberrypi-bin libraspberrypi-dev sudo apt-get install libraspberrypi0 libraspberrypi-bin libraspberrypi-dev
================================================================================
NEON
----
If your Pi has NEON support, make sure you add -mfpu=neon to your CFLAGS so
that SDL will select some otherwise-disabled highly-optimized code. The
original Pi units don't have NEON, the Pi2 probably does, and the Pi3
definitely does.
Cross compiling from x86 Linux Cross compiling from x86 Linux
================================================================================ ------------------------------
To cross compile SDL for Raspbian from your desktop machine, you'll need a To cross compile SDL for Raspbian from your desktop machine, you'll need a
Raspbian system root and the cross compilation tools. We'll assume these tools Raspbian system root and the cross compilation tools. We'll assume these tools
...@@ -56,7 +63,7 @@ Now, before chrooting into the ARM sysroot, you'll need to apply a workaround, ...@@ -56,7 +63,7 @@ Now, before chrooting into the ARM sysroot, you'll need to apply a workaround,
edit $SYSROOT/etc/ld.so.preload and comment out all lines in it. edit $SYSROOT/etc/ld.so.preload and comment out all lines in it.
sudo chroot $SYSROOT sudo chroot $SYSROOT
apt-get install libudev-dev libasound2-dev libdbus-1-dev libraspberrypi0 libraspberrypi-bin libraspberrypi-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxxf86vm-dev libxss-dev apt-get install libudev-dev libasound2-dev libdbus-1-dev libraspberrypi0 libraspberrypi-bin libraspberrypi-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxss-dev
exit exit
sudo umount $SYSROOT/dev sudo umount $SYSROOT/dev
sudo umount $SYSROOT/proc sudo umount $SYSROOT/proc
...@@ -82,9 +89,8 @@ To be able to deploy this to /usr/local in the Raspbian system you need to fix u ...@@ -82,9 +89,8 @@ To be able to deploy this to /usr/local in the Raspbian system you need to fix u
perl -w -pi -e "s#$PWD/rpi-sdl2-installed#/usr/local#g;" ./rpi-sdl2-installed/lib/libSDL2.la ./rpi-sdl2-installed/lib/pkgconfig/sdl2.pc ./rpi-sdl2-installed/bin/sdl2-config perl -w -pi -e "s#$PWD/rpi-sdl2-installed#/usr/local#g;" ./rpi-sdl2-installed/lib/libSDL2.la ./rpi-sdl2-installed/lib/pkgconfig/sdl2.pc ./rpi-sdl2-installed/bin/sdl2-config
================================================================================
Apps don't work or poor video/audio performance Apps don't work or poor video/audio performance
================================================================================ -----------------------------------------------
If you get sound problems, buffer underruns, etc, run "sudo rpi-update" to If you get sound problems, buffer underruns, etc, run "sudo rpi-update" to
update the RPi's firmware. Note that doing so will fix these problems, but it update the RPi's firmware. Note that doing so will fix these problems, but it
...@@ -98,17 +104,15 @@ See here how to configure this setting: http://elinux.org/RPiconfig ...@@ -98,17 +104,15 @@ See here how to configure this setting: http://elinux.org/RPiconfig
Using a fixed gpu_mem=128 is the best option (specially if you updated the Using a fixed gpu_mem=128 is the best option (specially if you updated the
firmware, using CMA probably won't work, at least it's the current case). firmware, using CMA probably won't work, at least it's the current case).
================================================================================
No input No input
================================================================================ --------
Make sure you belong to the "input" group. Make sure you belong to the "input" group.
sudo usermod -aG input `whoami` sudo usermod -aG input `whoami`
================================================================================
No HDMI Audio No HDMI Audio
================================================================================ -------------
If you notice that ALSA works but there's no audio over HDMI, try adding: If you notice that ALSA works but there's no audio over HDMI, try adding:
...@@ -118,9 +122,8 @@ to your config.txt file and reboot. ...@@ -118,9 +122,8 @@ to your config.txt file and reboot.
Reference: http://www.raspberrypi.org/phpBB3/viewtopic.php?t=5062 Reference: http://www.raspberrypi.org/phpBB3/viewtopic.php?t=5062
================================================================================
Text Input API support Text Input API support
================================================================================ ----------------------
The Text Input API is supported, with translation of scan codes done via the The Text Input API is supported, with translation of scan codes done via the
kernel symbol tables. For this to work, SDL needs access to a valid console. kernel symbol tables. For this to work, SDL needs access to a valid console.
...@@ -150,9 +153,9 @@ this determining the CAPS LOCK behavior: ...@@ -150,9 +153,9 @@ this determining the CAPS LOCK behavior:
sudo dpkg-reconfigure locales sudo dpkg-reconfigure locales
================================================================================
OpenGL problems OpenGL problems
================================================================================ ---------------
If you have desktop OpenGL headers installed at build time in your RPi or cross If you have desktop OpenGL headers installed at build time in your RPi or cross
compilation environment, support for it will be built in. However, the chipset compilation environment, support for it will be built in. However, the chipset
...@@ -167,9 +170,8 @@ environment variable: ...@@ -167,9 +170,8 @@ environment variable:
export SDL_RENDER_DRIVER=opengles2 export SDL_RENDER_DRIVER=opengles2
================================================================================
Notes Notes
================================================================================ -----
* When launching apps remotely (via SSH), SDL can prevent local keystrokes from * When launching apps remotely (via SSH), SDL can prevent local keystrokes from
leaking into the console only if it has root privileges. Launching apps locally leaking into the console only if it has root privileges. Launching apps locally
......
RISC OS
=======
Requirements:
* RISC OS 3.5 or later.
* [SharedUnixLibrary](http://www.riscos.info/packages/LibraryDetails.html#SharedUnixLibraryarm).
* [DigitalRenderer](http://www.riscos.info/packages/LibraryDetails.html#DRendererarm), for audio support.
* [Iconv](http://www.netsurf-browser.org/projects/iconv/), for `SDL_iconv` and related functions.
Compiling:
----------
Currently, SDL2 for RISC OS only supports compiling with GCCSDK under Linux. Both the autoconf and CMake build systems are supported.
The following commands can be used to build SDL2 for RISC OS using autoconf:
./configure --host=arm-unknown-riscos --prefix=$GCCSDK_INSTALL_ENV --disable-gcc-atomics
make
make install
The following commands can be used to build SDL2 for RISC OS using CMake:
cmake -Bbuild-riscos -DCMAKE_TOOLCHAIN_FILE=$GCCSDK_INSTALL_ENV/toolchain-riscos.cmake -DRISCOS=ON -DCMAKE_INSTALL_PREFIX=$GCCSDK_INSTALL_ENV -DCMAKE_BUILD_TYPE=Release -DSDL_GCC_ATOMICS=OFF
cmake --build build-riscos
cmake --build build-riscos --target install
Current level of implementation
-------------------------------
The video driver currently provides full screen video support with keyboard and mouse input. Windowed mode is not yet supported, but is planned in the future. Only software rendering is supported.
The filesystem APIs return either Unix-style paths or RISC OS-style paths based on the value of the `__riscosify_control` symbol, as is standard for UnixLib functions.
The audio, loadso, thread and timer APIs are currently provided by UnixLib.
GCC atomics are currently broken on some platforms, meaning it's currently necessary to compile with `--disable-gcc-atomics` using autotools or `-DSDL_GCC_ATOMICS=OFF` using CMake.
The joystick, locale and power APIs are not yet implemented.
# Versioning
## Since 2.23.0
SDL follows an "odd/even" versioning policy, similar to GLib, GTK, Flatpak
and older versions of the Linux kernel:
* The major version (first part) increases when backwards compatibility
is broken, which will happen infrequently.
* If the minor version (second part) is divisible by 2
(for example 2.24.x, 2.26.x), this indicates a version of SDL that
is believed to be stable and suitable for production use.
* In stable releases, the patchlevel or micro version (third part)
indicates bugfix releases. Bugfix releases should not add or
remove ABI, so the ".0" release (for example 2.24.0) should be
forwards-compatible with all the bugfix releases from the
same cycle (for example 2.24.1).
* The minor version increases when new API or ABI is added, or when
other significant changes are made. Newer minor versions are
backwards-compatible, but not fully forwards-compatible.
For example, programs built against SDL 2.24.x should work fine
with SDL 2.26.x, but programs built against SDL 2.26.x will not
necessarily work with 2.24.x.
* If the minor version (second part) is not divisible by 2
(for example 2.23.x, 2.25.x), this indicates a development prerelease
of SDL that is not suitable for stable software distributions.
Use with caution.
* The patchlevel or micro version (third part) increases with
each prerelease.
* Each prerelease might add new API and/or ABI.
* Prereleases are backwards-compatible with older stable branches.
For example, 2.25.x will be backwards-compatible with 2.24.x.
* Prereleases are not guaranteed to be backwards-compatible with
each other. For example, new API or ABI added in 2.25.1
might be removed or changed in 2.25.2.
If this would be a problem for you, please do not use prereleases.
* Only upgrade to a prerelease if you can guarantee that you will
promptly upgrade to the stable release that follows it.
For example, do not upgrade to 2.23.x unless you will be able to
upgrade to 2.24.0 when it becomes available.
* Software distributions that have a freeze policy (in particular Linux
distributions with a release cycle, such as Debian and Fedora)
should usually only package stable releases, and not prereleases.
## Before 2.23.0
Older versions of SDL followed a similar policy, but instead of the
odd/even rule applying to the minor version, it applied to the patchlevel
(micro version, third part). For example, 2.0.22 was a stable release
and 2.0.21 was a prerelease.
Using SDL with Microsoft Visual C++
===================================
### by Lion Kimbro with additions by James Turk
You can either use the precompiled libraries from the [SDL](https://www.libsdl.org/download.php) web site, or you can build SDL
yourself.
### Building SDL
0. To build SDL, your machine must, at a minimum, have the DirectX9.0c SDK installed. It may or may not be retrievable from
the [Microsoft](https://www.microsoft.com) website, so you might need to locate it [online](https://duckduckgo.com/?q=directx9.0c+sdk+download&t=h_&ia=web).
_Editor's note: I've been able to successfully build SDL using Visual Studio 2019 **without** the DX9.0c SDK_
1. Open the Visual Studio solution file at `./VisualC/SDL.sln`.
2. Your IDE will likely prompt you to upgrade this solution file to whatever later version of the IDE you're using. In the `Retarget Projects` dialog,
all of the affected project files should be checked allowing you to use the latest `Windows SDK Version` you have installed, along with
the `Platform Toolset`.
If you choose *NOT* to upgrade to use the latest `Windows SDK Version` or `Platform Toolset`, then you'll need the `Visual Studio 2010 Platform Toolset`.
3. Build the `.dll` and `.lib` files by right clicking on each project in turn (Projects are listed in the _Workspace_
panel in the _FileView_ tab), and selecting `Build`.
You may get a few warnings, but you should not get any errors.
Later, we will refer to the following `.lib` and `.dll` files that have just been generated:
- `./VisualC/Win32/Debug/SDL2.dll` or `./VisualC/Win32/Release/SDL2.dll`
- `./VisualC/Win32/Debug/SDL2.lib` or `./VisualC/Win32/Release/SDL2.lib`
- `./VisualC/Win32/Debug/SDL2main.lib` or `./VisualC/Win32/Release/SDL2main.lib`
_Note for the `x64` versions, just replace `Win32` in the path with `x64`_
### Creating a Project with SDL
- Create a project as a `Win32 Application`.
- Create a C++ file for your project.
- Set the C runtime to `Multi-threaded DLL` in the menu:
`Project|Settings|C/C++ tab|Code Generation|Runtime Library `.
- Add the SDL `include` directory to your list of includes in the menu:
`Project|Settings|C/C++ tab|Preprocessor|Additional include directories `
*VC7 Specific: Instead of doing this, I find it easier to add the
include and library directories to the list that VC7 keeps. Do this by
selecting Tools|Options|Projects|VC++ Directories and under the "Show
Directories For:" dropbox select "Include Files", and click the "New
Directory Icon" and add the [SDLROOT]\\include directory (e.g. If you
installed to c:\\SDL\\ add c:\\SDL\\include). Proceed to change the
dropbox selection to "Library Files" and add [SDLROOT]\\lib.*
The "include directory" I am referring to is the `./include` folder.
Now we're going to use the files that we had created earlier in the *Build SDL* step.
Copy the following file into your Project directory:
- `SDL2.dll`
Add the following files to your project (It is not necessary to copy them to your project directory):
- `SDL2.lib`
- `SDL2main.lib`
To add them to your project, right click on your project, and select
`Add files to project`.
**Instead of adding the files to your project, it is more desirable to add them to the linker options: Project|Properties|Linker|Command Line
and type the names of the libraries to link with in the "Additional Options:" box. Note: This must be done for each build configuration
(e.g. Release,Debug).**
### Hello SDL2
Here's a sample SDL snippet to verify everything is setup in your IDE:
```
#include "SDL.h"
int main( int argc, char* argv[] )
{
const int WIDTH = 640;
const int HEIGHT = 480;
SDL_Window* window = NULL;
SDL_Renderer* renderer = NULL;
SDL_Init(SDL_INIT_VIDEO);
window = SDL_CreateWindow("SDL2 Test", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, WIDTH, HEIGHT, SDL_WINDOW_SHOWN);
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
SDL_DestroyRenderer(renderer);
SDL_DestroyWindow(window);
SDL_Quit();
return 0;
}
```
### That's it!
I hope that this document has helped you get through the most difficult part of using the SDL: installing it.
Suggestions for improvements should be posted to the [Github Issues](https://github.com/libsdl-org/SDL/issues).
### Credits
Thanks to [Paulus Esterhazy](mailto:pesterhazy@gmx.net), for the work on VC++ port.
This document was originally called "VisualC.txt", and was written by [Sam Lantinga](mailto:slouken@libsdl.org).
Later, it was converted to HTML and expanded into the document that you see today by [Lion Kimbro](mailto:snowlion@sprynet.com).
Minor Fixes and Visual C++ 7 Information (In Green) was added by [James Turk](mailto:james@conceptofzero.net)
PS Vita
=======
SDL port for the Sony Playstation Vita and Sony Playstation TV
Credit to
* xerpi, cpasjuste and rsn8887 for initial (vita2d) port
* vitasdk/dolcesdk devs
* CBPS discord (Namely Graphene and SonicMastr)
Building
--------
To build for the PSVita, make sure you have vitasdk and cmake installed and run:
```
cmake -S. -Bbuild -DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.cmake -DCMAKE_BUILD_TYPE=Release
cmake --build build
cmake --install build
```
Notes
-----
* gles1/gles2 support and renderers are disabled by default and can be enabled by configuring with `-DVIDEO_VITA_PVR=ON`
These renderers support 720p and 1080i resolutions. These can be specified with:
`SDL_setenv("VITA_RESOLUTION", "720", 1);` and `SDL_setenv("VITA_RESOLUTION", "1080", 1);`
* Desktop GL 1.X and 2.X support and renderers are also disabled by default and also can be enabled with `-DVIDEO_VITA_PVR=ON` as long as gl4es4vita is present in your SDK.
They support the same resolutions as the gles1/gles2 backends and require specifying `SDL_setenv("VITA_PVR_OGL", "1", 1);`
anytime before video subsystem initialization.
* gles2 support via PIB is disabled by default and can be enabled by configuring with `-DVIDEO_VITA_PIB=ON`
* By default SDL emits mouse events for touch events on every touchscreen.
Vita has two touchscreens, so it's recommended to use `SDL_SetHint(SDL_HINT_TOUCH_MOUSE_EVENTS, "0");` and handle touch events instead.
Individual touchscreens can be disabled with:
`SDL_setenv("VITA_DISABLE_TOUCH_FRONT", "1", 1);` and `SDL_setenv("VITA_DISABLE_TOUCH_BACK", "1", 1);`
* Support for L2/R2/R3/R3 buttons, haptic feedback and gamepad led only available on PSTV, or when using external ds4 gamepad on vita.
Windows # Windows
================================================================================
================================================================================ ## LLVM and Intel C++ compiler support
OpenGL ES 2.x support
================================================================================ SDL will build with the Visual Studio project files with LLVM-based compilers, such as the Intel oneAPI C++
compiler, but you'll have to manually add the "-msse3" command line option
to at least the SDL_audiocvt.c source file, and possibly others. This may
not be necessary if you build SDL with CMake instead of the included Visual
Studio solution.
Details are here: https://github.com/libsdl-org/SDL/issues/5186
## OpenGL ES 2.x support
SDL has support for OpenGL ES 2.x under Windows via two alternative SDL has support for OpenGL ES 2.x under Windows via two alternative
implementations. implementations.
The most straightforward method consists in running your app in a system with The most straightforward method consists in running your app in a system with
a graphic card paired with a relatively recent (as of November of 2013) driver a graphic card paired with a relatively recent (as of November of 2013) driver
which supports the WGL_EXT_create_context_es2_profile extension. Vendors known which supports the WGL_EXT_create_context_es2_profile extension. Vendors known
to ship said extension on Windows currently include nVidia and Intel. to ship said extension on Windows currently include nVidia and Intel.
The other method involves using the ANGLE library (https://code.google.com/p/angleproject/) The other method involves using the
If an OpenGL ES 2.x context is requested and no WGL_EXT_create_context_es2_profile [ANGLE library](https://code.google.com/p/angleproject/). If an OpenGL ES 2.x
extension is found, SDL will try to load the libEGL.dll library provided by context is requested and no WGL_EXT_create_context_es2_profile extension is
ANGLE. found, SDL will try to load the libEGL.dll library provided by ANGLE.
To obtain the ANGLE binaries, you can either compile from source from To obtain the ANGLE binaries, you can either compile from source from
https://chromium.googlesource.com/angle/angle or copy the relevant binaries from https://chromium.googlesource.com/angle/angle or copy the relevant binaries
a recent Chrome/Chromium install for Windows. The files you need are: from a recent Chrome/Chromium install for Windows. The files you need are:
* libEGL.dll - libEGL.dll
* libGLESv2.dll - libGLESv2.dll
* d3dcompiler_46.dll (supports Windows Vista or later, better shader compiler) - d3dcompiler_46.dll (supports Windows Vista or later, better shader
or... compiler) *or* d3dcompiler_43.dll (supports Windows XP or later)
* d3dcompiler_43.dll (supports Windows XP or later)
If you compile ANGLE from source, you can configure it so it does not need the If you compile ANGLE from source, you can configure it so it does not need the
d3dcompiler_* DLL at all (for details on this, see their documentation). d3dcompiler_* DLL at all (for details on this, see their documentation).
However, by default SDL will try to preload the d3dcompiler_46.dll to However, by default SDL will try to preload the d3dcompiler_46.dll to
comply with ANGLE's requirements. If you wish SDL to preload d3dcompiler_43.dll (to comply with ANGLE's requirements. If you wish SDL to preload
support Windows XP) or to skip this step at all, you can use the d3dcompiler_43.dll (to support Windows XP) or to skip this step at all, you
SDL_HINT_VIDEO_WIN_D3DCOMPILER hint (see SDL_hints.h for more details). can use the SDL_HINT_VIDEO_WIN_D3DCOMPILER hint (see SDL_hints.h for more
details).
Known Bugs: Known Bugs:
* SDL_GL_SetSwapInterval is currently a no op when using ANGLE. It appears - SDL_GL_SetSwapInterval is currently a no op when using ANGLE. It appears
that there's a bug in the library which prevents the window contents from that there's a bug in the library which prevents the window contents from
refreshing if this is set to anything other than the default value. refreshing if this is set to anything other than the default value.
Vulkan Surface Support ## Vulkan Surface Support
==============
Support for creating Vulkan surfaces is configured on by default. To disable
it change the value of `SDL_VIDEO_VULKAN` to 0 in `SDL_config_windows.h`. You
must install the [Vulkan SDK](https://www.lunarg.com/vulkan-sdk/) in order to
use Vulkan graphics in your application.
Support for creating Vulkan surfaces is configured on by default. To disable it change the value of `SDL_VIDEO_VULKAN` to 0 in `SDL_config_windows.h`. You must install the [Vulkan SDK](https://www.lunarg.com/vulkan-sdk/) in order to use Vulkan graphics in your application.
...@@ -5,47 +5,21 @@ This port allows SDL applications to run on Microsoft's platforms that require ...@@ -5,47 +5,21 @@ This port allows SDL applications to run on Microsoft's platforms that require
use of "Windows Runtime", aka. "WinRT", APIs. Microsoft may, in some cases, 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. refer to them as either "Windows Store", or for Windows 10, "UWP" apps.
Some of the operating systems that include WinRT, are: In the past, SDL has supported Windows RT 8.x, Windows Phone, etc, but in
modern times this port is focused on UWP apps, which run on Windows 10,
* Windows 10, via its Universal Windows Platform (UWP) APIs and modern Xbox consoles.
* Windows 8.x
* Windows RT 8.x (aka. Windows 8.x for ARM processors)
* Windows Phone 8.x
Requirements Requirements
------------ ------------
* Microsoft Visual C++ (aka Visual Studio), either 2017, 2015, 2013, or 2012 * Microsoft Visual C++ (aka Visual Studio) 2019.
- Free, "Community" or "Express" editions may be used, so long as they - Free, "Community" or "Express" editions may be used, so long as they
include support for either "Windows Store" or "Windows Phone" apps. include support for either "Windows Store" or "Windows Phone" apps.
"Express" versions marked as supporting "Windows Desktop" development "Express" versions marked as supporting "Windows Desktop" development
typically do not include support for creating WinRT apps, to note. typically do not include support for creating WinRT apps, to note.
(The "Community" editions of Visual C++ do, however, support both (The "Community" editions of Visual C++ do, however, support both
desktop/Win32 and WinRT development). desktop/Win32 and WinRT development).
- Visual Studio 2017 can be used, however it is recommented that you install
the Visual C++ 2015 build tools. These build tools can be installed
using VS 2017's installer. Be sure to also install the workload for
"Universal Windows Platform development", its optional component, the
"C++ Universal Windows Platform tools", and for UWP / Windows 10
development, the "Windows 10 SDK (10.0.10240.0)". Please note that
targeting UWP / Windows 10 apps from development machine(s) running
earlier versions of Windows, such as Windows 7, is not always supported
by Visual Studio, and you may get error(s) when attempting to do so.
- Visual C++ 2012 can only build apps that target versions 8.0 of Windows,
or Windows Phone. 8.0-targetted apps will run on devices running 8.1
editions of Windows, however they will not be able to take advantage of
8.1-specific features.
- Visual C++ 2013 cannot create app projects that target Windows 8.0.
Visual C++ 2013 Update 4, can create app projects for Windows Phone 8.0,
Windows Phone 8.1, and Windows 8.1, but not Windows 8.0. An optional
Visual Studio add-in, "Tools for Maintaining Store apps for Windows 8",
allows Visual C++ 2013 to load and build Windows 8.0 projects that were
created with Visual C++ 2012, so long as Visual C++ 2012 is installed
on the same machine. More details on targeting different versions of
Windows can found at the following web pages:
- [Develop apps by using Visual Studio 2013](http://msdn.microsoft.com/en-us/library/windows/apps/br211384.aspx)
- [To add the Tools for Maintaining Store apps for Windows 8](http://msdn.microsoft.com/en-us/library/windows/apps/dn263114.aspx#AddMaintenanceTools)
* A valid Microsoft account - This requirement is not imposed by SDL, but * A valid Microsoft account - This requirement is not imposed by SDL, but
rather by Microsoft's Visual C++ toolchain. This is required to launch or rather by Microsoft's Visual C++ toolchain. This is required to launch or
debug apps. debug apps.
...@@ -54,10 +28,10 @@ Requirements ...@@ -54,10 +28,10 @@ Requirements
Status Status
------ ------
Here is a rough list of what works, and what doens't: Here is a rough list of what works, and what doesn't:
* What works: * What works:
* compilation via Visual C++ 2012 through 2015 * compilation via Visual C++ 2019.
* compile-time platform detection for SDL programs. The C/C++ #define, * compile-time platform detection for SDL programs. The C/C++ #define,
`__WINRT__`, will be set to 1 (by SDL) when compiling for WinRT. `__WINRT__`, will be set to 1 (by SDL) when compiling for WinRT.
* GPU-accelerated 2D rendering, via SDL_Renderer. * GPU-accelerated 2D rendering, via SDL_Renderer.
...@@ -70,7 +44,10 @@ Here is a rough list of what works, and what doens't: ...@@ -70,7 +44,10 @@ Here is a rough list of what works, and what doens't:
SDL_GetPerformanceFrequency(), etc.) SDL_GetPerformanceFrequency(), etc.)
* file I/O via SDL_RWops * file I/O via SDL_RWops
* mouse input (unsupported on Windows Phone) * mouse input (unsupported on Windows Phone)
* audio, via a modified version of SDL's XAudio2 backend * audio, via SDL's WASAPI backend (if you want to record, your app must
have "Microphone" capabilities enabled in its manifest, and the user must
not have blocked access. Otherwise, capture devices will fail to work,
presenting as a device disconnect shortly after opening it.)
* .DLL file loading. Libraries *MUST* be packaged inside applications. Loading * .DLL file loading. Libraries *MUST* be packaged inside applications. Loading
anything outside of the app is not supported. anything outside of the app is not supported.
* system path retrieval via SDL's filesystem APIs * system path retrieval via SDL's filesystem APIs
...@@ -231,13 +208,8 @@ To set this up for SDL/WinRT, you'll need to run through the following steps: ...@@ -231,13 +208,8 @@ To set this up for SDL/WinRT, you'll need to run through the following steps:
"Solution Explorer") "Solution Explorer")
2. right click on your app's solution. 2. right click on your app's solution.
3. navigate to "Add", then to "Existing Project..." 3. navigate to "Add", then to "Existing Project..."
4. find SDL/WinRT's Visual C++ project file and open it. Different project 4. find SDL/WinRT's Visual C++ project file and open it, in the `VisualC-WinRT`
files exist for different WinRT platforms. All of them are in SDL's directory.
source distribution, in the following directories:
* `VisualC-WinRT/UWP_VS2015/` - for Windows 10 / UWP apps
* `VisualC-WinRT/WinPhone81_VS2013/` - for Windows Phone 8.1 apps
* `VisualC-WinRT/WinRT80_VS2012/` - for Windows 8.0 apps
* `VisualC-WinRT/WinRT81_VS2013/` - for Windows 8.1 apps
5. once the project has been added, right-click on your app's project and 5. once the project has been added, right-click on your app's project and
select, "References..." select, "References..."
6. click on the button titled, "Add New Reference..." 6. click on the button titled, "Add New Reference..."
...@@ -293,7 +265,7 @@ A few files should be included directly in your app's MSVC project, specifically ...@@ -293,7 +265,7 @@ A few files should be included directly in your app's MSVC project, specifically
included, mouse-position reporting may fail if and when the cursor is included, mouse-position reporting may fail if and when the cursor is
hidden, due to possible bugs/design-oddities in Windows itself.* hidden, due to possible bugs/design-oddities in Windows itself.*
To include these files: To include these files for C/C++ projects:
1. right-click on your project (again, in Visual C++'s Solution Explorer), 1. right-click on your project (again, in Visual C++'s Solution Explorer),
navigate to "Add", then choose "Existing Item...". navigate to "Add", then choose "Existing Item...".
...@@ -310,11 +282,14 @@ To include these files: ...@@ -310,11 +282,14 @@ To include these files:
7. change the setting for "Consume Windows Runtime Extension" to "Yes (/ZW)". 7. change the setting for "Consume Windows Runtime Extension" to "Yes (/ZW)".
8. click the OK button. This will close the dialog. 8. click the OK button. This will close the dialog.
**NOTE: C++/CX compilation is currently required in at least one file of your **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 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.** Metadata' file (.winmd) for your app. Not doing so can lead to build errors.**
For non-C++ projects, you will need to call SDL_WinRTRunApp from your language's
main function, and generate SDL2-WinRTResources.res manually by using `rc` via
the Developer Command Prompt and including it as a <Win32Resource> within the
first <PropertyGroup> block in your Visual Studio project file.
### 6. Add app code and assets ### ### 6. Add app code and assets ###
...@@ -346,7 +321,7 @@ source file, such as, "main.cpp". ...@@ -346,7 +321,7 @@ source file, such as, "main.cpp".
your project, and open the file in Visual C++'s text editor. your project, and open the file in Visual C++'s text editor.
7. Copy and paste the following code into the new file, then save it. 7. Copy and paste the following code into the new file, then save it.
```c
#include <SDL.h> #include <SDL.h>
int main(int argc, char **argv) int main(int argc, char **argv)
...@@ -355,29 +330,32 @@ your project, and open the file in Visual C++'s text editor. ...@@ -355,29 +330,32 @@ your project, and open the file in Visual C++'s text editor.
SDL_Window * window = NULL; SDL_Window * window = NULL;
SDL_Renderer * renderer = NULL; SDL_Renderer * renderer = NULL;
SDL_Event evt; SDL_Event evt;
SDL_bool keep_going = SDL_TRUE;
if (SDL_Init(SDL_INIT_VIDEO) != 0) { if (SDL_Init(SDL_INIT_VIDEO) != 0) {
return 1; return 1;
} } else if (SDL_GetCurrentDisplayMode(0, &mode) != 0) {
if (SDL_GetCurrentDisplayMode(0, &mode) != 0) {
return 1; return 1;
} } else if (SDL_CreateWindowAndRenderer(mode.w, mode.h, SDL_WINDOW_FULLSCREEN, &window, &renderer) != 0) {
if (SDL_CreateWindowAndRenderer(mode.w, mode.h, SDL_WINDOW_FULLSCREEN, &window, &renderer) != 0) {
return 1; return 1;
} }
while (1) { while (keep_going) {
while (SDL_PollEvent(&evt)) { while (SDL_PollEvent(&evt)) {
if ((evt.type == SDL_KEYDOWN) && (evt.key.keysym.sym == SDLK_ESCAPE)) {
keep_going = SDL_FALSE;
}
} }
SDL_SetRenderDrawColor(renderer, 0, 255, 0, 255); SDL_SetRenderDrawColor(renderer, 0, 255, 0, 255);
SDL_RenderClear(renderer); SDL_RenderClear(renderer);
SDL_RenderPresent(renderer); SDL_RenderPresent(renderer);
} }
}
SDL_Quit();
return 0;
}
```
#### 6.B. Adding code and assets #### #### 6.B. Adding code and assets ####
......
Simple DirectMedia Layer {#mainpage} # Simple DirectMedia Layer
========================
(SDL) https://www.libsdl.org/
Version 2.0
---
http://www.libsdl.org/
Simple DirectMedia Layer is a cross-platform development library designed Simple DirectMedia Layer is a cross-platform development library designed
to provide low level access to audio, keyboard, mouse, joystick, and graphics to provide low level access to audio, keyboard, mouse, joystick, and graphics
...@@ -14,14 +8,14 @@ hardware via OpenGL and Direct3D. It is used by video playback software, ...@@ -14,14 +8,14 @@ hardware via OpenGL and Direct3D. It is used by video playback software,
emulators, and popular games including Valve's award winning catalog emulators, and popular games including Valve's award winning catalog
and many Humble Bundle games. and many Humble Bundle games.
SDL officially supports Windows, Mac OS X, Linux, iOS, and Android. SDL officially supports Windows, macOS, Linux, iOS, and Android.
Support for other platforms may be found in the source code. Support for other platforms may be found in the source code.
SDL is written in C, works natively with C++, and there are bindings SDL is written in C, works natively with C++, and there are bindings
available for several other languages, including C# and Python. available for several other languages, including C# and Python.
This library is distributed under the zlib license, which can be found This library is distributed under the zlib license, which can be found
in the file "COPYING.txt". in the file "LICENSE.txt".
The best way to learn how to use SDL is to check out the header files in The best way to learn how to use SDL is to check out the header files in
the "include" subdirectory and the programs in the "test" subdirectory. the "include" subdirectory and the programs in the "test" subdirectory.
...@@ -34,30 +28,36 @@ More documentation and FAQs are available online at [the wiki](http://wiki.libsd ...@@ -34,30 +28,36 @@ More documentation and FAQs are available online at [the wiki](http://wiki.libsd
- [DirectFB](README-directfb.md) - [DirectFB](README-directfb.md)
- [DynAPI](README-dynapi.md) - [DynAPI](README-dynapi.md)
- [Emscripten](README-emscripten.md) - [Emscripten](README-emscripten.md)
- [GDK](README-gdk.md)
- [Gesture](README-gesture.md) - [Gesture](README-gesture.md)
- [Mercurial](README-hg.md) - [Git](README-git.md)
- [iOS](README-ios.md) - [iOS](README-ios.md)
- [Linux](README-linux.md) - [Linux](README-linux.md)
- [OS X](README-macosx.md) - [macOS](README-macos.md)
- [OS/2](README-os2.md)
- [Native Client](README-nacl.md) - [Native Client](README-nacl.md)
- [Pandora](README-pandora.md) - [Pandora](README-pandora.md)
- [Supported Platforms](README-platforms.md) - [Supported Platforms](README-platforms.md)
- [Porting information](README-porting.md) - [Porting information](README-porting.md)
- [PSP](README-psp.md) - [PSP](README-psp.md)
- [PS2](README-ps2.md)
- [Raspberry Pi](README-raspberrypi.md) - [Raspberry Pi](README-raspberrypi.md)
- [Touch](README-touch.md) - [Touch](README-touch.md)
- [Versions](README-versions.md)
- [WinCE](README-wince.md) - [WinCE](README-wince.md)
- [Windows](README-windows.md) - [Windows](README-windows.md)
- [WinRT](README-winrt.md) - [WinRT](README-winrt.md)
- [PSVita](README-vita.md)
- [Nokia N-Gage](README-ngage.md)
If you need help with the library, or just want to discuss SDL related If you need help with the library, or just want to discuss SDL related
issues, you can join the [developers mailing list](http://www.libsdl.org/mailing-list.php) issues, you can join the [SDL Discourse](https://discourse.libsdl.org/),
which can be used as a web forum or a mailing list, at your preference.
If you want to report bugs or contribute patches, please submit them to If you want to report bugs or contribute patches, please submit them to
[bugzilla](https://bugzilla.libsdl.org/) [our bug tracker](https://github.com/libsdl-org/SDL/issues)
Enjoy! Enjoy!
Sam Lantinga <mailto:slouken@libsdl.org> Sam Lantinga <mailto:slouken@libsdl.org>
...@@ -640,6 +640,7 @@ EXCLUDE = ../include/SDL_opengles2_gl2ext.h \ ...@@ -640,6 +640,7 @@ EXCLUDE = ../include/SDL_opengles2_gl2ext.h \
../include/SDL_opengles.h \ ../include/SDL_opengles.h \
../include/SDL_opengl.h \ ../include/SDL_opengl.h \
../include/SDL_egl.h \ ../include/SDL_egl.h \
./release_checklist.md \
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or # The EXCLUDE_SYMLINKS tag can be used select whether or not files or
......
# Release checklist
When changing the version, run `build-scripts/update-version.sh X Y Z`,
where `X Y Z` are the major version, minor version, and patch level. So
`2 28 1` means "change the version to 2.28.1". This script does much of the
mechanical work.
## New feature release
* Update `WhatsNew.txt`
* Bump version number to 2.EVEN.0:
* `./build-scripts/update-version.sh 2 EVEN 0`
* Do the release
* Update the website file include/header.inc.php to reflect the new version
## New bugfix release
* Check that no new API/ABI was added
* If it was, do a new feature release (see above) instead
* Bump version number from 2.Y.Z to 2.Y.(Z+1) (Y is even)
* `./build-scripts/update-version.sh 2 Y Z+1`
* Do the release
* Update the website file include/header.inc.php to reflect the new version
## After a feature release
* Create a branch like `release-2.24.x`
* Bump version number to 2.ODD.0 for next development branch
* `./build-scripts/update-version.sh 2 ODD 0`
## New development prerelease
* Bump version number from 2.Y.Z to 2.Y.(Z+1) (Y is odd)
* `./build-scripts/update-version.sh 2 Y Z+1`
* Do the release
No preview for this file type
#!/bin/sh #!/bin/sh
prefix=/usr/local/i686-w64-mingw32 # Get the canonical path of the folder containing this script
bindir=$(cd -P -- "$(dirname -- "$0")" && printf '%s\n' "$(pwd -P)")
# Calculate the canonical path of the prefix, relative to the folder of this script
prefix=$(cd -P -- "$bindir/.." && printf '%s\n' "$(pwd -P)")
exec_prefix=${prefix} exec_prefix=${prefix}
exec_prefix_set=no exec_prefix_set=no
libdir=${exec_prefix}/lib libdir=${exec_prefix}/lib
...@@ -39,7 +43,7 @@ while test $# -gt 0; do ...@@ -39,7 +43,7 @@ while test $# -gt 0; do
echo $exec_prefix echo $exec_prefix
;; ;;
--version) --version)
echo 2.0.7 echo 2.28.5
;; ;;
--cflags) --cflags)
echo -I${prefix}/include/SDL2 -Dmain=SDL_main echo -I${prefix}/include/SDL2 -Dmain=SDL_main
...@@ -49,7 +53,8 @@ while test $# -gt 0; do ...@@ -49,7 +53,8 @@ while test $# -gt 0; do
;; ;;
--static-libs) --static-libs)
# --libs|--static-libs) # --libs|--static-libs)
echo -L${exec_prefix}/lib -lmingw32 -lSDL2main -lSDL2 -mwindows -Wl,--no-undefined -lm -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -luuid -static-libgcc sdl_static_libs=$(echo "-lmingw32 -lSDL2main -lSDL2 -mwindows -Wl,--dynamicbase -Wl,--nxcompat -lm -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lsetupapi -lversion -luuid" | sed -E "s#-lSDL2[ $]#$libdir/libSDL2.a #g")
echo -L${exec_prefix}/lib $sdl_static_libs
;; ;;
*) *)
echo "${usage}" 1>&2 echo "${usage}" 1>&2
......
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
...@@ -41,22 +41,28 @@ ...@@ -41,22 +41,28 @@
#include "SDL_events.h" #include "SDL_events.h"
#include "SDL_filesystem.h" #include "SDL_filesystem.h"
#include "SDL_gamecontroller.h" #include "SDL_gamecontroller.h"
#include "SDL_guid.h"
#include "SDL_haptic.h" #include "SDL_haptic.h"
#include "SDL_hidapi.h"
#include "SDL_hints.h" #include "SDL_hints.h"
#include "SDL_joystick.h" #include "SDL_joystick.h"
#include "SDL_loadso.h" #include "SDL_loadso.h"
#include "SDL_log.h" #include "SDL_log.h"
#include "SDL_messagebox.h" #include "SDL_messagebox.h"
#include "SDL_metal.h"
#include "SDL_mutex.h" #include "SDL_mutex.h"
#include "SDL_power.h" #include "SDL_power.h"
#include "SDL_render.h" #include "SDL_render.h"
#include "SDL_rwops.h" #include "SDL_rwops.h"
#include "SDL_sensor.h"
#include "SDL_shape.h" #include "SDL_shape.h"
#include "SDL_system.h" #include "SDL_system.h"
#include "SDL_thread.h" #include "SDL_thread.h"
#include "SDL_timer.h" #include "SDL_timer.h"
#include "SDL_version.h" #include "SDL_version.h"
#include "SDL_video.h" #include "SDL_video.h"
#include "SDL_locale.h"
#include "SDL_misc.h"
#include "begin_code.h" #include "begin_code.h"
/* Set up for C function definitions, even when using C++ */ /* Set up for C function definitions, even when using C++ */
...@@ -80,45 +86,139 @@ extern "C" { ...@@ -80,45 +86,139 @@ extern "C" {
#define SDL_INIT_HAPTIC 0x00001000u #define SDL_INIT_HAPTIC 0x00001000u
#define SDL_INIT_GAMECONTROLLER 0x00002000u /**< SDL_INIT_GAMECONTROLLER implies SDL_INIT_JOYSTICK */ #define SDL_INIT_GAMECONTROLLER 0x00002000u /**< SDL_INIT_GAMECONTROLLER implies SDL_INIT_JOYSTICK */
#define SDL_INIT_EVENTS 0x00004000u #define SDL_INIT_EVENTS 0x00004000u
#define SDL_INIT_SENSOR 0x00008000u
#define SDL_INIT_NOPARACHUTE 0x00100000u /**< compatibility; this flag is ignored. */ #define SDL_INIT_NOPARACHUTE 0x00100000u /**< compatibility; this flag is ignored. */
#define SDL_INIT_EVERYTHING ( \ #define SDL_INIT_EVERYTHING ( \
SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \ SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \
SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER \ SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER | SDL_INIT_SENSOR \
) )
/* @} */ /* @} */
/** /**
* This function initializes the subsystems specified by \c flags * Initialize the SDL library.
*
* SDL_Init() simply forwards to calling SDL_InitSubSystem(). Therefore, the
* two may be used interchangeably. Though for readability of your code
* SDL_InitSubSystem() might be preferred.
*
* The file I/O (for example: SDL_RWFromFile) and threading (SDL_CreateThread)
* subsystems are initialized by default. Message boxes
* (SDL_ShowSimpleMessageBox) also attempt to work without initializing the
* video subsystem, in hopes of being useful in showing an error dialog when
* SDL_Init fails. You must specifically initialize other subsystems if you
* use them in your application.
*
* Logging (such as SDL_Log) works without initialization, too.
*
* `flags` may be any of the following OR'd together:
*
* - `SDL_INIT_TIMER`: timer subsystem
* - `SDL_INIT_AUDIO`: audio subsystem
* - `SDL_INIT_VIDEO`: video subsystem; automatically initializes the events
* subsystem
* - `SDL_INIT_JOYSTICK`: joystick subsystem; automatically initializes the
* events subsystem
* - `SDL_INIT_HAPTIC`: haptic (force feedback) subsystem
* - `SDL_INIT_GAMECONTROLLER`: controller subsystem; automatically
* initializes the joystick subsystem
* - `SDL_INIT_EVENTS`: events subsystem
* - `SDL_INIT_EVERYTHING`: all of the above subsystems
* - `SDL_INIT_NOPARACHUTE`: compatibility; this flag is ignored
*
* Subsystem initialization is ref-counted, you must call SDL_QuitSubSystem()
* for each SDL_InitSubSystem() to correctly shutdown a subsystem manually (or
* call SDL_Quit() to force shutdown). If a subsystem is already loaded then
* this call will increase the ref-count and return.
*
* \param flags subsystem initialization flags
* \returns 0 on success or a negative error code on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 2.0.0.
*
* \sa SDL_InitSubSystem
* \sa SDL_Quit
* \sa SDL_SetMainReady
* \sa SDL_WasInit
*/ */
extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags); extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags);
/** /**
* This function initializes specific SDL subsystems * Compatibility function to initialize the SDL library.
*
* In SDL2, this function and SDL_Init() are interchangeable.
* *
* Subsystem initialization is ref-counted, you must call * \param flags any of the flags used by SDL_Init(); see SDL_Init for details.
* SDL_QuitSubSystem() for each SDL_InitSubSystem() to correctly * \returns 0 on success or a negative error code on failure; call
* shutdown a subsystem manually (or call SDL_Quit() to force shutdown). * SDL_GetError() for more information.
* If a subsystem is already loaded then this call will *
* increase the ref-count and return. * \since This function is available since SDL 2.0.0.
*
* \sa SDL_Init
* \sa SDL_Quit
* \sa SDL_QuitSubSystem
*/ */
extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags); extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags);
/** /**
* This function cleans up specific SDL subsystems * Shut down specific SDL subsystems.
*
* If you start a subsystem using a call to that subsystem's init function
* (for example SDL_VideoInit()) instead of SDL_Init() or SDL_InitSubSystem(),
* SDL_QuitSubSystem() and SDL_WasInit() will not work. You will need to use
* that subsystem's quit function (SDL_VideoQuit()) directly instead. But
* generally, you should not be using those functions directly anyhow; use
* SDL_Init() instead.
*
* You still need to call SDL_Quit() even if you close all open subsystems
* with SDL_QuitSubSystem().
*
* \param flags any of the flags used by SDL_Init(); see SDL_Init for details.
*
* \since This function is available since SDL 2.0.0.
*
* \sa SDL_InitSubSystem
* \sa SDL_Quit
*/ */
extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags); extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags);
/** /**
* This function returns a mask of the specified subsystems which have * Get a mask of the specified subsystems which are currently initialized.
* previously been initialized. *
* \param flags any of the flags used by SDL_Init(); see SDL_Init for details.
* \returns a mask of all initialized subsystems if `flags` is 0, otherwise it
* returns the initialization status of the specified subsystems.
*
* The return value does not include SDL_INIT_NOPARACHUTE.
* *
* If \c flags is 0, it returns a mask of all initialized subsystems. * \since This function is available since SDL 2.0.0.
*
* \sa SDL_Init
* \sa SDL_InitSubSystem
*/ */
extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags); extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags);
/** /**
* This function cleans up all initialized subsystems. You should * Clean up all initialized subsystems.
* call it upon all exit conditions. *
* You should call this function even if you have already shutdown each
* initialized subsystem with SDL_QuitSubSystem(). It is safe to call this
* function even in the case of errors in initialization.
*
* If you start a subsystem using a call to that subsystem's init function
* (for example SDL_VideoInit()) instead of SDL_Init() or SDL_InitSubSystem(),
* then you must use that subsystem's quit function (SDL_VideoQuit()) to shut
* it down before calling SDL_Quit(). But generally, you should not be using
* those functions directly anyhow; use SDL_Init() instead.
*
* You can use this function with atexit() to ensure that it is run when your
* application is shutdown, but it is not wise to do this from a library or
* other dynamically loaded code.
*
* \since This function is available since SDL 2.0.0.
*
* \sa SDL_Init
* \sa SDL_QuitSubSystem
*/ */
extern DECLSPEC void SDLCALL SDL_Quit(void); extern DECLSPEC void SDLCALL SDL_Quit(void);
......