Skip to content

Commit

Permalink
Update SDL3 to 3.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dinau committed Oct 6, 2024
1 parent 1faddf0 commit 2263914
Show file tree
Hide file tree
Showing 139 changed files with 79,348 additions and 14 deletions.
27 changes: 13 additions & 14 deletions examples/sdl3_opengl3/build.zig
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Used zig-0.12.0 (2024/06)
// Used zig-0.14.0-dev (2024/10)
// Used zig-0.12.0 (2024/06)
//
const std = @import("std");
const builtin = @import("builtin");
Expand Down Expand Up @@ -41,15 +42,11 @@ pub fn build(b: *std.Build) void {
// Load Icon
exe.addWin32ResourceFile(.{ .file = b.path("src/res/res.rc")});
//----------------------------------
// Detect 32bit or 64bit Winddws OS
// 64bit Winddws OS
//----------------------------------
const sdlBase = "../../libs/sdl/sdl3";
var sArc:[]const u8 = "64";
if(builtin.cpu.arch == .x86){
sArc = "32";
}
const sdlDate = "2024-08-04";
const sdlPath = b.fmt("{s}/{s}/SDL3-{s}/SDL3", .{sdlBase, sArc, sdlDate});
const SDL3_VER = "3.1.3";
const sdlBase = "../../libs/sdl";
const sdlPath = b.fmt("{s}/SDL3-{s}/x86_64-w64-mingw32", .{sdlBase, SDL3_VER});
//---------------
// [imlibs] --- Include paths
//---------------
Expand Down Expand Up @@ -154,7 +151,7 @@ pub fn build(b: *std.Build) void {
//exe.addLibraryPath(b.path(b.pathJoin(&.{sdlPath, "lib-mingw-64"})));
//exe.linkSystemLibrary("SD32"); // For static link
// Static link
exe.addObjectFile(b.path(b.pathJoin(&.{sdlPath, "lib","SDL3.lib"})));
exe.addObjectFile(b.path(b.pathJoin(&.{sdlPath, "lib","libSDL3.a"})));
// Dynamic link
//exe.addObjectFile(b.path(b.pathJoin(&.{sdlPath, "lib","libSDL3dll.a"})));
//exe.linkSystemLibrary("SDL3dll"); // For dynamic link
Expand All @@ -166,7 +163,7 @@ pub fn build(b: *std.Build) void {
//
imlibs.linkLibC();
imlibs.linkLibCpp();
//exe.subsystem = .Windows; // Hide console window
exe.subsystem = .Windows; // Hide console window

// This declares intent for the executable to be installed into the
// standard location when the user invokes the "install" step (the default
Expand All @@ -177,7 +174,6 @@ pub fn build(b: *std.Build) void {
const resUtils = [_][]const u8{ "fonticon/fa6/fa-solid-900.ttf"
, "fonticon/fa6/LICENSE.txt"};
const resIcon = "src/res/z.png";
const resSdlDll = b.pathJoin(&.{sdlPath, "bin", "SDL3.dll"});

inline for(resBin)|file|{
const res = b.addInstallFile(b.path(file),"bin/" ++ file);
Expand All @@ -189,8 +185,11 @@ pub fn build(b: *std.Build) void {
}
const res = b.addInstallFile(b.path(resIcon), "bin/z.png");
b.getInstallStep().dependOn(&res.step);
const resSdl = b.addInstallFile(b.path(resSdlDll), "bin/SDL3.dll");
b.getInstallStep().dependOn(&resSdl.step);
if(false){// Enable if use SDL3.dll with dynamic linking.
const resSdlDll = b.pathJoin(&.{sdlPath, "bin", "SDL3.dll"});
const resSdl = b.addInstallFile(b.path(resSdlDll), "bin/SDL3.dll");
b.getInstallStep().dependOn(&resSdl.step);
}
//
// This *creates* a Run step in the build graph, to be executed when another
// step is evaluated that depends on it. The next line below will establish
Expand Down
1 change: 1 addition & 0 deletions libs/sdl/SDL3-3.1.3/.git-hash
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
e292d1f5ace469f718d7b6b4dec8c28e37dcaa0e
16 changes: 16 additions & 0 deletions libs/sdl/SDL3-3.1.3/BUGS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

Bugs are now managed in the SDL issue tracker, here:

https://github.com/libsdl-org/SDL/issues

You may report bugs there, and search to see if a given issue has already
been reported, discussed, and maybe even fixed.


You may also find help at the SDL forums/mailing list:

https://discourse.libsdl.org/

Bug reports are welcome here, but we really appreciate if you use the issue
tracker, as bugs discussed on the mailing list may be forgotten or missed.

34 changes: 34 additions & 0 deletions libs/sdl/SDL3-3.1.3/CREDITS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Simple DirectMedia Layer CREDITS

Thanks to everyone who made this possible, including:

- Cliff Matthews, for giving me a reason to start this project. :) -- Executor rocks! *grin*
- Ryan Gordon for helping everybody out and keeping the dream alive. :)
- Gabriel Jacobo for his work on the Android port and generally helping out all around.
- Philipp Wiesemann for his attention to detail reviewing the entire SDL code base and proposes patches.
- Andreas Schiffler for his dedication to unit tests, Visual Studio projects, and managing the Google Summer of Code.
- Mike Sartain for incorporating SDL into Team Fortress 2 and cheering me on at Valve.
- Alfred Reynolds for the game controller API and general (in)sanity
- Jørgen Tjernø¸ for numerous magical macOS fixes.
- Pierre-Loup Griffais for his deep knowledge of OpenGL drivers.
- Julian Winter for the SDL 2.0 website.
- Sheena Smith for many months of great work on the SDL wiki creating the API documentation and style guides.
- Paul Hunkin for his port of SDL to Android during the Google Summer of Code 2010.
- Eli Gottlieb for his work on shaped windows during the Google Summer of Code 2010.
- Jim Grandpre for his work on multi-touch and gesture recognition during
the Google Summer of Code 2010.
- Edgar "bobbens" Simo for his force feedback API development during the
Google Summer of Code 2008.
- Aaron Wishnick for his work on audio resampling and pitch shifting during
the Google Summer of Code 2008.
- Holmes Futrell for his port of SDL to the iPhone and iPod Touch during the
Google Summer of Code 2008.
- Jon Atkins for SDL_image, SDL_mixer and SDL_net documentation.
- Everybody at Loki Software, Inc. for their great contributions!

And a big hand to everyone else who has contributed over the years.

THANKS! :)

-- Sam Lantinga <slouken@libsdl.org>

25 changes: 25 additions & 0 deletions libs/sdl/SDL3-3.1.3/INSTALL.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

The 32-bit files are in i686-w64-mingw32
The 64-bit files are in x86_64-w64-mingw32

To install SDL for 32-bit x86 executables (i686):
make install-i686

To install SDL for 64-bit x86 executables (x86_64):
make install-x86_64

To install both:
make install-all

Use DESTDIR to change the target location
mkdir $HOME/mingw32-prefix
make install-i686 DESTDIR=$HOME/mingw32-prefix

Look at the example programs in ./test, and check out online documentation:
https://wiki.libsdl.org/SDL3/FrontPage

Join the SDL discourse server if you want to join the community:
https://discourse.libsdl.org/

That's it!
Sam Lantinga <slouken@libsdl.org>
18 changes: 18 additions & 0 deletions libs/sdl/SDL3-3.1.3/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.

37 changes: 37 additions & 0 deletions libs/sdl/SDL3-3.1.3/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#
# Makefile for installing the mingw32 version of the SDL library

DESTDIR = /usr/local
ARCHITECTURES := i686-w64-mingw32 x86_64-w64-mingw32

default:
@echo "Run \"make install-i686\" to install 32-bit"
@echo "Run \"make install-x86_64\" to install 64-bit"
@echo "Run \"make install-all\" to install both"
@echo "Add DESTDIR=/custom/path to change the destination folder"

install:
@if test -d $(ARCH) && test -d $(DESTDIR); then \
(cd $(ARCH) && cp -rv bin include lib share $(DESTDIR)/); \
else \
echo "*** ERROR: $(ARCH) or $(DESTDIR) does not exist!"; \
exit 1; \
fi

install-i686:
$(MAKE) install ARCH=i686-w64-mingw32

install-x86_64:
$(MAKE) install ARCH=x86_64-w64-mingw32

install-all:
@if test -d $(DESTDIR); then \
for arch in $(ARCHITECTURES); do \
$(MAKE) install ARCH=$$arch DESTDIR=$(DESTDIR)/$$arch; \
done \
else \
echo "*** ERROR: $(DESTDIR) does not exist!"; \
exit 1; \
fi

.PHONY: default install install-i686 install-x86_64 install-all
13 changes: 13 additions & 0 deletions libs/sdl/SDL3-3.1.3/README-SDL.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

Please distribute this file with the SDL runtime environment:

The Simple DirectMedia Layer (SDL for short) is a cross-platform library
designed to make it easy to write multi-media software, such as games
and emulators.

The Simple DirectMedia Layer library source code is available from:
https://www.libsdl.org/

This library is distributed under the terms of the zlib license:
http://www.zlib.net/zlib_license.html

17 changes: 17 additions & 0 deletions libs/sdl/SDL3-3.1.3/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

# Simple DirectMedia Layer (SDL) Version 3.0

https://www.libsdl.org/

Simple DirectMedia Layer is a cross-platform development library designed
to provide low level access to audio, keyboard, mouse, joystick, and graphics
hardware. It is used by video playback software, emulators, and popular games
including Valve's award winning catalog and many Humble Bundle games.

More extensive documentation is available in the docs directory, starting
with [README.md](docs/README.md). If you are migrating to SDL 3.0 from SDL 2.0,
the changes are extensively documented in [README-migration.md](docs/README-migration.md).

Enjoy!

Sam Lantinga (slouken@libsdl.org)
33 changes: 33 additions & 0 deletions libs/sdl/SDL3-3.1.3/WhatsNew.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

This is a list of major changes in SDL's version history.

---------------------------------------------------------------------------
3.1.0:
---------------------------------------------------------------------------

This is a preview release of the new SDL 3.0 API.

The ABI hasn't been locked down yet, but it's fairly stable and feedback is welcome!

Check out [migration guide](docs/README-migration.md) for details on API changes since SDL 2.0, and tips on transitioning your code from SDL2 code to SDL3.

There have been too many changes to list them all, but here are some of the highlights:
* The API has been significantly reworked to be easier to use and more consistent
* The 2D rendering API now has support for more advanced colorspaces and HDR rendering
* The 2D rendering API now has a Vulkan backend
* An example of hardware accelerated video playback using ffmpeg has been added in test/testffmpeg.c
* The shaped window API has been replaced with transparent windows
* Time and date functions have been added in SDL_time.h
* Support for webcam video recording has been added in SDL_camera.h
* Support for handling pens and tablets has been added in SDL_pen.h
* Support for file open and save dialogs has been added in SDL_dialog.h
* Cross-platform functions for working with files and directories are available in SDL_filesystem.h
* A cross-platform abstraction for working with user and game data has been added in SDL_storage.h
* Handling of main() has been moved to a header library and an optional callback-based program flow is available
* Support for simple object properties has been added in SDL_properties.h. These properties are available on many SDL objects, and can be used for more advanced functionality.

Please let us know about issues and feedback at: https://github.com/libsdl-org/SDL/issues

The development team is focused on code, moving towards the final release, and we would love volunteers to help improve the documentation. Please send e-mail to slouken@libsdl.org if you'd like to help out!

Finally, a giant thank you to all the people who have contributed code and feedback to the SDL 3.0 improvements!
19 changes: 19 additions & 0 deletions libs/sdl/SDL3-3.1.3/cmake/SDL3Config.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# SDL3 CMake configuration file:
# This file is meant to be placed in a cmake subfolder of SDL3-devel-3.x.y-mingw

if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(sdl3_config_path "${CMAKE_CURRENT_LIST_DIR}/../i686-w64-mingw32/lib/cmake/SDL3/SDL3Config.cmake")
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(sdl3_config_path "${CMAKE_CURRENT_LIST_DIR}/../x86_64-w64-mingw32/lib/cmake/SDL3/SDL3Config.cmake")
else()
set(SDL3_FOUND FALSE)
return()
endif()

if(NOT EXISTS "${sdl3_config_path}")
message(WARNING "${sdl3_config_path} does not exist: MinGW development package is corrupted")
set(SDL3_FOUND FALSE)
return()
endif()

include("${sdl3_config_path}")
19 changes: 19 additions & 0 deletions libs/sdl/SDL3-3.1.3/cmake/SDL3ConfigVersion.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# SDL3 CMake version configuration file:
# This file is meant to be placed in a cmake subfolder of SDL3-devel-3.x.y-mingw

if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(sdl3_config_path "${CMAKE_CURRENT_LIST_DIR}/../i686-w64-mingw32/lib/cmake/SDL3/SDL3ConfigVersion.cmake")
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(sdl3_config_path "${CMAKE_CURRENT_LIST_DIR}/../x86_64-w64-mingw32/lib/cmake/SDL3/SDL3ConfigVersion.cmake")
else()
set(PACKAGE_VERSION_UNSUITABLE TRUE)
return()
endif()

if(NOT EXISTS "${sdl3_config_path}")
message(WARNING "${sdl3_config_path} does not exist: MinGW development package is corrupted")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
return()
endif()

include("${sdl3_config_path}")
Loading

0 comments on commit 2263914

Please sign in to comment.