First pass at changing SDL 2.0 to SDL 3.0
This commit is contained in:
@@ -86,8 +86,8 @@ If you already have a project that uses CMake, the instructions change somewhat:
|
||||
2. Edit "<project>/app/build.gradle" to comment out or remove sections containing ndk-build
|
||||
and uncomment the cmake sections. Add arguments to the CMake invocation as needed.
|
||||
3. Edit "<project>/app/jni/CMakeLists.txt" to include your project (it defaults to
|
||||
adding the "src" subdirectory). Note that you'll have SDL2, SDL2main and SDL2-static
|
||||
as targets in your project, so you should have "target_link_libraries(yourgame SDL2 SDL2main)"
|
||||
adding the "src" subdirectory). Note that you'll have SDL3, SDL3main and SDL3-static
|
||||
as targets in your project, so you should have "target_link_libraries(yourgame SDL3 SDL3main)"
|
||||
in your CMakeLists.txt file. Also be aware that you should use add_library() instead of
|
||||
add_executable() for the target containing your "main" function.
|
||||
|
||||
@@ -414,10 +414,10 @@ 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
|
||||
Tegra Graphics Debugger at their website. Because SDL3 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.
|
||||
compatible with applications that use SDL3 for video.
|
||||
|
||||
The Tegra Graphics Debugger is available from NVidia here:
|
||||
https://developer.nvidia.com/tegra-graphics-debugger
|
||||
|
||||
@@ -57,24 +57,24 @@ option(MYGAME_VENDORED "Use vendored libraries" OFF)
|
||||
if(MYGAME_VENDORED)
|
||||
add_subdirectory(vendored/sdl EXCLUDE_FROM_ALL)
|
||||
else()
|
||||
# 1. Look for a SDL2 package, 2. look for the SDL2 component and 3. fail if none can be found
|
||||
find_package(SDL2 REQUIRED CONFIG REQUIRED COMPONENTS SDL2)
|
||||
# 1. Look for a SDL3 package, 2. look for the SDL3 component and 3. fail if none can be found
|
||||
find_package(SDL3 REQUIRED CONFIG REQUIRED COMPONENTS SDL3)
|
||||
|
||||
# 1. Look for a SDL2 package, 2. Look for the SDL2maincomponent and 3. DO NOT fail when SDL2main is not available
|
||||
find_package(SDL2 REQUIRED CONFIG COMPONENTS SDL2main)
|
||||
# 1. Look for a SDL3 package, 2. Look for the SDL3maincomponent and 3. DO NOT fail when SDL3main is not available
|
||||
find_package(SDL3 REQUIRED CONFIG COMPONENTS SDL3main)
|
||||
endif()
|
||||
|
||||
# Create your game executable target as usual
|
||||
add_executable(mygame WIN32 mygame.c)
|
||||
|
||||
# SDL2::SDL2main may or may not be available. It is e.g. required by Windows GUI applications
|
||||
if(TARGET SDL2::SDL2main)
|
||||
# It has an implicit dependency on SDL2 functions, so it MUST be added before SDL2::SDL2 (or SDL2::SDL2-static)
|
||||
target_link_libraries(mygame PRIVATE SDL2::SDL2main)
|
||||
# SDL3::SDL3main may or may not be available. It is e.g. required by Windows GUI applications
|
||||
if(TARGET SDL3::SDL3main)
|
||||
# It has an implicit dependency on SDL3 functions, so it MUST be added before SDL3::SDL3 (or SDL3::SDL3-static)
|
||||
target_link_libraries(mygame PRIVATE SDL3::SDL3main)
|
||||
endif()
|
||||
|
||||
# Link to the actual SDL2 library. SDL2::SDL2 is the shared SDL library, SDL2::SDL2-static is the static SDL libarary.
|
||||
target_link_libraries(mygame PRIVATE SDL2::SDL2)
|
||||
# Link to the actual SDL3 library. SDL3::SDL3 is the shared SDL library, SDL3::SDL3-static is the static SDL libarary.
|
||||
target_link_libraries(mygame PRIVATE SDL3::SDL3)
|
||||
```
|
||||
|
||||
### A system SDL library
|
||||
@@ -85,10 +85,10 @@ The following components are available, to be used as an argument of `find_packa
|
||||
|
||||
| Component name | Description |
|
||||
|----------------|--------------------------------------------------------------------------------------------|
|
||||
| SDL2 | The SDL2 shared library, available through the `SDL2::SDL2` target [^SDL_TARGET_EXCEPTION] |
|
||||
| SDL2-static | The SDL2 static library, available through the `SDL2::SDL2-static` target |
|
||||
| SDL2main | The SDL2main static library, available through the `SDL2::SDL2main` target |
|
||||
| SDL2test | The SDL2test static library, available through the `SDL2::SDL2test` target |
|
||||
| SDL3 | The SDL3 shared library, available through the `SDL3::SDL3` target [^SDL_TARGET_EXCEPTION] |
|
||||
| SDL3-static | The SDL3 static library, available through the `SDL3::SDL3-static` target |
|
||||
| SDL3main | The SDL3main static library, available through the `SDL3::SDL3main` target |
|
||||
| SDL3test | The SDL3test static library, available through the `SDL3::SDL3test` target |
|
||||
|
||||
### Using a vendored SDL
|
||||
|
||||
@@ -160,4 +160,4 @@ To use, set the following CMake variables when running CMake's configuration sta
|
||||
```
|
||||
|
||||
|
||||
[^SDL_TARGET_EXCEPTION]: `SDL2::SDL2` can be an ALIAS to a static `SDL2::SDL2-static` target for multiple reasons.
|
||||
[^SDL_TARGET_EXCEPTION]: `SDL3::SDL3` can be an ALIAS to a static `SDL3::SDL3-static` target for multiple reasons.
|
||||
|
||||
@@ -4,22 +4,22 @@ Originally posted on Ryan's Google+ account.
|
||||
|
||||
Background:
|
||||
|
||||
- The Steam Runtime has (at least in theory) a really kick-ass build of SDL2,
|
||||
but developers are shipping their own SDL2 with individual Steam games.
|
||||
These games might stop getting updates, but a newer SDL2 might be needed later.
|
||||
- The Steam Runtime has (at least in theory) a really kick-ass build of SDL,
|
||||
but developers are shipping their own SDL with individual Steam games.
|
||||
These games might stop getting updates, but a newer SDL might be needed later.
|
||||
Certainly we'll always be fixing bugs in SDL, even if a new video target isn't
|
||||
ever needed, and these fixes won't make it to a game shipping its own SDL.
|
||||
- Even if we replace the SDL2 in those games with a compatible one, that is to
|
||||
- Even if we replace the SDL in those games with a compatible one, that is to
|
||||
say, edit a developer's Steam depot (yuck!), there are developers that are
|
||||
statically linking SDL2 that we can't do this for. We can't even force the
|
||||
dynamic loader to ignore their SDL2 in this case, of course.
|
||||
- If you don't ship an SDL2 with the game in some form, people that disabled the
|
||||
statically linking SDL that we can't do this for. We can't even force the
|
||||
dynamic loader to ignore their SDL in this case, of course.
|
||||
- If you don't ship an SDL with the game in some form, people that disabled the
|
||||
Steam Runtime, or just tried to run the game from the command line instead of
|
||||
Steam might find themselves unable to run the game, due to a missing dependency.
|
||||
- If you want to ship on non-Steam platforms like GOG or Humble Bundle, or target
|
||||
generic Linux boxes that may or may not have SDL2 installed, you have to ship
|
||||
generic Linux boxes that may or may not have SDL installed, you have to ship
|
||||
the library or risk a total failure to launch. So now, you might have to have
|
||||
a non-Steam build plus a Steam build (that is, one with and one without SDL2
|
||||
a non-Steam build plus a Steam build (that is, one with and one without SDL
|
||||
included), which is inconvenient if you could have had one universal build
|
||||
that works everywhere.
|
||||
- We like the zlib license, but the biggest complaint from the open source
|
||||
@@ -65,8 +65,8 @@ system's dynamic loader was supposed to do for us? Yes, but now we've got this
|
||||
level of indirection, we can do things like this:
|
||||
|
||||
```bash
|
||||
export SDL_DYNAMIC_API=/my/actual/libSDL-2.0.so.0
|
||||
./MyGameThatIsStaticallyLinkedToSDL2
|
||||
export SDL_DYNAMIC_API=/my/actual/libSDL3.so.0
|
||||
./MyGameThatIsStaticallyLinkedToSDL
|
||||
```
|
||||
|
||||
And now, this game that is statically linked to SDL, can still be overridden
|
||||
@@ -108,7 +108,7 @@ the jump table, and the size, in bytes, of the table.
|
||||
Now, we've got policy here: this table's layout never changes; new stuff gets
|
||||
added to the end. Therefore SDL_DYNAPI_entry() knows that it can provide all
|
||||
the needed functions if tablesize <= sizeof its own jump table. If tablesize is
|
||||
bigger (say, SDL 2.0.4 is trying to load SDL 2.0.3), then we know to abort, but
|
||||
bigger (say, SDL 3.0.4 is trying to load SDL 3.0.3), then we know to abort, but
|
||||
if it's smaller, we know we can provide the entire API that the caller needs.
|
||||
|
||||
The version variable is a failsafe switch.
|
||||
|
||||
@@ -59,11 +59,11 @@ Or with cmake:
|
||||
To build one of the tests:
|
||||
|
||||
$ cd test/
|
||||
$ emcc -O2 --js-opts 0 -g4 testdraw2.c -I../include ../build/.libs/libSDL2.a ../build/libSDL2_test.a -o a.html
|
||||
$ emcc -O2 --js-opts 0 -g4 testdraw2.c -I../include ../build/.libs/libSDL3.a ../build/libSDL3_test.a -o a.html
|
||||
|
||||
Uses GLES2 renderer or software
|
||||
|
||||
Some other SDL2 libraries can be easily built (assuming SDL2 is installed somewhere):
|
||||
Some other SDL3 libraries can be easily built (assuming SDL3 is installed somewhere):
|
||||
|
||||
SDL_mixer (http://www.libsdl.org/projects/SDL_mixer/):
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ The Windows GDK port supports the full set of Win32 APIs, renderers, controllers
|
||||
* Initializing/uninitializing the game runtime, and initializing Xbox Live services
|
||||
* Creating a global task queue and setting it as the default for the process. When running any async operations, passing in `NULL` as the task queue will make the task get added to the global task queue.
|
||||
|
||||
* An implementation on `WinMain` that performs the above GDK setup (you should link against SDL2main.lib, as in Windows x64). If you are unable to do this, you can instead manually call `SDL_GDKRunApp` from your entry point, passing in your `SDL_main` function and `NULL` as the parameters.
|
||||
* An implementation on `WinMain` that performs the above GDK setup (you should link against SDL3main.lib, as in Windows x64). If you are unable to do this, you can instead manually call `SDL_GDKRunApp` from your entry point, passing in your `SDL_main` function and `NULL` as the parameters.
|
||||
* Global task queue callbacks are dispatched during `SDL_PumpEvents` (which is also called internally if using `SDL_PollEvent`).
|
||||
* You can get the handle of the global task queue through `SDL_GDKGetTaskQueue`, if needed. When done with the queue, be sure to use `XTaskQueueCloseHandle` to decrement the reference count (otherwise it will cause a resource leak).
|
||||
|
||||
@@ -36,8 +36,8 @@ The Windows GDK port supports the full set of Win32 APIs, renderers, controllers
|
||||
|
||||
The included `VisualC-GDK/SDL.sln` solution includes the following targets for the Gaming.Desktop.x64 configuration:
|
||||
|
||||
* SDL2 (DLL) - This is the typical SDL2.dll, but for Gaming.Desktop.x64.
|
||||
* SDL2main (lib) - This contains a drop-in implementation of `WinMain` that is used as the entry point for GDK programs.
|
||||
* SDL3 (DLL) - This is the typical SDL3.dll, but for Gaming.Desktop.x64.
|
||||
* SDL3main (lib) - This contains a drop-in implementation of `WinMain` that is used as the entry point for GDK programs.
|
||||
* tests/testgamecontroller - Standard SDL test program demonstrating controller functionality.
|
||||
* tests/testgdk - GDK-specific test program that demonstrates using the global task queue to login a user into Xbox Live.
|
||||
*NOTE*: As of the June 2022 GDK, you cannot test user logins without a valid Title ID and MSAAppId. You will need to manually change the identifiers in the `MicrosoftGame.config` to your valid IDs from Partner Center if you wish to test this.
|
||||
@@ -54,21 +54,21 @@ These steps assume you already have a game using SDL that runs on Windows x64 al
|
||||
|
||||
In your game's existing Visual Studio Solution, go to Build > Configuration Manager. From the "Active solution platform" drop-down select "New...". From the drop-down list, select Gaming.Desktop.x64 and copy the settings from the x64 configuration.
|
||||
|
||||
### 2. Build SDL2 and SDL2main for GDK ###
|
||||
### 2. Build SDL3 and SDL3main for GDK ###
|
||||
|
||||
Open `VisualC-GDK/SDL.sln` in Visual Studio, you need to build the SDL2 and SDL2main targets for the Gaming.Desktop.x64 platform (Release is recommended). You will need to copy/keep track of the `SDL2.dll`, `XCurl.dll` (which is output by Gaming.Desktop.x64), `SDL2.lib`, and `SDL2main.lib` output files for your game project.
|
||||
Open `VisualC-GDK/SDL.sln` in Visual Studio, you need to build the SDL3 and SDL3main targets for the Gaming.Desktop.x64 platform (Release is recommended). You will need to copy/keep track of the `SDL3.dll`, `XCurl.dll` (which is output by Gaming.Desktop.x64), `SDL3.lib`, and `SDL3main.lib` output files for your game project.
|
||||
|
||||
*Alternatively*, you could setup your solution file to instead reference the SDL2/SDL2main project file targets from the SDL source, and add those projects as a dependency. This would mean that SDL2 and SDL2main would both be built when your game is built.
|
||||
*Alternatively*, you could setup your solution file to instead reference the SDL3/SDL3main project file targets from the SDL source, and add those projects as a dependency. This would mean that SDL3 and SDL3main would both be built when your game is built.
|
||||
|
||||
### 3. Configuring Project Settings ###
|
||||
|
||||
While the Gaming.Desktop.x64 configuration sets most of the required settings, there are some additional items to configure for your game project under the Gaming.Desktop.x64 Configuration:
|
||||
|
||||
* Under C/C++ > General > Additional Include Directories, make sure the `SDL/include` path is referenced
|
||||
* Under Linker > General > Additional Library Directories, make sure to reference the path where the newly-built SDL2.lib and SDL2main.lib are
|
||||
* Under Linker > General > Additional Library Directories, make sure to reference the path where the newly-built SDL3.lib and SDL3main.lib are
|
||||
* Under Linker > Input > Additional Dependencies, you need the following:
|
||||
* `SDL2.lib`
|
||||
* `SDL2main.lib` (unless not using)
|
||||
* `SDL3.lib`
|
||||
* `SDL3main.lib` (unless not using)
|
||||
* `xgameruntime.lib`
|
||||
* `../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib`
|
||||
* Note that in general, the GDK libraries depend on the MSVC C/C++ runtime, so there is no way to remove this dependency from a GDK program that links against GDK.
|
||||
@@ -81,7 +81,7 @@ Rather than using your own implementation of `WinMain`, it's recommended that yo
|
||||
|
||||
The game will not launch in the debugger unless required DLLs are included in the directory that contains the game's .exe file. You need to make sure that the following files are copied into the directory:
|
||||
|
||||
* Your SDL2.dll
|
||||
* Your SDL3.dll
|
||||
* "$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.141.GDK.C.Thunks.dll"
|
||||
* XCurl.dll
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ Using the Simple DirectMedia Layer for iOS
|
||||
3. Right click the project in the main view, select "Add Files...", and add the SDL project, Xcode/SDL/SDL.xcodeproj
|
||||
4. Select the project in the main view, go to the "Info" tab and under "Custom iOS Target Properties" remove the line "Main storyboard file base name"
|
||||
5. Select the project in the main view, go to the "Build Settings" tab, select "All", and edit "Header Search Path" and drag over the SDL "Public Headers" folder from the left
|
||||
6. Select the project in the main view, go to the "Build Phases" tab, select "Link Binary With Libraries", and add SDL2.framework from "Framework-iOS"
|
||||
6. Select the project in the main view, go to the "Build Phases" tab, select "Link Binary With Libraries", and add SDL3.framework from "Framework-iOS"
|
||||
7. Select the project in the main view, go to the "General" tab, scroll down to "Frameworks, Libraries, and Embedded Content", and select "Embed & Sign" for the SDL library.
|
||||
8. In the main view, expand SDL -> Library Source -> main -> uikit and drag SDL_uikit_main.c into your game files
|
||||
9. Add the source files that you would normally have for an SDL program, making sure to have #include "SDL.h" at the top of the file containing your main() function.
|
||||
@@ -194,15 +194,15 @@ http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOS
|
||||
Notes -- xcFramework
|
||||
==============================================================================
|
||||
|
||||
The SDL.xcodeproj file now includes a target to build SDL2.xcframework. An xcframework is a new (Xcode 11) uber-framework which can handle any combination of processor type and target OS platform.
|
||||
The SDL.xcodeproj file now includes a target to build SDL3.xcframework. An xcframework is a new (Xcode 11) uber-framework which can handle any combination of processor type and target OS platform.
|
||||
|
||||
In the past, iOS devices were always an ARM variant processor, and the simulator was always i386 or x86_64, and thus libraries could be combined into a single framework for both simulator and device. With the introduction of the Apple Silicon ARM-based machines, regular frameworks would collide as CPU type was no longer sufficient to differentiate the platform. So Apple created the new xcframework library package.
|
||||
|
||||
The xcframework target builds into a Products directory alongside the SDL.xcodeproj file, as SDL2.xcframework. This can be brought in to any iOS project and will function properly for both simulator and device, no matter their CPUs. Note that Intel Macs cannot cross-compile for Apple Silicon Macs. If you need AS compatibility, perform this build on an Apple Silicon Mac.
|
||||
The xcframework target builds into a Products directory alongside the SDL.xcodeproj file, as SDL3.xcframework. This can be brought in to any iOS project and will function properly for both simulator and device, no matter their CPUs. Note that Intel Macs cannot cross-compile for Apple Silicon Macs. If you need AS compatibility, perform this build on an Apple Silicon Mac.
|
||||
|
||||
This target requires Xcode 11 or later. The target will simply fail to build if attempted on older Xcodes.
|
||||
|
||||
In addition, on Apple platforms, main() cannot be in a dynamically loaded library. This means that iOS apps which used the statically-linked libSDL2.lib and now link with the xcframwork will need to define their own main() to call SDL_UIKitRunApp(), like this:
|
||||
In addition, on Apple platforms, main() cannot be in a dynamically loaded library. This means that iOS apps which used the statically-linked libSDL3.lib and now link with the xcframwork will need to define their own main() to call SDL_UIKitRunApp(), like this:
|
||||
|
||||
#ifndef SDL_MAIN_HANDLED
|
||||
#ifdef main
|
||||
|
||||
@@ -8,7 +8,7 @@ WSCONS support has been brought back, but only as an input backend. It will not
|
||||
OpenBSD note: Note that the video backend assumes that the user has read/write permissions to the /dev/drm* devices.
|
||||
|
||||
|
||||
SDL2 WSCONS input backend features
|
||||
SDL WSCONS input backend features
|
||||
===================================================
|
||||
1. It is keymap-aware; it will work properly with different keymaps.
|
||||
2. It has mouse support.
|
||||
|
||||
@@ -22,6 +22,6 @@ cmake --install build
|
||||
## Notes
|
||||
|
||||
- Currently only software rendering is supported.
|
||||
- SDL2main should be used to ensure ROMFS is enabled.
|
||||
- SDL3main should be used to ensure ROMFS is enabled.
|
||||
- By default, the extra L2 cache and higher clock speeds of the New 2/3DS lineup are enabled. If you wish to turn it off, use `osSetSpeedupEnable(false)` in your main function.
|
||||
- `SDL_GetBasePath` returns the romfs root instead of the executable's directory.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Nokia N-Gage
|
||||
============
|
||||
|
||||
SDL2 port for Symbian S60v1 and v2 with a main focus on the Nokia N-Gage
|
||||
SDL 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
|
||||
@@ -12,7 +12,7 @@ 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
|
||||
A complete example project based on SDL can be found in the GitHub
|
||||
account of the SDK: [Wordle](https://github.com/ngagesdk/wordle).
|
||||
|
||||
Current level of implementation
|
||||
|
||||
@@ -42,24 +42,21 @@ Installing:
|
||||
|
||||
- eComStation:
|
||||
|
||||
If you have previously installed SDL2, make a Backup copy of SDL2.dll
|
||||
If you have previously installed SDL3, make a Backup copy of SDL3.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
|
||||
Stop all programs running with SDL3. Copy SDL3.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 SDL3.dll to any directory on your LIBPATH. If you have a previous
|
||||
version installed, close all SDL3 applications before replacing the old
|
||||
copy. Also make sure that any other older versions of DLLs are removed
|
||||
from your system.
|
||||
|
||||
|
||||
Joysticks in SDL2:
|
||||
Joysticks:
|
||||
------------------
|
||||
|
||||
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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
PS2
|
||||
======
|
||||
SDL2 port for the Sony Playstation 2 contributed by:
|
||||
SDL port for the Sony Playstation 2 contributed by:
|
||||
- Francisco Javier Trujillo Mata
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ Credit to
|
||||
- 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:
|
||||
To build SDL 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
|
||||
@@ -48,4 +48,4 @@ Remember to do a clean compilation everytime you enable or disable the `SDL_PS2_
|
||||
## To Do
|
||||
- PS2 Screen Keyboard
|
||||
- Dialogs
|
||||
- Others
|
||||
- Others
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
PSP
|
||||
======
|
||||
SDL2 port for the Sony PSP contributed by:
|
||||
SDL port for the Sony PSP contributed by:
|
||||
- Captian Lex
|
||||
- Francisco Javier Trujillo Mata
|
||||
- Wouter Wijsman
|
||||
@@ -11,7 +11,7 @@ Credit to
|
||||
Geecko for his PSP GU lib "Glib2d"
|
||||
|
||||
## Building
|
||||
To build SDL2 library for the PSP, make sure you have the latest PSPDev status and run:
|
||||
To build SDL library for the PSP, make sure you have the latest PSPDev status and run:
|
||||
```bash
|
||||
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake
|
||||
cmake --build build
|
||||
@@ -33,4 +33,4 @@ cmake --install build
|
||||
|
||||
## To Do
|
||||
- PSP Screen Keyboard
|
||||
- Dialogs
|
||||
- Dialogs
|
||||
|
||||
@@ -81,13 +81,13 @@ The final step is compiling SDL itself.
|
||||
export CC="/opt/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc --sysroot=$SYSROOT -I$SYSROOT/opt/vc/include -I$SYSROOT/usr/include -I$SYSROOT/opt/vc/include/interface/vcos/pthreads -I$SYSROOT/opt/vc/include/interface/vmcs_host/linux"
|
||||
cd <SDL SOURCE>
|
||||
mkdir -p build;cd build
|
||||
LDFLAGS="-L$SYSROOT/opt/vc/lib" ../configure --with-sysroot=$SYSROOT --host=arm-raspberry-linux-gnueabihf --prefix=$PWD/rpi-sdl2-installed --disable-pulseaudio --disable-esd
|
||||
LDFLAGS="-L$SYSROOT/opt/vc/lib" ../configure --with-sysroot=$SYSROOT --host=arm-raspberry-linux-gnueabihf --prefix=$PWD/rpi-sdl3-installed --disable-pulseaudio --disable-esd
|
||||
make
|
||||
make install
|
||||
|
||||
To be able to deploy this to /usr/local in the Raspbian system you need to fix up a few paths:
|
||||
|
||||
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-sdl3-installed#/usr/local#g;" ./rpi-sdl3-installed/lib/libSDL3.la ./rpi-sdl3-installed/lib/pkgconfig/sdl3.pc ./rpi-sdl3-installed/bin/sdl3-config
|
||||
|
||||
Apps don't work or poor video/audio performance
|
||||
-----------------------------------------------
|
||||
|
||||
@@ -12,15 +12,15 @@ Requirements:
|
||||
Compiling:
|
||||
----------
|
||||
|
||||
Currently, SDL2 for RISC OS only supports compiling with GCCSDK under Linux. Both the autoconf and CMake build systems are supported.
|
||||
Currently, SDL 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:
|
||||
The following commands can be used to build SDL 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:
|
||||
The following commands can be used to build SDL 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
|
||||
|
||||
@@ -27,9 +27,9 @@ 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`
|
||||
- `./VisualC/Win32/Debug/SDL3.dll` or `./VisualC/Win32/Release/SDL3.dll`
|
||||
- `./VisualC/Win32/Debug/SDL3.lib` or `./VisualC/Win32/Release/SDL3.lib`
|
||||
- `./VisualC/Win32/Debug/SDL3main.lib` or `./VisualC/Win32/Release/SDL3main.lib`
|
||||
|
||||
_Note for the `x64` versions, just replace `Win32` in the path with `x64`_
|
||||
|
||||
@@ -59,12 +59,12 @@ Now we're going to use the files that we had created earlier in the *Build SDL*
|
||||
|
||||
Copy the following file into your Project directory:
|
||||
|
||||
- `SDL2.dll`
|
||||
- `SDL3.dll`
|
||||
|
||||
Add the following files to your project (It is not necessary to copy them to your project directory):
|
||||
|
||||
- `SDL2.lib`
|
||||
- `SDL2main.lib`
|
||||
- `SDL3.lib`
|
||||
- `SDL3main.lib`
|
||||
|
||||
To add them to your project, right click on your project, and select
|
||||
`Add files to project`.
|
||||
@@ -73,7 +73,7 @@ To add them to your project, right click on your project, and select
|
||||
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
|
||||
### Hello SDL
|
||||
|
||||
Here's a sample SDL snippet to verify everything is setup in your IDE:
|
||||
|
||||
@@ -88,7 +88,7 @@ Here's a sample SDL snippet to verify everything is setup in your IDE:
|
||||
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);
|
||||
window = SDL_CreateWindow("Hello SDL", 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);
|
||||
|
||||
@@ -272,8 +272,8 @@ To include these files for C/C++ projects:
|
||||
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`
|
||||
- `SDL3-WinRTResources.rc`
|
||||
- `SDL3-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"
|
||||
@@ -287,7 +287,7 @@ 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.**
|
||||
|
||||
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
|
||||
main function, and generate SDL3-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.
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ PROJECT_NAME = SDL
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER = 2.0
|
||||
PROJECT_NUMBER = 3.0
|
||||
|
||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
||||
# base path where the generated documentation will be put.
|
||||
@@ -868,14 +868,14 @@ GENERATE_DOCSET = NO
|
||||
# documentation sets from a single provider (such as a company or product suite)
|
||||
# can be grouped.
|
||||
|
||||
DOCSET_FEEDNAME = "SDL 2.0 Doxygen"
|
||||
DOCSET_FEEDNAME = "SDL 3.0 Doxygen"
|
||||
|
||||
# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
|
||||
# should uniquely identify the documentation set bundle. This should be a
|
||||
# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
|
||||
# will append .docset to the name.
|
||||
|
||||
DOCSET_BUNDLE_ID = org.libsdl.sdl20
|
||||
DOCSET_BUNDLE_ID = org.libsdl.sdl30
|
||||
|
||||
# If the GENERATE_HTMLHELP tag is set to YES, additional index files
|
||||
# will be generated that can be used as input for tools like the
|
||||
@@ -889,7 +889,7 @@ GENERATE_HTMLHELP = NO
|
||||
# can add a path in front of the file if the result should not be
|
||||
# written to the html output directory.
|
||||
|
||||
CHM_FILE = ./sdl20.chm
|
||||
CHM_FILE = ./sdl30.chm
|
||||
|
||||
# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
|
||||
# be used to specify the location (absolute path including file name) of
|
||||
|
||||
Reference in New Issue
Block a user