Merge branch 'main' of github.com:libsdl-org/SDL

This commit is contained in:
Coder2 2026-05-24 18:25:16 +08:00
commit 90fa7317c5
No known key found for this signature in database
GPG key ID: 98C112D1F699AA4C
442 changed files with 47266 additions and 8396 deletions

View file

@ -77,6 +77,11 @@ SpaceInEmptyParentheses: false
UseCRLF: false
UseTab: Never
IfMacros:
[
"CHECK_PARAM",
]
ForEachMacros:
[
"spa_list_for_each",

View file

@ -1,3 +1,5 @@
- [ ] I confirm that I am the author of this code and release it to the SDL project under the Zlib license. This contribution does not contain code from other sources, including code generated by a Large Language Model ("AI").
<!--- Provide a general summary of your changes in the Title above -->
## Description

View file

@ -0,0 +1,66 @@
name: 'Setup DJGPP toolchain'
description: 'Download DJGPP and setup CMake toolchain'
runs:
using: 'composite'
steps:
- name: 'Calculate variables'
id: calc
shell: sh
run: |
version="12.2.0"
case "${{ runner.os }}-${{ runner.arch }}" in
"Linux-X86")
archive="djgpp-linux32-gcc1220.tar.bz2"
;;
"Linux-X64")
archive="djgpp-linux64-gcc1220.tar.bz2"
;;
"macOS-X86" | "macOS-X64" | "macOS-ARM64")
archive="djgpp-osx-gcc1220.tar.bz2"
;;
"Windows-X86" | "Windows-X64")
archive="djgpp-mingw-gcc1220.zip"
;;
*)
echo "Unsupported ${{ runner.os }}-${{ runner.arch }}"
exit 1;
;;
esac
echo "url=https://github.com/andrewwutw/build-djgpp/releases/download/v3.4/${archive}" >> ${GITHUB_OUTPUT}
echo "archive=${archive}" >> ${GITHUB_OUTPUT}
echo "version=${version}" >> ${GITHUB_OUTPUT}
echo "cache-key=${archive}-${{ inputs.version }}-${{ runner.os }}-${{ runner.arch }}" >> ${GITHUB_OUTPUT}
- name: 'Restore cached ${{ steps.calc.outputs.archive }}'
id: cache-restore
uses: actions/cache/restore@v5
with:
path: '${{ runner.temp }}/${{ steps.calc.outputs.archive }}'
key: ${{ steps.calc.outputs.cache-key }}
- name: 'Download DJGPP ${{ steps.calc.outputs.version }} for ${{ runner.os }} (${{ runner.arch }})'
if: ${{ !steps.cache-restore.outputs.cache-hit || steps.cache-restore.outputs.cache-hit == 'false' }}
shell: pwsh
run: |
Invoke-WebRequest "${{ steps.calc.outputs.url }}" -OutFile "${{ runner.temp }}/${{ steps.calc.outputs.archive }}"
- name: 'Cache ${{ steps.calc.outputs.archive }}'
if: ${{ !steps.cache-restore.outputs.cache-hit || steps.cache-restore.outputs.cache-hit == 'false' }}
uses: actions/cache/save@v5
with:
path: '${{ runner.temp }}/${{ steps.calc.outputs.archive }}'
key: ${{ steps.calc.outputs.cache-key }}
- name: 'Extract DJGPP archive'
shell: pwsh
run: |
$archive = "${{ steps.calc.outputs.archive }}";
if ($archive.EndsWith(".bz2")) {
# Remove ".bz2" suffix
$tar_archive = $archive.Substring(0, $archive.Length - 4)
7z "-o${{ runner.temp }}" x "${{ runner.temp }}/${{ steps.calc.outputs.archive }}"
7z "-o${{ runner.temp }}" x "${{ runner.temp }}/$tar_archive"
} else {
7z "-o${{ runner.temp }}" x "${{ runner.temp }}/${{ steps.calc.outputs.archive }}"
}
- name: 'Set output variables'
id: final
shell: pwsh
run: |
echo "${{ runner.temp }}/djgpp/bin" >> $env:GITHUB_PATH

View file

@ -30,7 +30,7 @@ runs:
echo "cache-key=gdk-${{ inputs.ref }}-${{ inputs.edition }}" >> $Env:GITHUB_OUTPUT
- name: 'Restore cached GDK'
id: cache-restore
uses: actions/cache/restore@v4
uses: actions/cache/restore@v5
with:
path: '${{ steps.calc.outputs.gdk-path }}'
key: ${{ steps.calc.outputs.cache-key }}
@ -58,7 +58,7 @@ runs:
--no-user-props
- name: 'Cache GDK'
if: ${{ !steps.cache-restore.outputs.cache-hit }}
uses: actions/cache/save@v4
uses: actions/cache/save@v5
with:
path: '${{ steps.calc.outputs.gdk-path }}'
key: ${{ steps.calc.outputs.cache-key }}

View file

@ -17,7 +17,7 @@ outputs:
runs:
using: 'composite'
steps:
- uses: actions/cache/restore@v4
- uses: actions/cache/restore@v5
id: restore-cache
with:
path: /opt/cross-tools
@ -34,7 +34,7 @@ runs:
mkdir -p /opt
tar -C /opt -x -f /tmp/toolchain.tar.xz
- uses: actions/cache/save@v4
- uses: actions/cache/save@v5
if: ${{ !steps.restore-cache.outputs.cache-hit }}
with:
path: /opt/cross-tools

View file

@ -17,7 +17,7 @@ runs:
steps:
- name: 'Restore cached libusb-${{ inputs.version }}.7z'
id: cache-restore
uses: actions/cache/restore@v4
uses: actions/cache/restore@v5
with:
path: 'C:\temp\libusb-${{ inputs.version }}.7z'
key: libusb-msvc-${{ inputs.version }}
@ -28,7 +28,7 @@ runs:
Invoke-WebRequest "https://github.com/libusb/libusb/releases/download/v${{ inputs.version }}/libusb-${{ inputs.version }}.7z" -OutFile "C:\temp\libusb-${{ inputs.version }}.7z"
- name: 'Cache libusb-${{ inputs.version }}.7z'
if: ${{ !steps.cache-restore.outputs.cache-hit }}
uses: actions/cache/save@v4
uses: actions/cache/save@v5
with:
path: 'C:\temp\libusb-${{ inputs.version }}.7z'
key: libusb-msvc-${{ inputs.version }}

View file

@ -7,7 +7,7 @@ inputs:
runs:
using: 'composite'
steps:
- uses: actions/setup-python@v5
- uses: actions/setup-python@v6
with:
python-version: '3.x'
- name: 'Verify platform'
@ -52,7 +52,7 @@ runs:
echo "extras-branch=${extras_branch}" >> ${GITHUB_OUTPUT}
# - name: 'Restore cached ${{ steps.calc.outputs.archive }}'
# id: cache-restore
# uses: actions/cache/restore@v4
# uses: actions/cache/restore@v5
# with:
# path: '${{ runner.temp }}'
# key: ${{ steps.calc.outputs.cache-key }}
@ -68,7 +68,7 @@ runs:
# - name: 'Cache ${{ steps.calc.outputs.archive }}'
# if: ${{ !steps.cache-restore.outputs.cache-hit || steps.cache-restore.outputs.cache-hit == 'false' }}
# uses: actions/cache/save@v4
# uses: actions/cache/save@v5
# with:
# path: |
# ${{ runner.temp }}/apps.zip

View file

@ -36,7 +36,7 @@ runs:
echo "cache-key=${archive}-${{ inputs.version }}-${{ runner.os }}-${{ runner.arch }}" >> ${GITHUB_OUTPUT}
- name: 'Restore cached ${{ steps.calc.outputs.archive }}'
id: cache-restore
uses: actions/cache/restore@v4
uses: actions/cache/restore@v5
with:
path: '${{ runner.temp }}/${{ steps.calc.outputs.archive }}'
key: ${{ steps.calc.outputs.cache-key }}
@ -47,7 +47,7 @@ runs:
Invoke-WebRequest "https://github.com/ninja-build/ninja/releases/download/v${{ inputs.version }}/${{ steps.calc.outputs.archive }}" -OutFile "${{ runner.temp }}/${{ steps.calc.outputs.archive }}"
- name: 'Cache ${{ steps.calc.outputs.archive }}'
if: ${{ !steps.cache-restore.outputs.cache-hit || steps.cache-restore.outputs.cache-hit == 'false' }}
uses: actions/cache/save@v4
uses: actions/cache/save@v5
with:
path: '${{ runner.temp }}/${{ steps.calc.outputs.archive }}'
key: ${{ steps.calc.outputs.cache-key }}

View file

@ -33,7 +33,7 @@ runs:
exit 1
;;
esac
- uses: actions/cache/restore@v4
- uses: actions/cache/restore@v5
id: restore-cache
with:
path: /vita/dependencies
@ -81,7 +81,7 @@ runs:
wget https://github.com/SonicMastr/gl4es4vita/releases/download/v$gl4es4vita_version-vita/vitasdk_stubs.zip -P/tmp
unzip /tmp/vitasdk_stubs.zip -d/vita/dependencies/lib
- uses: actions/cache/save@v4
- uses: actions/cache/save@v5
if: ${{ !steps.restore-cache.outputs.cache-hit }}
with:
path: /vita/dependencies

View file

@ -7,10 +7,12 @@ import json
import logging
import os
import re
import shlex
from typing import Optional
logger = logging.getLogger(__name__)
WINDOWS_GAMEINPUT_VERSION = "v3.3.195.0 "
class AppleArch(Enum):
Aarch64 = "aarch64"
@ -41,6 +43,7 @@ class SdlPlatform(Enum):
Haiku = "haiku"
LoongArch64 = "loongarch64"
Msys2 = "msys2"
Cygwin = "cygwin"
Linux = "linux"
MacOS = "macos"
Ios = "ios"
@ -57,6 +60,7 @@ class SdlPlatform(Enum):
NetBSD = "netbsd"
OpenBSD = "openbsd"
NGage = "ngage"
DJGPP = "djgpp"
Harmony = "harmony"
@ -101,7 +105,6 @@ class JobSpec:
clang_cl: bool = False
gdk: bool = False
vita_gles: Optional[VitaGLES] = None
harmony_arch: Optional[str] = None
more_hard_deps: bool = False
@ -110,6 +113,7 @@ JOB_SPECS = {
"msys2-mingw64": JobSpec(name="Windows (msys2, mingw64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msys2, artifact="SDL-mingw64", msys2_platform=Msys2Platform.Mingw64, ),
"msys2-clang64": JobSpec(name="Windows (msys2, clang64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msys2, artifact="SDL-mingw64-clang", msys2_platform=Msys2Platform.Clang64, ),
"msys2-ucrt64": JobSpec(name="Windows (msys2, ucrt64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msys2, artifact="SDL-mingw64-ucrt", msys2_platform=Msys2Platform.Ucrt64, ),
"cygwin": JobSpec(name="Cygwin", os=JobOs.WindowsLatest, platform=SdlPlatform.Cygwin, artifact="SDL-cygwin", ),
"msvc-x64": JobSpec(name="Windows (MSVC, x64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-x64", msvc_arch=MsvcArch.X64, msvc_project="VisualC/SDL.sln", ),
"msvc-x86": JobSpec(name="Windows (MSVC, x86)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-x86", msvc_arch=MsvcArch.X86, msvc_project="VisualC/SDL.sln", ),
"msvc-clang-x64": JobSpec(name="Windows (MSVC, clang-cl x64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-clang-cl-x64", msvc_arch=MsvcArch.X64, clang_cl=True, ),
@ -150,6 +154,7 @@ JOB_SPECS = {
"openbsd": JobSpec(name="OpenBSD", os=JobOs.UbuntuLatest, platform=SdlPlatform.OpenBSD, artifact="SDL-openbsd-x64", ),
"freebsd": JobSpec(name="FreeBSD", os=JobOs.UbuntuLatest, platform=SdlPlatform.FreeBSD, artifact="SDL-freebsd-x64", ),
"ngage": JobSpec(name="N-Gage", os=JobOs.WindowsLatest, platform=SdlPlatform.NGage, artifact="SDL-ngage", ),
"djgpp": JobSpec(name="DOS (DJGPP)", os=JobOs.UbuntuLatest, platform=SdlPlatform.DJGPP, artifact="SDL-djgpp", ),
"harmony-arm64": JobSpec(name="Harmony (Arm64)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Harmony, artifact="SDL-harmony-arm64", harmony_arch="arm64-v8a"),
"harmony-arm32": JobSpec(name="Harmony (Arm32)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Harmony, artifact="SDL-harmony-arm32", harmony_arch="armeabi-v7a"),
"harmony-x86_64": JobSpec(name="Harmony (x86-64)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Harmony, artifact="SDL-harmony-x86_64", harmony_arch="x86_64"),
@ -163,6 +168,7 @@ class StaticLibType(Enum):
class SharedLibType(Enum):
WIN32 = "SDL3.dll"
CYGDLL = "cygSDL3.dll"
SO_0 = "libSDL3.so.0"
SO = "libSDL3.so"
DYLIB = "libSDL3.0.dylib"
@ -217,9 +223,10 @@ class JobDetails:
minidump: bool = False
intel: bool = False
msys2_msystem: str = ""
msys2_env: str = ""
msys2_no_perl: bool = False
msys2_packages: list[str] = dataclasses.field(default_factory=list)
cygwin_packages: list[str] = dataclasses.field(default_factory=list)
werror: bool = True
microsoft_gameinput_version: str = ""
msvc_vcvars_arch: str = ""
msvc_vcvars_sdk: str = ""
msvc_project: str = ""
@ -240,6 +247,7 @@ class JobDetails:
pypi_packages: list[str] = dataclasses.field(default_factory=list)
setup_gage_sdk_path: str = ""
binutils_strings: str = "strings"
ctest_args: str = ""
def to_workflow(self, enable_artifacts: bool) -> dict[str, str|bool]:
data = {
@ -253,8 +261,8 @@ class JobDetails:
"enable-artifacts": enable_artifacts,
"shell": self.shell,
"msys2-msystem": self.msys2_msystem,
"msys2-env": self.msys2_env,
"msys2-no-perl": self.msys2_no_perl,
"msys2-packages": my_shlex_join(self.msys2_packages),
"cygwin-packages": my_shlex_join(self.cygwin_packages),
"android-ndk": self.android_ndk,
"java": self.java,
"intel": self.intel,
@ -289,6 +297,7 @@ class JobDetails:
"android-mk": self.android_mk,
"werror": self.werror,
"sudo": self.sudo,
"microsoft-gameinput-version": self.microsoft_gameinput_version,
"msvc-vcvars-arch": self.msvc_vcvars_arch,
"msvc-vcvars-sdk": self.msvc_vcvars_sdk,
"msvc-project": self.msvc_project,
@ -310,6 +319,7 @@ class JobDetails:
"pypi-packages": my_shlex_join(self.pypi_packages),
"setup-ngage-sdk-path": self.setup_gage_sdk_path,
"binutils-strings": self.binutils_strings,
"ctest-args": self.ctest_args,
}
return {k: v for k, v in data.items() if v != ""}
@ -325,7 +335,7 @@ def my_shlex_join(s):
return " ".join(escape(s))
def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDetails:
def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool, ctest_args: list[str]) -> JobDetails:
job = JobDetails(
name=spec.name,
key=key,
@ -439,6 +449,9 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
job.setup_libusb_arch = "x86"
case MsvcArch.X64:
job.setup_libusb_arch = "x64"
job.microsoft_gameinput_version = WINDOWS_GAMEINPUT_VERSION
job.cflags.append("-I$GAMEINPUT_INCLUDE")
job.cxxflags.append("-I$GAMEINPUT_INCLUDE")
case SdlPlatform.Linux:
if spec.name.startswith("Ubuntu"):
assert spec.os.value.startswith("ubuntu-")
@ -494,6 +507,8 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
job.shared_lib = SharedLibType.SO_0
job.static_lib = StaticLibType.A
fpic = True
job.cmake_arguments.append("-DSDLTEST_GDB=ON")
job.apt_packages.append("gdb")
if spec.more_hard_deps:
# Some distros prefer to make important dependencies
# mandatory, so that SDL won't start up but lack expected
@ -744,15 +759,47 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
job.shell = "msys2 {0}"
assert spec.msys2_platform
job.msys2_msystem = spec.msys2_platform.value
job.msys2_env = {
job.shared_lib = SharedLibType.WIN32
job.static_lib = StaticLibType.A
msys2_env = {
"mingw32": "mingw-w64-i686",
"mingw64": "mingw-w64-x86_64",
"clang64": "mingw-w64-clang-x86_64",
"ucrt64": "mingw-w64-ucrt-x86_64",
}[spec.msys2_platform.value]
job.msys2_no_perl = spec.msys2_platform in (Msys2Platform.Mingw32, )
job.shared_lib = SharedLibType.WIN32
job.msys2_packages.extend([
f"{msys2_env}-cc",
f"{msys2_env}-cmake",
f"{msys2_env}-ffmpeg",
f"{msys2_env}-ninja",
f"{msys2_env}-pkg-config",
])
if spec.msys2_platform not in (Msys2Platform.Mingw32, ):
job.msys2_packages.append(f"{msys2_env}-perl")
job.msys2_packages.append(f"{msys2_env}-clang-tools-extra")
if job.ccache:
job.msys2_packages.append(f"{msys2_env}-ccache")
job.microsoft_gameinput_version = WINDOWS_GAMEINPUT_VERSION
job.cflags.append("-I$GAMEINPUT_INCLUDE")
job.cxxflags.append("-I$GAMEINPUT_INCLUDE")
case SdlPlatform.Cygwin:
job.ccache = False # Missing evict-older-than option
job.clang_tidy = False # error finding files [clang-diagnostic-error] cause might be space in command path
job.test_pkg_config = False # Linefeed issue in test_pkgconfig.sh
job.shell = "bash --noprofile --norc -eo pipefail -o igncr {0}"
job.shared_lib = SharedLibType.CYGDLL
job.static_lib = StaticLibType.A
job.cmake_arguments.append("-DSDLTEST_GDB=ON")
job.cygwin_packages.extend([
"cmake",
"gcc-core",
"gcc-g++",
"gdb",
"ninja",
"pkg-config",
"perl",
"python",
])
case SdlPlatform.Riscos:
job.ccache = False # FIXME: enable when container gets upgrade
# FIXME: Enable SDL_WERROR
@ -812,17 +859,20 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
job.setup_gage_sdk_path = "C:/ngagesdk"
job.cmake_toolchain_file = "C:/ngagesdk/cmake/ngage-toolchain.cmake"
job.test_pkg_config = False
case SdlPlatform.Harmony:
job.cmake_arguments.extend((
f"-DOHOS_ARCH={spec.harmony_arch}",
"-DCMAKE_TOOLCHAIN_FILE=/opt/native/build/cmake/ohos.toolchain.cmake",
"-DCMAKE_PLATFORM_NO_VERSIONED_SONAME=1"
))
job.shared_lib = SharedLibType.SO
case SdlPlatform.DJGPP:
build_parallel = False
job.ccache = True
job.apt_packages = ["ccache", "libfl-dev"] # djgpp needs libfl.so.2
job.cmake_build_type = "Release"
job.setup_ninja = True
job.static_lib = StaticLibType.A
job.shared_lib = None
job.clang_tidy = False
job.werror = False # FIXME: enable SDL_WERROR
job.shared = False
job.run_tests = False
job.test_pkg_config = False
job.werror = False
job.cmake_toolchain_file = "$GITHUB_WORKSPACE/build-scripts/i586-pc-msdosdjgpp.cmake"
case _:
raise ValueError(f"Unsupported platform={spec.platform}")
@ -835,6 +885,7 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
"-DCMAKE_C_COMPILER_LAUNCHER=ccache",
"-DCMAKE_CXX_COMPILER_LAUNCHER=ccache",
))
job.ctest_args = shlex.join(ctest_args)
if not build_parallel:
job.cmake_build_arguments.append("-j1")
if job.cflags or job.cppflags:
@ -857,9 +908,14 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
return job
def spec_to_platform(spec: JobSpec, key: str, enable_artifacts: bool, trackmem_symbol_names: bool) -> dict[str, str|bool]:
def spec_to_platform(spec: JobSpec, key: str, enable_artifacts: bool, trackmem_symbol_names: bool, ctest_args:list[str]) -> dict[str, str|bool]:
logger.info("spec=%r", spec)
job = spec_to_job(spec, key=key, trackmem_symbol_names=trackmem_symbol_names)
job = spec_to_job(
spec,
key=key,
trackmem_symbol_names=trackmem_symbol_names,
ctest_args=ctest_args,
)
logger.info("job=%r", job)
platform = job.to_workflow(enable_artifacts=enable_artifacts)
logger.info("platform=%r", platform)
@ -888,6 +944,7 @@ def main():
)
filters = []
ctest_args = []
if args.commit_message_file:
with open(args.commit_message_file, "r") as f:
commit_message = f.read()
@ -900,6 +957,9 @@ def main():
if re.search(r"\[sdl-ci-(full-)?trackmem(-symbol-names)?]", commit_message, flags=re.M):
args.trackmem_symbol_names = True
for m in re.finditer(r"\[sdl-ci-ctest-args? (.*)]", commit_message, flags=re.M):
ctest_args.extend(shlex.split(m.group(1)))
if not filters:
filters.append("*")
@ -907,7 +967,7 @@ def main():
all_level_platforms = {}
all_platforms = {key: spec_to_platform(spec, key=key, enable_artifacts=args.enable_artifacts, trackmem_symbol_names=args.trackmem_symbol_names) for key, spec in JOB_SPECS.items()}
all_platforms = {key: spec_to_platform(spec, key=key, enable_artifacts=args.enable_artifacts, trackmem_symbol_names=args.trackmem_symbol_names, ctest_args=ctest_args) for key, spec in JOB_SPECS.items()}
for level_i, level_keys in enumerate(all_level_keys, 1):
level_key = f"level{level_i}"

View file

@ -27,15 +27,12 @@ jobs:
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.platform.msys2-msystem }}
install: >-
${{ matrix.platform.msys2-env }}-cc
${{ matrix.platform.msys2-env }}-cmake
${{ matrix.platform.msys2-env }}-ffmpeg
${{ matrix.platform.msys2-env }}-ninja
${{ (!matrix.platform.msys2-no-perl && format('{0}-perl', matrix.platform.msys2-env)) || '' }}
${{ matrix.platform.msys2-env }}-pkg-config
${{ matrix.platform.msys2-env }}-clang-tools-extra
${{ (matrix.platform.ccache && format('{0}-ccache', matrix.platform.msys2-env)) || '' }}
install: ${{ matrix.platform.msys2-packages }}
- name: 'Set up Cygwin'
if: ${{ matrix.platform.platform == 'cygwin' }}
uses: cygwin/cygwin-install-action@master
with:
packages: ${{ matrix.platform.cygwin-packages }}
- name: 'About this job'
run: |
echo "key=${{ matrix.platform.key }}"
@ -43,7 +40,7 @@ jobs:
echo "os=${{ matrix.platform.os }}"
echo ""
echo "Add [sdl-ci-filter ${{ matrix.platform.key }}] to your commit message to reduce the number of jobs."
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: 'Set up ninja'
if: ${{ matrix.platform.setup-ninja }}
uses: ./.github/actions/setup-ninja
@ -52,6 +49,7 @@ jobs:
uses: ./.github/actions/setup-msvc-libusb
with:
arch: ${{ matrix.platform.setup-libusb-arch }}
- uses: mymindstorm/setup-emsdk@v15
- name: 'Set up Harmony toolchain'
if: ${{ matrix.platform.platform == 'harmony' }}
uses: ./.github/actions/setup-harmony-toolchain
@ -59,7 +57,7 @@ jobs:
if: ${{ matrix.platform.platform == 'emscripten' }}
with:
version: 3.1.35
- uses: browser-actions/setup-chrome@v1
- uses: browser-actions/setup-chrome@v2
id: setup-chrome
if: ${{ matrix.platform.platform == 'emscripten' }}
with:
@ -87,12 +85,12 @@ jobs:
run: |
# We cannot use GitHub expressions in the controller job
echo "ANDROID_NDK_HOME=${{ steps.setup-ndk.outputs.ndk-path }}" >>$GITHUB_ENV
- uses: actions/setup-java@v4
- uses: actions/setup-java@v5
if: ${{ matrix.platform.java }}
with:
distribution: 'temurin'
java-version: '17'
- uses: ilammy/msvc-dev-cmd@v1
- uses: TheMrMilchmann/setup-msvc-dev@v4
if: ${{ matrix.platform.platform == 'msvc' }}
with:
arch: ${{ matrix.platform.msvc-vcvars-arch }}
@ -111,6 +109,10 @@ jobs:
uses: ./.github/actions/setup-loongarch64-toolchain
id: setup-loongarch64-toolchain
if: ${{ matrix.platform.platform == 'loongarch64' }}
- name: 'Set up DJGPP toolchain'
uses: ./.github/actions/setup-djgpp-toolchain
id: setup-djgpp-toolchain
if: ${{ matrix.platform.platform == 'djgpp' }}
- name: 'Setup Intel oneAPI toolchain'
id: intel
if: ${{ matrix.platform.intel }}
@ -174,6 +176,14 @@ jobs:
echo '#error "System SDL headers must not be used by build system"' >"$dest"
done
done
- name: 'Set up Microsoft.GameInput headers'
if: ${{ matrix.platform.microsoft-gameinput-version != '' }}
run: |
python build-scripts/download-gameinput-headers.py \
--version ${{ matrix.platform.microsoft-gameinput-version }} \
-o $HOME/gameinput
echo "GAMEINPUT_INCLUDE=$(cygpath -w "$HOME/gameinput")" >>$GITHUB_ENV
echo "INCLUDE=$INCLUDE;$(cygpath -w "$HOME/gameinput")" >>$GITHUB_ENV
- name: 'Calculate ccache key'
if: ${{ matrix.platform.ccache }}
@ -182,7 +192,7 @@ jobs:
echo "timestamp=$(date -u "+%Y%m%d%H%M_%S")" >> "$GITHUB_OUTPUT"
- name: 'Restore ccache'
if: ${{ matrix.platform.ccache }}
uses: actions/cache/restore@v4
uses: actions/cache/restore@v5
id: restore-ccache
with:
path: ${{ runner.temp }}/ccache
@ -253,7 +263,7 @@ jobs:
${{ matrix.platform.pretest-cmd }}
set -eu
export SDL_TESTS_QUICK=1
ctest -VV --test-dir build/ -j2
ctest --test-dir build/ ${{ matrix.platform.ctest-args || '-VV -j2' }}
- name: "Build test apk's (CMake)"
id: apks
if: ${{ always() && steps.build.outcome == 'success' && matrix.platform.android-apks != '' }}
@ -330,7 +340,7 @@ jobs:
- name: 'Build (cross-platform-actions, BSD)'
id: cpactions
if: ${{ matrix.platform.cpactions }}
uses: cross-platform-actions/action@v0.29.0
uses: cross-platform-actions/action@v1
with:
operating_system: '${{ matrix.platform.cpactions-os }}'
architecture: '${{ matrix.platform.cpactions-arch }}'
@ -360,7 +370,7 @@ jobs:
- name: Add msbuild to PATH
id: setup-msbuild
if: ${{ matrix.platform.msvc-project != '' }}
uses: microsoft/setup-msbuild@v2
uses: microsoft/setup-msbuild@v3
- name: Build msbuild
if: ${{ matrix.platform.msvc-project != '' }}
run: |
@ -404,7 +414,7 @@ jobs:
ccache -s
- name: 'Save ccache'
if: ${{ matrix.platform.ccache }}
uses: actions/cache/save@v4
uses: actions/cache/save@v5
with:
path: ${{ runner.temp }}/ccache
key: ${{ steps.restore-ccache.outputs.cache-primary-key }}
@ -424,7 +434,7 @@ jobs:
run: |
find ./ -iname '*.so' | xargs -L1 ./build-scripts/check_elf_alignment.sh
- name: 'Upload binary package'
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
if: ${{ always() && matrix.platform.artifact != '' && (steps.package.outcome == 'success' || steps.cpactions.outcome == 'success') && (matrix.platform.enable-artifacts || steps.tests.outcome == 'failure') }}
with:
if-no-files-found: error
@ -433,14 +443,14 @@ jobs:
build/dist/SDL3*
build/include*
- name: 'Upload minidumps'
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
if: ${{ always() && steps.tests.outcome == 'failure' && (matrix.platform.platform == 'msvc' || matrix.platform.platform == 'msys2') }}
with:
if-no-files-found: ignore
name: '${{ matrix.platform.artifact }}-minidumps'
path: build/**/*.dmp
- name: "Upload Android test apk's"
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
if: ${{ matrix.platform.enable-artifacts && always() && matrix.platform.artifact != '' && steps.apks.outcome == 'success' }}
with:
if-no-files-found: error

View file

@ -20,15 +20,15 @@ jobs:
src-zip: ${{ steps.releaser.outputs.src-zip }}
steps:
- name: 'Set up Python'
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: 'Fetch build-release.py'
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
sparse-checkout: 'build-scripts/build-release.py'
- name: 'Set up SDL sources'
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
path: 'SDL'
fetch-depth: 0
@ -43,7 +43,7 @@ jobs:
--github \
--debug
- name: 'Store source archives'
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: sources
path: '${{ github.workspace}}/dist'
@ -61,7 +61,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Download source archives'
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
name: sources
path: '${{ github.workspace }}'
@ -114,15 +114,15 @@ jobs:
dmg: ${{ steps.releaser.outputs.dmg }}
steps:
- name: 'Set up Python'
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: 'Fetch build-release.py'
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
sparse-checkout: 'build-scripts/build-release.py'
- name: 'Download source archives'
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
name: sources
path: '${{ github.workspace }}'
@ -143,7 +143,7 @@ jobs:
--github \
--debug
- name: 'Store DMG image file'
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: dmg
path: '${{ github.workspace }}/dist'
@ -153,12 +153,12 @@ jobs:
runs-on: macos-latest
steps:
- name: 'Download source archives'
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
name: sources
path: '${{ github.workspace }}'
- name: 'Download ${{ needs.dmg.outputs.dmg }}'
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
name: dmg
path: '${{ github.workspace }}'
@ -322,15 +322,15 @@ jobs:
VC-devel: ${{ steps.releaser.outputs.VC-devel }}
steps:
- name: 'Set up Python'
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: 'Fetch build-release.py'
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
sparse-checkout: 'build-scripts/build-release.py'
- name: 'Download source archives'
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
name: sources
path: '${{ github.workspace }}'
@ -345,13 +345,13 @@ jobs:
id: releaser
run: |
python build-scripts/build-release.py `
--actions msvc `
--actions download msvc `
--commit ${{ inputs.commit }} `
--root "${{ steps.zip.outputs.path }}" `
--github `
--debug
- name: 'Store MSVC archives'
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: win32
path: '${{ github.workspace }}/dist'
@ -361,16 +361,16 @@ jobs:
runs-on: windows-latest
steps:
- name: 'Fetch .github/actions/setup-ninja/action.yml'
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
sparse-checkout: '.github/actions/setup-ninja/action.yml'
- name: 'Download source archives'
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
name: sources
path: '${{ github.workspace }}'
- name: 'Download MSVC binaries'
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
name: win32
path: '${{ github.workspace }}'
@ -391,7 +391,7 @@ jobs:
- name: Set up ninja
uses: ./.github/actions/setup-ninja
- name: 'Configure vcvars x86'
uses: ilammy/msvc-dev-cmd@v1
uses: TheMrMilchmann/setup-msvc-dev@v4
with:
arch: x64_x86
- name: 'CMake (configure + build + tests) x86'
@ -411,7 +411,7 @@ jobs:
cmake --build build_x86 --config Release --verbose
ctest --test-dir build_x86 --no-tests=error -C Release --output-on-failure
- name: 'Configure vcvars x64'
uses: ilammy/msvc-dev-cmd@v1
uses: TheMrMilchmann/setup-msvc-dev@v4
with:
arch: x64
- name: 'CMake (configure + build + tests) x64'
@ -431,7 +431,7 @@ jobs:
cmake --build build_x64 --config Release --verbose
ctest --test-dir build_x64 --no-tests=error -C Release --output-on-failure
- name: 'Configure vcvars arm64'
uses: ilammy/msvc-dev-cmd@v1
uses: TheMrMilchmann/setup-msvc-dev@v4
with:
arch: x64_arm64
- name: 'CMake (configure + build) arm64'
@ -481,11 +481,11 @@ jobs:
mingw-devel-tar-xz: ${{ steps.releaser.outputs.mingw-devel-tar-xz }}
steps:
- name: 'Set up Python'
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: 'Fetch build-release.py'
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
sparse-checkout: 'build-scripts/build-release.py'
- name: 'Install Mingw toolchain'
@ -493,7 +493,7 @@ jobs:
sudo apt-get update -y
sudo apt-get install -y gcc-mingw-w64 g++-mingw-w64 ninja-build
- name: 'Download source archives'
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
name: sources
path: '${{ github.workspace }}'
@ -507,13 +507,13 @@ jobs:
id: releaser
run: |
python build-scripts/build-release.py \
--actions mingw \
--actions download mingw \
--commit ${{ inputs.commit }} \
--root "${{ steps.tar.outputs.path }}" \
--github \
--debug
- name: 'Store MinGW archives'
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: mingw
path: '${{ github.workspace }}/dist'
@ -527,12 +527,12 @@ jobs:
sudo apt-get update -y
sudo apt-get install -y gcc-mingw-w64 g++-mingw-w64 ninja-build
- name: 'Download source archives'
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
name: sources
path: '${{ github.workspace }}'
- name: 'Download MinGW binaries'
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
name: mingw
path: '${{ github.workspace }}'
@ -582,11 +582,11 @@ jobs:
android-aar: ${{ steps.releaser.outputs.android-aar }}
steps:
- name: 'Set up Python'
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: 'Fetch build-release.py'
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
sparse-checkout: 'build-scripts/build-release.py'
- name: 'Setup Android NDK'
@ -596,7 +596,7 @@ jobs:
local-cache: false
ndk-version: r28c
- name: 'Setup Java JDK'
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '11'
@ -605,7 +605,7 @@ jobs:
sudo apt-get update -y
sudo apt-get install -y ninja-build
- name: 'Download source archives'
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
name: sources
path: '${{ github.workspace }}'
@ -619,7 +619,7 @@ jobs:
id: releaser
run: |
python build-scripts/build-release.py \
--actions android \
--actions download android \
--android-api 21 \
--android-ndk-home "${{ steps.setup-ndk.outputs.ndk-path }}" \
--commit ${{ inputs.commit }} \
@ -627,7 +627,7 @@ jobs:
--github \
--debug
- name: 'Store Android archive(s)'
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: android
path: '${{ github.workspace }}/dist'
@ -637,20 +637,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Set up Python'
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.11'
- uses: actions/setup-java@v4
- uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '17'
- name: 'Download source archives'
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
name: sources
path: '${{ github.workspace }}'
- name: 'Download Android .aar archive'
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
name: android
path: '${{ github.workspace }}'

20
AGENTS.md Normal file
View file

@ -0,0 +1,20 @@
AI must not be used to generate code for contributions to this project.
"AI" in this case means a Large Language Model ("LLM"), such as ChatGPT,
Claude, Copilot, Grok, etc.
AI-generated code is based upon sources of unknown origins and may not be
compatible with the Zlib license, or may introduce conflicting license terms
if they include code from other projects.
AI can be used to identify issues with contributions to this project, but the
solutions to those issues should be authored by humans.
We have found that AI will frequently hallucinate issues that are not actually
problems in practice, report incorrect information, and describe problems that
are actually not issues at all. If AI identifies a problem with this codebase,
please make sure you understand what it is saying and have independently
confirmed that the issue exists before submitting a bug report or pull request.
Any pull request to this project will ask you to confirm that you are the
author and that you are contributing your changes under the Zlib license.

View file

@ -84,6 +84,7 @@ LOCAL_SRC_FILES := \
$(wildcard $(LOCAL_PATH)/src/tray/*.c) \
$(wildcard $(LOCAL_PATH)/src/video/*.c) \
$(wildcard $(LOCAL_PATH)/src/video/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/video/arm/*.c) \
$(wildcard $(LOCAL_PATH)/src/video/yuv2rgb/*.c))
LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES

22
CLAUDE.md Normal file
View file

@ -0,0 +1,22 @@
AI must not be used to generate code for contributions to this project.
"AI" in this case means a Large Language Model ("LLM"), such as ChatGPT,
Claude, Copilot, Grok, etc.
AI-generated code is based upon sources of unknown origins and may not be
compatible with the Zlib license, or may introduce conflicting license terms
if they include code from other projects.
AI can be used to identify issues with contributions to this project, but the
solutions to those issues should be authored by humans.
We have found that AI will frequently hallucinate issues that are not actually
problems in practice, report incorrect information, and describe problems that
are actually not issues at all. If AI identifies a problem with this codebase,
please make sure you understand what it is saying and have independently
confirmed that the issue exists before submitting a bug report or pull request.
Any pull request to this project will ask you to confirm that you are the
author and that you are contributing your changes under the Zlib license.

View file

@ -50,6 +50,7 @@ include(CheckIncludeFiles)
include(CheckLanguage)
include(CheckSymbolExists)
include(CheckCSourceCompiles)
include(CheckCXXSourceCompiles)
include(CheckCSourceRuns)
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
@ -78,6 +79,7 @@ include("${SDL3_SOURCE_DIR}/cmake/3rdparty.cmake")
include("${SDL3_SOURCE_DIR}/cmake/PreseedMSVCCache.cmake")
include("${SDL3_SOURCE_DIR}/cmake/PreseedEmscriptenCache.cmake")
include("${SDL3_SOURCE_DIR}/cmake/PreseedNokiaNGageCache.cmake")
include("${SDL3_SOURCE_DIR}/cmake/PreseedDOSCache.cmake")
SDL_DetectCompiler()
SDL_DetectTargetCPUArchitectures(SDL_CPUS)
@ -163,7 +165,7 @@ endif()
# The hidraw support doesn't catch Xbox, PS4 and Nintendo controllers,
# so we'll just use libusb when it's available. libusb does not support iOS,
# so we default to yes on iOS.
if(IOS OR TVOS OR VISIONOS OR WATCHOS OR ANDROID OR NGAGE)
if(IOS OR TVOS OR VISIONOS OR WATCHOS OR ANDROID OR NGAGE OR DOS)
set(SDL_HIDAPI_LIBUSB_AVAILABLE FALSE)
else()
set(SDL_HIDAPI_LIBUSB_AVAILABLE TRUE)
@ -207,7 +209,7 @@ if(EMSCRIPTEN)
set(SDL_SHARED_AVAILABLE OFF)
endif()
if(VITA OR PSP OR PS2 OR N3DS OR RISCOS OR NGAGE)
if(VITA OR PSP OR PS2 OR N3DS OR RISCOS OR NGAGE OR DOS)
set(SDL_SHARED_AVAILABLE OFF)
endif()
@ -282,8 +284,11 @@ if(COMMAND SDL_Preseed_CMakeCache)
set(SDL_PRESEED_AVAILABLE ON)
endif()
set(SDL_VULKAN_DEFAULT ON)
set(SDL_X11_XRANDR_DEFAULT ON)
if(SOLARIS)
set(SDL_VULKAN_DEFAULT OFF)
set(SDL_X11_XRANDR_DEFAULT OFF)
endif()
@ -310,6 +315,7 @@ dep_option(SDL_SSE4_2 "Use SSE4.2 assembly routines" ON "SDL_ASSEMB
dep_option(SDL_MMX "Use MMX assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_X86 OR SDL_CPU_X64" OFF)
dep_option(SDL_ALTIVEC "Use Altivec assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_POWERPC32 OR SDL_CPU_POWERPC64" OFF)
dep_option(SDL_ARMNEON "Use NEON assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_ARM32 OR SDL_CPU_ARM64" OFF)
dep_option(SDL_ARMSVE2 "Use SVE2 assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_ARM64" OFF)
dep_option(SDL_LSX "Use LSX assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_LOONGARCH64" OFF)
dep_option(SDL_LASX "Use LASX assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_LOONGARCH64" OFF)
@ -363,16 +369,16 @@ dep_option(SDL_WAYLAND_LIBDECOR_SHARED "Dynamically load libdecor support" O
dep_option(SDL_RPI "Use Raspberry Pi video driver" ON "SDL_VIDEO;UNIX_SYS;SDL_CPU_ARM32 OR SDL_CPU_ARM64" OFF)
dep_option(SDL_ROCKCHIP "Use ROCKCHIP Hardware Acceleration video driver" ON "SDL_VIDEO;UNIX_SYS;SDL_CPU_ARM32 OR SDL_CPU_ARM64" OFF)
dep_option(SDL_COCOA "Use Cocoa video driver" ON "APPLE" OFF)
dep_option(SDL_DIRECTX "Use DirectX for Windows audio/video" ON "SDL_AUDIO OR SDL_VIDEO;WINDOWS" OFF)
dep_option(SDL_XINPUT "Use Xinput for Windows" ON "WINDOWS" OFF)
dep_option(SDL_WASAPI "Use the Windows WASAPI audio driver" ON "WINDOWS;SDL_AUDIO" OFF)
dep_option(SDL_DIRECTX "Use DirectX for Windows audio/video" ON "SDL_AUDIO OR SDL_VIDEO;WINDOWS OR CYGWIN" OFF)
dep_option(SDL_XINPUT "Use Xinput for Windows" ON "WINDOWS OR CYGWIN" OFF)
dep_option(SDL_WASAPI "Use the Windows WASAPI audio driver" ON "WINDOWS OR CYGWIN;SDL_AUDIO" OFF)
dep_option(SDL_RENDER_D3D "Enable the Direct3D 9 render driver" ON "SDL_RENDER;SDL_DIRECTX" OFF)
dep_option(SDL_RENDER_D3D11 "Enable the Direct3D 11 render driver" ON "SDL_RENDER;SDL_DIRECTX" OFF)
dep_option(SDL_RENDER_D3D12 "Enable the Direct3D 12 render driver" ON "SDL_RENDER;SDL_DIRECTX" OFF)
dep_option(SDL_RENDER_METAL "Enable the Metal render driver" ON "SDL_RENDER;APPLE" OFF)
dep_option(SDL_RENDER_GPU "Enable the SDL_GPU render driver" ON "SDL_RENDER;SDL_GPU" OFF)
dep_option(SDL_VIVANTE "Use Vivante EGL video driver" ON "${UNIX_SYS};SDL_CPU_ARM32" OFF)
dep_option(SDL_VULKAN "Enable Vulkan support" ON "SDL_VIDEO;ANDROID OR APPLE OR LINUX OR FREEBSD OR OPENBSD OR WINDOWS" OFF)
dep_option(SDL_VULKAN "Enable Vulkan support" "${SDL_VULKAN_DEFAULT}" "SDL_VIDEO;ANDROID OR APPLE OR LINUX OR FREEBSD OR OPENBSD OR WINDOWS OR CYGWIN" OFF)
dep_option(SDL_RENDER_VULKAN "Enable the Vulkan render driver" ON "SDL_RENDER;SDL_VULKAN" OFF)
dep_option(SDL_METAL "Enable Metal support" ON "APPLE" OFF)
set_option(SDL_OPENVR "Use OpenVR video driver" OFF)
@ -393,6 +399,10 @@ set_option(SDL_CCACHE "Use Ccache to speed up build" OFF)
set_option(SDL_CLANG_TIDY "Run clang-tidy static analysis" OFF)
dep_option(SDL_GPU_OPENXR "Build SDL_GPU with OpenXR support" ON "SDL_GPU;NOT RISCOS" OFF)
if(EMSCRIPTEN)
option_string(SDL_EMSCRIPTEN_PERSISTENT_PATH "Path to mount Emscripten IDBFS at startup or '' to disable" "")
endif()
set(SDL_VENDOR_INFO "" CACHE STRING "Vendor name and/or version to add to SDL_REVISION")
if(DEFINED CACHE{SDL_SHARED} OR DEFINED CACHE{SDL_STATIC})
@ -421,6 +431,21 @@ if(VITA)
set_option(VIDEO_VITA_PVR "Build with PSVita PVR gles/gles2 support" OFF)
endif()
if(DOS)
set(SDL_GPU OFF)
set(SDL_CAMERA OFF)
set(SDL_HAPTIC OFF)
set(SDL_HIDAPI OFF)
set(SDL_POWER OFF)
set(SDL_SENSOR OFF)
set(SDL_DIALOG OFF)
set(SDL_DUMMYCAMERA OFF)
set(SDL_OFFSCREEN OFF)
set(SDL_RENDER_GPU OFF)
set(SDL_TRAY OFF)
set(SDL_PROCESS OFF)
endif()
if (NGAGE)
set(SDL_GPU OFF)
set(SDL_CAMERA OFF)
@ -540,19 +565,6 @@ else()
endif()
endif()
if(CYGWIN)
# We build SDL on cygwin without the UNIX emulation layer
sdl_include_directories(PUBLIC SYSTEM "/usr/include/mingw")
cmake_push_check_state()
string(APPEND CMAKE_REQUIRED_FLAGS " -mno-cygwin")
check_c_source_compiles("int main(int argc, char **argv) { return 0; }"
HAVE_GCC_NO_CYGWIN)
cmake_pop_check_state()
if(HAVE_GCC_NO_CYGWIN)
sdl_shared_link_options("-mno-cygwin")
endif()
endif()
# General includes
sdl_compile_definitions(PRIVATE "USING_GENERATED_CONFIG_H")
sdl_include_directories(
@ -916,6 +928,37 @@ if(SDL_ASSEMBLY)
endif()
endif()
if(SDL_ARMSVE2)
cmake_push_check_state()
string(APPEND CMAKE_REQUIRED_FLAGS " -march=armv8-a+sve2")
check_arm_source_compiles([==[
#include <arm_sve.h>
svuint32_t sve2_test(svuint32_t a, svuint32_t b) {
return svadd_u32_x(svptrue_b32(), a, b);
}
int main(int argc, char *argv[]) {
sve2_test(svdup_u32(0), svdup_u32(0));
return 0;
}]==] COMPILER_SUPPORTS_ARMSVE2)
if(COMPILER_SUPPORTS_ARMSVE2)
set(HAVE_ARMSVE2 TRUE)
endif()
cmake_pop_check_state()
if(HAVE_ARMSVE2)
sdl_sources(
"${SDL3_SOURCE_DIR}/src/video/arm/SDL_sve2_blit_A.c"
"${SDL3_SOURCE_DIR}/src/video/arm/SDL_sve2_blit_N.c"
)
set_source_files_properties(
"${SDL3_SOURCE_DIR}/src/video/arm/SDL_sve2_blit_A.c"
"${SDL3_SOURCE_DIR}/src/video/arm/SDL_sve2_blit_N.c"
PROPERTIES
SKIP_PRECOMPILE_HEADERS ON
)
endif()
endif()
if(USE_GCC OR USE_CLANG)
# TODO: Those all seem to be quite GCC specific - needs to be
# reworked for better compiler support
@ -1032,6 +1075,10 @@ if(NOT HAVE_ARMNEON)
set(SDL_DISABLE_NEON 1)
endif()
if(NOT HAVE_ARMSVE2)
set(SDL_DISABLE_SVE2 1)
endif()
set(SDL_DISABLE_ALLOCA 0)
check_include_file("alloca.h" "HAVE_ALLOCA_H")
if(MSVC)
@ -1092,8 +1139,8 @@ if(SDL_LIBC)
_Exit exp expf
fabs fabsf floor floorf fmod fmodf fopen64 fseeko fseeko64
getenv
_i64toa index itoa
log log10 log10f logf lround lroundf _ltoa
_i64toa _i64toa_s index itoa _itoa_s
log log10 log10f logf lround lroundf _ltoa _ltoa_s
malloc memcmp memcpy memmove memset modf modff
pow powf putenv
rindex round roundf
@ -1105,9 +1152,9 @@ if(SDL_LIBC)
vsnprintf vsscanf
wcsnlen wcscmp wcsdup wcslcat wcslcpy wcslen wcsncmp wcsstr wcstol
)
if(WINDOWS)
if(WINDOWS OR CYGWIN)
list(APPEND symbols_to_check
_copysign _fseeki64 _strrev _ui64toa _uitoa _ultoa _wcsdup
_copysign _fseeki64 _strrev _ui64toa _ui64toa_s _uitoa _ultoa _ultoa_s _wcsdup
)
else()
list(APPEND symbols_to_check
@ -1189,34 +1236,33 @@ if(SDL_LIBC)
check_symbol_exists(posix_fallocate "fcntl.h" HAVE_POSIX_FALLOCATE)
check_symbol_exists(posix_spawn_file_actions_addchdir "spawn.h" HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR)
check_symbol_exists(posix_spawn_file_actions_addchdir_np "spawn.h" HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR_NP)
endif()
if(SDL_SYSTEM_ICONV)
check_c_source_compiles("
#define LIBICONV_PLUG 1 /* in case libiconv header is in include path */
#include <stddef.h>
#include <iconv.h>
int main(int argc, char **argv) {
return !iconv_open(NULL,NULL);
}" ICONV_IN_LIBC)
if(SDL_SYSTEM_ICONV)
check_c_source_compiles("
#define LIBICONV_PLUG 1 /* in case libiconv header is in include path */
#include <stddef.h>
#include <iconv.h>
int main(int argc, char **argv) {
return !iconv_open(NULL,NULL);
}" ICONV_IN_LIBC)
cmake_push_check_state()
list(APPEND CMAKE_REQUIRED_LIBRARIES iconv)
check_c_source_compiles("
#include <stddef.h>
#include <iconv.h>
int main(int argc, char **argv) {
return !iconv_open(NULL,NULL);
}" ICONV_IN_LIBICONV)
cmake_pop_check_state()
cmake_push_check_state()
list(APPEND CMAKE_REQUIRED_LIBRARIES iconv)
check_c_source_compiles("
#include <stddef.h>
#include <iconv.h>
int main(int argc, char **argv) {
return !iconv_open(NULL,NULL);
}" ICONV_IN_LIBICONV)
cmake_pop_check_state()
if(ICONV_IN_LIBC OR ICONV_IN_LIBICONV)
set(HAVE_ICONV 1)
set(HAVE_SYSTEM_ICONV TRUE)
if(ICONV_IN_LIBICONV AND (SDL_LIBICONV OR (NOT ICONV_IN_LIBC)))
sdl_link_dependency(iconv LIBS iconv)
set(SDL_USE_LIBICONV 1)
set(HAVE_LIBICONV TRUE)
endif()
if(ICONV_IN_LIBC OR ICONV_IN_LIBICONV)
set(HAVE_ICONV 1)
set(HAVE_SYSTEM_ICONV TRUE)
if(ICONV_IN_LIBICONV AND (SDL_LIBICONV OR (NOT ICONV_IN_LIBC)))
sdl_link_dependency(iconv LIBS iconv)
set(SDL_USE_LIBICONV 1)
set(HAVE_LIBICONV TRUE)
endif()
endif()
@ -1385,7 +1431,7 @@ if(SDL_CAMERA)
#endif()
endif()
if(UNIX OR APPLE)
if((UNIX OR APPLE) AND NOT CYGWIN)
# Relevant for Unix/Darwin only
set(DYNAPI_NEEDS_DLOPEN 1)
CheckDLOPEN()
@ -1746,6 +1792,11 @@ elseif(EMSCRIPTEN)
# project. Uncomment at will for verbose cross-compiling -I/../ path info.
sdl_compile_options(PRIVATE "-Wno-warn-absolute-paths")
if(NOT SDL_EMSCRIPTEN_PERSISTENT_PATH STREQUAL "")
set(SDL_EMSCRIPTEN_PERSISTENT_PATH_STRING "${SDL_EMSCRIPTEN_PERSISTENT_PATH}")
sdl_link_dependency(idbfs LIBS idbfs.js)
endif()
sdl_glob_sources(
"${SDL3_SOURCE_DIR}/src/main/emscripten/*.c"
"${SDL3_SOURCE_DIR}/src/main/emscripten/*.h"
@ -1857,7 +1908,7 @@ elseif(EMSCRIPTEN)
CheckPTHREAD()
CheckLibUnwind()
elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
elseif(UNIX AND NOT (APPLE OR RISCOS OR HAIKU OR CYGWIN))
set(SDL_DISABLE_DLOPEN_NOTES TRUE)
if(SDL_DLOPEN_NOTES)
@ -2248,7 +2299,7 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
set (HAVE_VSNPRINTF 0)
set (USE_POSIX_SPAWN 1)
endif()
elseif(WINDOWS)
elseif(WINDOWS OR CYGWIN)
enable_language(CXX)
check_c_source_compiles("
#include <windows.h>
@ -2282,7 +2333,7 @@ elseif(WINDOWS)
if(DEFINED MSVC_VERSION AND NOT ${MSVC_VERSION} LESS 1700)
set(USE_WINSDK_DIRECTX TRUE)
endif()
if(NOT MINGW AND NOT USE_WINSDK_DIRECTX)
if(NOT (MINGW OR CYGWIN) AND NOT USE_WINSDK_DIRECTX)
if("$ENV{DXSDK_DIR}" STREQUAL "")
message(FATAL_ERROR "DIRECTX requires the \$DXSDK_DIR environment variable to be set")
endif()
@ -2301,7 +2352,7 @@ elseif(WINDOWS)
cmake_pop_check_state()
if(HAVE_D3D9_H OR HAVE_D3D11_H OR HAVE_DDRAW_H OR HAVE_DSOUND_H OR HAVE_DINPUT_H)
set(HAVE_DIRECTX TRUE)
if(NOT MINGW AND NOT USE_WINSDK_DIRECTX)
if(NOT (MINGW OR CYGWIN) AND NOT USE_WINSDK_DIRECTX)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(PROCESSOR_ARCH "x64")
else()
@ -2329,7 +2380,7 @@ elseif(WINDOWS)
static __x_ABI_CWindows_CGaming_CInput_CIGamepadStatics2 *s2;
int main(int argc, char **argv) { return 0; }" HAVE_WINDOWS_GAMING_INPUT_H
)
check_c_source_compiles("
check_cxx_source_compiles("
#include <stdbool.h>
#define COBJMACROS
#include <gameinput.h>
@ -2804,13 +2855,6 @@ elseif(APPLE)
set(SDL_VIDEO_RENDER_METAL 1)
set(HAVE_RENDER_METAL TRUE)
endif()
if (SDL_GPU)
set(SDL_GPU_METAL 1)
sdl_glob_sources(
"${SDL3_SOURCE_DIR}/src/gpu/metal/*.m"
"${SDL3_SOURCE_DIR}/src/gpu/metal/*.h"
)
endif()
endif()
endif()
endif()
@ -3327,6 +3371,7 @@ elseif(PS2)
gskit
dmakit
ps2_drivers
atomic
)
elseif(N3DS)
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/main/n3ds/*.c")
@ -3407,6 +3452,51 @@ elseif(N3DS)
"${SDL3_SOURCE_DIR}/src/io/n3ds/*.h"
)
elseif(DOS)
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/main/dos/*.c")
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/core/dos/*.c")
set(SDL_AUDIO_DRIVER_DOS_SOUNDBLASTER 1)
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/audio/dos/*.c")
set(HAVE_SDL_AUDIO TRUE)
set(SDL_VIDEO_DRIVER_DOSVESA 1)
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/video/dos/*.c")
set(HAVE_SDL_VIDEO TRUE)
set(SDL_FSOPS_POSIX 1)
sdl_sources("${SDL3_SOURCE_DIR}/src/filesystem/posix/SDL_sysfsops.c")
set(HAVE_SDL_FSOPS TRUE)
set(SDL_FILESYSTEM_DOS 1)
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/filesystem/dos/*.c")
set(HAVE_SDL_FILESYSTEM TRUE)
# Wall-clock time (SDL_GetDateTimeLocalized etc.) reuses the Unix implementation;
# DJGPP provides gettimeofday/localtime so this works as-is.
set(SDL_TIME_UNIX 1)
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/time/unix/*.c")
set(HAVE_SDL_TIME TRUE)
set(SDL_TIMER_DOS 1)
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/timer/dos/*.c")
set(HAVE_SDL_TIMERS TRUE)
set(SDL_JOYSTICK_DOS 1)
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/joystick/dos/*.c")
set(HAVE_SDL_JOYSTICK TRUE)
set(SDL_THREAD_DOS 1)
sdl_glob_sources(
"${SDL3_SOURCE_DIR}/src/thread/generic/SDL_syscond.c"
"${SDL3_SOURCE_DIR}/src/thread/generic/SDL_syscond_c.h"
"${SDL3_SOURCE_DIR}/src/thread/generic/SDL_sysrwlock.c"
"${SDL3_SOURCE_DIR}/src/thread/generic/SDL_sysrwlock_c.h"
"${SDL3_SOURCE_DIR}/src/thread/dos/*.c"
"${SDL3_SOURCE_DIR}/src/thread/dos/*.h"
)
set(HAVE_SDL_THREADS TRUE)
elseif(NGAGE)
enable_language(CXX)
@ -3626,6 +3716,14 @@ if(SDL_GPU)
set(SDL_GPU_VULKAN 1)
set(HAVE_SDL_GPU TRUE)
endif()
if(SDL_VIDEO_METAL)
sdl_glob_sources(
"${SDL3_SOURCE_DIR}/src/gpu/metal/*.m"
"${SDL3_SOURCE_DIR}/src/gpu/metal/*.h"
)
set(SDL_GPU_METAL 1)
set(HAVE_SDL_GPU TRUE)
endif()
if(SDL_RENDER_GPU AND HAVE_SDL_GPU)
set(SDL_VIDEO_RENDER_GPU 1)
set(HAVE_RENDER_GPU TRUE)
@ -4062,6 +4160,10 @@ if(SDL_SHARED)
MACHO_COMPATIBILITY_VERSION "${SDL_DYLIB_COMPAT_VERSION}"
MACHO_CURRENT_VERSION "${SDL_DYLIB_CURRENT_VERSION}"
)
set_property(TARGET SDL3-shared APPEND PROPERTY LINK_DEPENDS
"${PROJECT_SOURCE_DIR}/src/dynapi/SDL_dynapi.exports")
target_link_options(SDL3-shared PRIVATE
"SHELL:-Wl,-exported_symbols_list,${PROJECT_SOURCE_DIR}/src/dynapi/SDL_dynapi.exports")
if(SDL_FRAMEWORK)
set_target_properties(SDL3-shared PROPERTIES
PUBLIC_HEADER "${SDL3_INCLUDE_FILES}"
@ -4070,18 +4172,19 @@ if(SDL_SHARED)
RESOURCE "${SDL_FRAMEWORK_RESOURCES}"
)
endif()
elseif(UNIX AND NOT ANDROID)
elseif(UNIX AND NOT (ANDROID OR CYGWIN))
set_target_properties(SDL3-shared PROPERTIES
VERSION "${SDL_SO_VERSION}"
SOVERSION "${SDL_SO_VERSION_MAJOR}"
)
else()
if(WINDOWS OR CYGWIN)
if(WINDOWS)
set_target_properties(SDL3-shared PROPERTIES
PREFIX ""
)
endif()
endif()
target_link_libraries(SDL3-shared PRIVATE ${SDL_CMAKE_DEPENDS})
target_include_directories(SDL3-shared
PRIVATE

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>{B938A3C0-6C64-4734-B705-ED3642C01B47}</ProjectGuid>
</PropertyGroup>
<Import Project="$(SolutionDir)\examples\Examples.props" />
<ItemGroup>
<None Include="$(SolutionDir)\..\examples\renderer\20-blending\README.txt" />
<ClCompile Include="$(SolutionDir)\..\examples\renderer\20-blending\blending.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View file

@ -50,13 +50,14 @@
0000AEB9AE90228CA2D60000 /* SDL_asyncio.c in Sources */ = {isa = PBXBuildFile; fileRef = 00003928A612EC33D42C0000 /* SDL_asyncio.c */; };
0000D5B526B85DE7AB1C0000 /* SDL_cocoapen.m in Sources */ = {isa = PBXBuildFile; fileRef = 0000CCA310B73A7B59910000 /* SDL_cocoapen.m */; };
007317A40858DECD00B2BC32 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179D0858DECD00B2BC32 /* Cocoa.framework */; platformFilters = (macos, ); };
007317A60858DECD00B2BC32 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179F0858DECD00B2BC32 /* IOKit.framework */; platformFilters = (ios, maccatalyst, macos, ); };
007317A60858DECD00B2BC32 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179F0858DECD00B2BC32 /* IOKit.framework */; platformFilters = (ios, maccatalyst, macos, xros, ); };
00CFA89D106B4BA100758660 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00CFA89C106B4BA100758660 /* ForceFeedback.framework */; platformFilters = (macos, ); };
00D0D08410675DD9004B05EF /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00D0D08310675DD9004B05EF /* CoreFoundation.framework */; platformFilters = (ios, maccatalyst, macos, tvos, ); settings = {ATTRIBUTES = (Required, ); }; };
00D0D08410675DD9004B05EF /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00D0D08310675DD9004B05EF /* CoreFoundation.framework */; platformFilters = (ios, maccatalyst, macos, tvos, xros, ); settings = {ATTRIBUTES = (Required, ); }; };
00D0D0D810675E46004B05EF /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 007317C10858E15000B2BC32 /* Carbon.framework */; platformFilters = (macos, ); };
02D6A1C228A84B8F00A7F002 /* SDL_hidapi_sinput.c in Sources */ = {isa = PBXBuildFile; fileRef = 02D6A1C128A84B8F00A7F001 /* SDL_hidapi_sinput.c */; };
1485C3312BBA4AF30063985B /* UniformTypeIdentifiers.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1485C32F2BBA4A0C0063985B /* UniformTypeIdentifiers.framework */; platformFilters = (maccatalyst, macos, ); settings = {ATTRIBUTES = (Weak, ); }; };
557D0CFA254586CA003913E3 /* CoreHaptics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F37DC5F225350EBC0002E6F7 /* CoreHaptics.framework */; platformFilters = (ios, maccatalyst, macos, tvos, ); settings = {ATTRIBUTES = (Weak, ); }; };
3AFD09EA2F9766BA00208BA9 /* SDL_CurvedUIShader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AFD09E92F9766BA00208BA9 /* SDL_CurvedUIShader.swift */; platformFilters = (xros, ); };
557D0CFA254586CA003913E3 /* CoreHaptics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F37DC5F225350EBC0002E6F7 /* CoreHaptics.framework */; platformFilters = (ios, maccatalyst, macos, tvos, xros, ); settings = {ATTRIBUTES = (Weak, ); }; };
557D0CFB254586D7003913E3 /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A75FDABD23E28B6200529352 /* GameController.framework */; settings = {ATTRIBUTES = (Required, ); }; };
5616CA4C252BB2A6005D5928 /* SDL_url.c in Sources */ = {isa = PBXBuildFile; fileRef = 5616CA49252BB2A5005D5928 /* SDL_url.c */; };
5616CA4D252BB2A6005D5928 /* SDL_sysurl.h in Headers */ = {isa = PBXBuildFile; fileRef = 5616CA4A252BB2A6005D5928 /* SDL_sysurl.h */; };
@ -82,8 +83,8 @@
A1626A522617008D003F1973 /* SDL_triangle.h in Headers */ = {isa = PBXBuildFile; fileRef = A1626A512617008C003F1973 /* SDL_triangle.h */; };
A1BB8B6327F6CF330057CFA8 /* SDL_list.c in Sources */ = {isa = PBXBuildFile; fileRef = A1BB8B6127F6CF320057CFA8 /* SDL_list.c */; };
A1BB8B6C27F6CF330057CFA8 /* SDL_list.h in Headers */ = {isa = PBXBuildFile; fileRef = A1BB8B6227F6CF330057CFA8 /* SDL_list.h */; };
A7381E961D8B69D600B177DD /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A7381E951D8B69D600B177DD /* CoreAudio.framework */; platformFilters = (ios, maccatalyst, macos, tvos, ); settings = {ATTRIBUTES = (Required, ); }; };
A7381E971D8B6A0300B177DD /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A7381E931D8B69C300B177DD /* AudioToolbox.framework */; platformFilters = (ios, maccatalyst, macos, tvos, ); };
A7381E961D8B69D600B177DD /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A7381E951D8B69D600B177DD /* CoreAudio.framework */; platformFilters = (ios, maccatalyst, macos, tvos, xros, ); settings = {ATTRIBUTES = (Required, ); }; };
A7381E971D8B6A0300B177DD /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A7381E931D8B69C300B177DD /* AudioToolbox.framework */; platformFilters = (ios, maccatalyst, macos, tvos, xros, ); };
A75FDB5823E39E6100529352 /* hidapi.h in Headers */ = {isa = PBXBuildFile; fileRef = A75FDB5723E39E6100529352 /* hidapi.h */; };
A75FDBC523EA380300529352 /* SDL_hidapi_rumble.h in Headers */ = {isa = PBXBuildFile; fileRef = A75FDBC323EA380300529352 /* SDL_hidapi_rumble.h */; };
A75FDBCE23EA380300529352 /* SDL_hidapi_rumble.c in Sources */ = {isa = PBXBuildFile; fileRef = A75FDBC423EA380300529352 /* SDL_hidapi_rumble.c */; };
@ -368,8 +369,6 @@
E4F257972C81903800FCEAFC /* SDL_sysgpu.h in Headers */ = {isa = PBXBuildFile; fileRef = E4F257862C81903800FCEAFC /* SDL_sysgpu.h */; };
E4F257982C81903800FCEAFC /* SDL_gpu_openxr.c in Sources */ = {isa = PBXBuildFile; fileRef = E4F257882C81903800FCEAFC /* SDL_gpu_openxr.c */; };
E4F257992C81903800FCEAFC /* SDL_openxrdyn.c in Sources */ = {isa = PBXBuildFile; fileRef = E4F257892C81903800FCEAFC /* SDL_openxrdyn.c */; };
E4F2579A2C81903800FCEAFC /* SDL_gpu_openxr_c.h in Headers */ = {isa = PBXBuildFile; fileRef = E4F2578A2C81903800FCEAFC /* SDL_gpu_openxr_c.h */; };
E4F2579B2C81903800FCEAFC /* SDL_openxr_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = E4F2578C2C81903800FCEAFC /* SDL_openxr_internal.h */; };
E4F7981A2AD8D84800669F54 /* SDL_core_unsupported.c in Sources */ = {isa = PBXBuildFile; fileRef = E4F798192AD8D84800669F54 /* SDL_core_unsupported.c */; };
E4F7981C2AD8D85500669F54 /* SDL_dynapi_unsupported.h in Headers */ = {isa = PBXBuildFile; fileRef = E4F7981B2AD8D85500669F54 /* SDL_dynapi_unsupported.h */; };
E4F7981E2AD8D86A00669F54 /* SDL_render_unsupported.c in Sources */ = {isa = PBXBuildFile; fileRef = E4F7981D2AD8D86A00669F54 /* SDL_render_unsupported.c */; };
@ -434,6 +433,13 @@
F3990E062A788303000D8759 /* SDL_hidapi_ios.h in Headers */ = {isa = PBXBuildFile; fileRef = F3990E032A788303000D8759 /* SDL_hidapi_ios.h */; };
F3990E072A78833C000D8759 /* hid.m in Sources */ = {isa = PBXBuildFile; fileRef = A75FDAA523E2792500529352 /* hid.m */; };
F3A4909E2554D38600E92A8B /* SDL_hidapi_ps5.c in Sources */ = {isa = PBXBuildFile; fileRef = F3A4909D2554D38500E92A8B /* SDL_hidapi_ps5.c */; };
F3A8371C2F69C80100AD32B6 /* SDL_RealityKitHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3A837162F69C80100AD32B6 /* SDL_RealityKitHelper.swift */; platformFilters = (xros, ); };
F3A895712F7D8AAA00B9E5C2 /* SDL_CurvedContentHosting.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3A8956D2F7D8AAA00B9E5C2 /* SDL_CurvedContentHosting.swift */; platformFilters = (xros, ); };
F3A895722F7D8AAA00B9E5C2 /* SDL_CurvedContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3A8956E2F7D8AAA00B9E5C2 /* SDL_CurvedContentView.swift */; platformFilters = (xros, ); };
F3A895792F7DC14400B9E5C2 /* SDL_UIKitBridge-objc.h in Headers */ = {isa = PBXBuildFile; fileRef = F3A895772F7DC14400B9E5C2 /* SDL_UIKitBridge-objc.h */; platformFilters = (xros, ); };
F3A8957A2F7DC14400B9E5C2 /* SDL_UIKitBridge-swift.h in Headers */ = {isa = PBXBuildFile; fileRef = F3A895782F7DC14400B9E5C2 /* SDL_UIKitBridge-swift.h */; platformFilters = (xros, ); };
F3A8957B2F7DC14400B9E5C2 /* SDL_UIKitBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = F3A895762F7DC14400B9E5C2 /* SDL_UIKitBridge.m */; platformFilters = (xros, ); };
F3A8957D2F7DC15500B9E5C2 /* SDL_uikitviewcontroller.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3A8957C2F7DC15500B9E5C2 /* SDL_uikitviewcontroller.swift */; platformFilters = (xros, ); };
F3A9AE982C8A13C100AAC390 /* SDL_gpu_util.h in Headers */ = {isa = PBXBuildFile; fileRef = F3A9AE922C8A13C100AAC390 /* SDL_gpu_util.h */; };
F3A9AE992C8A13C100AAC390 /* SDL_render_gpu.c in Sources */ = {isa = PBXBuildFile; fileRef = F3A9AE932C8A13C100AAC390 /* SDL_render_gpu.c */; };
F3A9AE9A2C8A13C100AAC390 /* SDL_shaders_gpu.c in Sources */ = {isa = PBXBuildFile; fileRef = F3A9AE942C8A13C100AAC390 /* SDL_shaders_gpu.c */; };
@ -559,7 +565,7 @@
F3FBB10A2DDF93AB0000F9A0 /* SDL_hidapi_gamesir.c in Sources */ = {isa = PBXBuildFile; fileRef = F3FBB1092DDF93AB0000F9A0 /* SDL_hidapi_gamesir.c */; };
F3FD042E2C9B755700824C4C /* SDL_hidapi_nintendo.h in Headers */ = {isa = PBXBuildFile; fileRef = F3FD042C2C9B755700824C4C /* SDL_hidapi_nintendo.h */; };
F3FD042F2C9B755700824C4C /* SDL_hidapi_steam_hori.c in Sources */ = {isa = PBXBuildFile; fileRef = F3FD042D2C9B755700824C4C /* SDL_hidapi_steam_hori.c */; };
FA73671D19A540EF004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73671C19A540EF004122E4 /* CoreVideo.framework */; platformFilters = (ios, maccatalyst, macos, tvos, ); settings = {ATTRIBUTES = (Required, ); }; };
FA73671D19A540EF004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73671C19A540EF004122E4 /* CoreVideo.framework */; platformFilters = (ios, maccatalyst, macos, tvos, xros, ); settings = {ATTRIBUTES = (Required, ); }; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@ -617,6 +623,7 @@
00D0D08310675DD9004B05EF /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
02D6A1C128A84B8F00A7F001 /* SDL_hidapi_sinput.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_sinput.c; sourceTree = "<group>"; };
1485C32F2BBA4A0C0063985B /* UniformTypeIdentifiers.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UniformTypeIdentifiers.framework; path = System/Library/Frameworks/UniformTypeIdentifiers.framework; sourceTree = SDKROOT; };
3AFD09E92F9766BA00208BA9 /* SDL_CurvedUIShader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SDL_CurvedUIShader.swift; sourceTree = "<group>"; };
5616CA49252BB2A5005D5928 /* SDL_url.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_url.c; sourceTree = "<group>"; };
5616CA4A252BB2A6005D5928 /* SDL_sysurl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysurl.h; sourceTree = "<group>"; };
5616CA4B252BB2A6005D5928 /* SDL_sysurl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_sysurl.m; sourceTree = "<group>"; };
@ -970,7 +977,6 @@
F338A1192D1B37E4007CDFDF /* SDL_tray.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SDL_tray.c; sourceTree = "<group>"; };
F3395BA72D9A5971007246C8 /* SDL_hidapi_8bitdo.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_8bitdo.c; sourceTree = "<group>"; };
F3395BA72D9A5971007246C9 /* SDL_hidapi_flydigi.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_flydigi.c; sourceTree = "<group>"; };
F3FBB1092DDF93AB0000F9A0 /* SDL_hidapi_gamesir.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_gamesir.c; sourceTree = "<group>"; };
F344003C2D4022E1003F26D7 /* INSTALL.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = INSTALL.md; sourceTree = "<group>"; };
F362B9152B3349E200D30B94 /* controller_list.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = controller_list.h; sourceTree = "<group>"; };
F362B9162B3349E200D30B94 /* SDL_gamepad_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_gamepad_c.h; sourceTree = "<group>"; };
@ -1026,6 +1032,13 @@
F3990E022A788303000D8759 /* SDL_hidapi_mac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_hidapi_mac.h; sourceTree = "<group>"; };
F3990E032A788303000D8759 /* SDL_hidapi_ios.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_hidapi_ios.h; sourceTree = "<group>"; };
F3A4909D2554D38500E92A8B /* SDL_hidapi_ps5.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_ps5.c; sourceTree = "<group>"; };
F3A837162F69C80100AD32B6 /* SDL_RealityKitHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SDL_RealityKitHelper.swift; sourceTree = "<group>"; };
F3A8956D2F7D8AAA00B9E5C2 /* SDL_CurvedContentHosting.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SDL_CurvedContentHosting.swift; sourceTree = "<group>"; };
F3A8956E2F7D8AAA00B9E5C2 /* SDL_CurvedContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SDL_CurvedContentView.swift; sourceTree = "<group>"; };
F3A895762F7DC14400B9E5C2 /* SDL_UIKitBridge.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDL_UIKitBridge.m; sourceTree = "<group>"; };
F3A895772F7DC14400B9E5C2 /* SDL_UIKitBridge-objc.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SDL_UIKitBridge-objc.h"; sourceTree = "<group>"; };
F3A895782F7DC14400B9E5C2 /* SDL_UIKitBridge-swift.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SDL_UIKitBridge-swift.h"; sourceTree = "<group>"; };
F3A8957C2F7DC15500B9E5C2 /* SDL_uikitviewcontroller.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SDL_uikitviewcontroller.swift; sourceTree = "<group>"; };
F3A9AE922C8A13C100AAC390 /* SDL_gpu_util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_gpu_util.h; sourceTree = "<group>"; };
F3A9AE932C8A13C100AAC390 /* SDL_render_gpu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_render_gpu.c; sourceTree = "<group>"; };
F3A9AE942C8A13C100AAC390 /* SDL_shaders_gpu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_shaders_gpu.c; sourceTree = "<group>"; };
@ -1149,6 +1162,7 @@
F3FA5A1A2B59ACE000FEAD97 /* yuv_rgb_lsx.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = yuv_rgb_lsx.c; sourceTree = "<group>"; };
F3FA5A1B2B59ACE000FEAD97 /* yuv_rgb_lsx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = yuv_rgb_lsx.h; sourceTree = "<group>"; };
F3FA5A1C2B59ACE000FEAD97 /* yuv_rgb_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = yuv_rgb_common.h; sourceTree = "<group>"; };
F3FBB1092DDF93AB0000F9A0 /* SDL_hidapi_gamesir.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_gamesir.c; sourceTree = "<group>"; };
F3FD042C2C9B755700824C4C /* SDL_hidapi_nintendo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDL_hidapi_nintendo.h; sourceTree = "<group>"; };
F3FD042D2C9B755700824C4C /* SDL_hidapi_steam_hori.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_steam_hori.c; sourceTree = "<group>"; };
F59C710600D5CB5801000001 /* SDL.info */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SDL.info; sourceTree = "<group>"; };
@ -1738,8 +1752,15 @@
A7D8A61823E2513D00DCD162 /* uikit */ = {
isa = PBXGroup;
children = (
F3A8956D2F7D8AAA00B9E5C2 /* SDL_CurvedContentHosting.swift */,
F3A8956E2F7D8AAA00B9E5C2 /* SDL_CurvedContentView.swift */,
3AFD09E92F9766BA00208BA9 /* SDL_CurvedUIShader.swift */,
F3A837162F69C80100AD32B6 /* SDL_RealityKitHelper.swift */,
A7D8A62F23E2513D00DCD162 /* SDL_uikitappdelegate.h */,
A7D8A61E23E2513D00DCD162 /* SDL_uikitappdelegate.m */,
F3A895762F7DC14400B9E5C2 /* SDL_UIKitBridge.m */,
F3A895772F7DC14400B9E5C2 /* SDL_UIKitBridge-objc.h */,
F3A895782F7DC14400B9E5C2 /* SDL_UIKitBridge-swift.h */,
A7D8A62123E2513D00DCD162 /* SDL_uikitclipboard.h */,
A7D8A62A23E2513D00DCD162 /* SDL_uikitclipboard.m */,
A7D8A62D23E2513D00DCD162 /* SDL_uikitevents.h */,
@ -1754,18 +1775,19 @@
A7D8A62323E2513D00DCD162 /* SDL_uikitopengles.m */,
A7D8A62B23E2513D00DCD162 /* SDL_uikitopenglview.h */,
A7D8A62023E2513D00DCD162 /* SDL_uikitopenglview.m */,
000063D3D80F97ADC7770000 /* SDL_uikitpen.h */,
000053D344416737F6050000 /* SDL_uikitpen.m */,
A7D8A62223E2513D00DCD162 /* SDL_uikitvideo.h */,
A7D8A63223E2513D00DCD162 /* SDL_uikitvideo.m */,
A7D8A61923E2513D00DCD162 /* SDL_uikitview.h */,
A7D8A62923E2513D00DCD162 /* SDL_uikitview.m */,
A7D8A62423E2513D00DCD162 /* SDL_uikitviewcontroller.h */,
A7D8A63023E2513D00DCD162 /* SDL_uikitviewcontroller.m */,
F3A8957C2F7DC15500B9E5C2 /* SDL_uikitviewcontroller.swift */,
A7D8A63323E2513D00DCD162 /* SDL_uikitvulkan.h */,
A7D8A62523E2513D00DCD162 /* SDL_uikitvulkan.m */,
A7D8A62723E2513D00DCD162 /* SDL_uikitwindow.h */,
A7D8A61A23E2513D00DCD162 /* SDL_uikitwindow.m */,
000063D3D80F97ADC7770000 /* SDL_uikitpen.h */,
000053D344416737F6050000 /* SDL_uikitpen.m */,
);
path = uikit;
sourceTree = "<group>";
@ -2365,17 +2387,6 @@
path = vulkan;
sourceTree = "<group>";
};
E4F2578B2C81903800FCEAFC /* xr */ = {
isa = PBXGroup;
children = (
E4F257882C81903800FCEAFC /* SDL_gpu_openxr.c */,
E4F257892C81903800FCEAFC /* SDL_openxrdyn.c */,
E4F2578A2C81903800FCEAFC /* SDL_gpu_openxr_c.h */,
E4F2578C2C81903800FCEAFC /* SDL_openxr_internal.h */,
);
path = xr;
sourceTree = "<group>";
};
E4F257872C81903800FCEAFC /* gpu */ = {
isa = PBXGroup;
children = (
@ -2388,6 +2399,17 @@
path = gpu;
sourceTree = "<group>";
};
E4F2578B2C81903800FCEAFC /* xr */ = {
isa = PBXGroup;
children = (
E4F257882C81903800FCEAFC /* SDL_gpu_openxr.c */,
E4F257892C81903800FCEAFC /* SDL_openxrdyn.c */,
E4F2578A2C81903800FCEAFC /* SDL_gpu_openxr_c.h */,
E4F2578C2C81903800FCEAFC /* SDL_openxr_internal.h */,
);
path = xr;
sourceTree = "<group>";
};
F338A1142D1B3735007CDFDF /* tray */ = {
isa = PBXGroup;
children = (
@ -2561,6 +2583,8 @@
F3EFA5ED2D5AB97300BCF22F /* SDL_stb_c.h in Headers */,
F3EFA5EE2D5AB97300BCF22F /* stb_image.h in Headers */,
F3EFA5EF2D5AB97300BCF22F /* SDL_surface_c.h in Headers */,
F3A895792F7DC14400B9E5C2 /* SDL_UIKitBridge-objc.h in Headers */,
F3A8957A2F7DC14400B9E5C2 /* SDL_UIKitBridge-swift.h in Headers */,
A7D8AE8E23E2514100DCD162 /* SDL_cocoakeyboard.h in Headers */,
A7D8AF0623E2514100DCD162 /* SDL_cocoamessagebox.h in Headers */,
A7D8AEB223E2514100DCD162 /* SDL_cocoametalview.h in Headers */,
@ -2843,6 +2867,9 @@
attributes = {
LastUpgradeCheck = 1130;
TargetAttributes = {
BECDF5FE0761BA81005FE872 = {
LastSwiftMigration = 2630;
};
F3676F582A7885080091160D = {
CreatedOnToolsVersion = 14.3.1;
};
@ -2931,6 +2958,7 @@
buildActionMask = 2147483647;
files = (
A7D8B9E323E2514400DCD162 /* SDL_drawline.c in Sources */,
F3A8957B2F7DC14400B9E5C2 /* SDL_UIKitBridge.m in Sources */,
A7D8AE7C23E2514100DCD162 /* SDL_yuv.c in Sources */,
A7D8B62F23E2514300DCD162 /* SDL_sysfilesystem.m in Sources */,
A7D8B41C23E2514300DCD162 /* SDL_systls.c in Sources */,
@ -3059,6 +3087,7 @@
F3B439512C935C2400792030 /* SDL_dummyprocess.c in Sources */,
A7D8B76423E2514300DCD162 /* SDL_mixer.c in Sources */,
A7D8BB5723E2514500DCD162 /* SDL_events.c in Sources */,
F3A8957D2F7DC15500B9E5C2 /* SDL_uikitviewcontroller.swift in Sources */,
A7D8ADE623E2514100DCD162 /* SDL_blit_0.c in Sources */,
89E5801E2D03602200DAF6D3 /* SDL_hidapi_lg4ff.c in Sources */,
A7D8B8A823E2514400DCD162 /* SDL_diskaudio.c in Sources */,
@ -3086,6 +3115,7 @@
A7D8B56323E2514300DCD162 /* SDL_hidapi_gamecube.c in Sources */,
A7D8B4DC23E2514300DCD162 /* SDL_joystick.c in Sources */,
A7D8BA4923E2514400DCD162 /* SDL_render_gles2.c in Sources */,
F3A8371C2F69C80100AD32B6 /* SDL_RealityKitHelper.swift in Sources */,
A7D8AC2D23E2514100DCD162 /* SDL_surface.c in Sources */,
A7D8B54B23E2514300DCD162 /* SDL_hidapi_xboxone.c in Sources */,
A7D8AD2323E2514100DCD162 /* SDL_blit_auto.c in Sources */,
@ -3141,6 +3171,8 @@
A7D8A94B23E2514000DCD162 /* SDL.c in Sources */,
A7D8AEA023E2514100DCD162 /* SDL_cocoavulkan.m in Sources */,
A7D8AB6123E2514100DCD162 /* SDL_offscreenwindow.c in Sources */,
F3A895712F7D8AAA00B9E5C2 /* SDL_CurvedContentHosting.swift in Sources */,
F3A895722F7D8AAA00B9E5C2 /* SDL_CurvedContentView.swift in Sources */,
566E26D8246274CC00718109 /* SDL_locale.c in Sources */,
63134A262A7902FD0021E9A6 /* SDL_pen.c in Sources */,
000040E76FDC6AE48CBF0000 /* SDL_hashtable.c in Sources */,
@ -3153,6 +3185,7 @@
00002B20A48E055EB0350000 /* SDL_camera_coremedia.m in Sources */,
000080903BC03006F24E0000 /* SDL_filesystem.c in Sources */,
F3FBB1082DDF93AB0000F99F /* SDL_hidapi_flydigi.c in Sources */,
3AFD09EA2F9766BA00208BA9 /* SDL_CurvedUIShader.swift in Sources */,
F3FBB10A2DDF93AB0000F9A0 /* SDL_hidapi_gamesir.c in Sources */,
0000481D255AF155B42C0000 /* SDL_sysfsops.c in Sources */,
0000494CC93F3E624D3C0000 /* SDL_systime.c in Sources */,
@ -3239,12 +3272,18 @@
isa = XCBuildConfiguration;
baseConfigurationReference = F3F7BE3B2CBD79D200C984AF /* config.xcconfig */;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CLANG_LINK_OBJC_RUNTIME = NO;
GCC_PREPROCESSOR_DEFINITIONS = GLES_SILENCE_DEPRECATION;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
EXPORTED_SYMBOLS_FILE = "$(SRCROOT)/../../src/dynapi/SDL_dynapi.exports";
GCC_PREPROCESSOR_DEFINITIONS = GLES_SILENCE_DEPRECATION;
OTHER_LDFLAGS = "-liconv";
SUPPORTS_MACCATALYST = YES;
"SWIFT_OBJC_BRIDGING_HEADER[sdk=xr*]" = "../../src/video/uikit/SDL_UIKitBridge-swift.h";
SWIFT_VERSION = 6.0;
XROS_DEPLOYMENT_TARGET = 26.0;
};
name = Release;
};
@ -3304,12 +3343,19 @@
isa = XCBuildConfiguration;
baseConfigurationReference = F3F7BE3B2CBD79D200C984AF /* config.xcconfig */;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CLANG_LINK_OBJC_RUNTIME = NO;
GCC_PREPROCESSOR_DEFINITIONS = GLES_SILENCE_DEPRECATION;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
EXPORTED_SYMBOLS_FILE = "$(SRCROOT)/../../src/dynapi/SDL_dynapi.exports";
GCC_PREPROCESSOR_DEFINITIONS = GLES_SILENCE_DEPRECATION;
OTHER_LDFLAGS = "-liconv";
SUPPORTS_MACCATALYST = YES;
"SWIFT_OBJC_BRIDGING_HEADER[sdk=xr*]" = "../../src/video/uikit/SDL_UIKitBridge-swift.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 6.0;
XROS_DEPLOYMENT_TARGET = 26.0;
};
name = Debug;
};

View file

@ -48,7 +48,7 @@
boolean showTextInput(int, int, int, int, int);
boolean supportsRelativeMouse();
int openFileDescriptor(java.lang.String, java.lang.String);
boolean showFileDialog(java.lang.String[], boolean, boolean, int);
boolean showFileDialog(java.lang.String[], boolean, int, java.lang.String, int);
java.lang.String getPreferredLocales();
java.lang.String formatLocale(java.util.Locale);
}
@ -68,6 +68,7 @@
}
-keep,includedescriptorclasses,allowoptimization class org.libsdl.app.SDLControllerManager {
void joystickSetSensorsEnabled(int, boolean);
void pollInputDevices();
void joystickSetLED(int, int, int, int);
void pollHapticDevices();

View file

@ -81,7 +81,7 @@
<activity android:name="SDLActivity"
android:label="@string/app_name"
android:alwaysRetainTaskState="true"
android:launchMode="singleInstance"
android:launchMode="singleTop"
android:configChanges="layoutDirection|locale|grammaticalGender|fontScale|fontWeightAdjustment|orientation|uiMode|screenLayout|screenSize|smallestScreenSize|keyboard|keyboardHidden|navigation"
android:preferMinimalPostProcessing="true"
android:exported="true"

View file

@ -37,6 +37,8 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe
private boolean mIsConnected = false;
private boolean mIsChromebook = false;
private boolean mIsReconnecting = false;
private boolean mHasEnabledNotifications = false;
private boolean mHasSeenInputUpdate = false;
private boolean mFrozen = false;
private LinkedList<GattOperation> mOperations;
GattOperation mCurrentOperation = null;
@ -73,6 +75,7 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe
byte[] mValue;
BluetoothGatt mGatt;
boolean mResult = true;
int mDelayMs = 0;
private GattOperation(BluetoothGatt gatt, GattOperation.Operation operation, UUID uuid) {
mGatt = gatt;
@ -80,6 +83,13 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe
mUuid = uuid;
}
private GattOperation(BluetoothGatt gatt, GattOperation.Operation operation, UUID uuid, int delayMs) {
mGatt = gatt;
mOp = operation;
mUuid = uuid;
mDelayMs = delayMs;
}
private GattOperation(BluetoothGatt gatt, GattOperation.Operation operation, UUID uuid, byte[] value) {
mGatt = gatt;
mOp = operation;
@ -87,6 +97,14 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe
mValue = value;
}
private GattOperation(BluetoothGatt gatt, GattOperation.Operation operation, UUID uuid, byte[] value, int delayMs) {
mGatt = gatt;
mOp = operation;
mUuid = uuid;
mValue = value;
mDelayMs = delayMs;
}
public void run() {
// This is executed in main thread
BluetoothGattCharacteristic chr;
@ -148,6 +166,8 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe
return mResult;
}
public int getDelayMs() { return mDelayMs; }
private BluetoothGattCharacteristic getCharacteristic(UUID uuid) {
BluetoothGattService valveService = mGatt.getService(steamControllerService);
if (valveService == null)
@ -166,6 +186,10 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe
static public GattOperation enableNotification(BluetoothGatt gatt, UUID uuid) {
return new GattOperation(gatt, Operation.ENABLE_NOTIFICATION, uuid);
}
static public GattOperation enableNotification(BluetoothGatt gatt, UUID uuid, int delayMs) {
return new GattOperation(gatt, Operation.ENABLE_NOTIFICATION, uuid, delayMs);
}
}
HIDDeviceBLESteamController(HIDDeviceManager manager, BluetoothDevice device) {
@ -178,6 +202,8 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe
mHandler = new Handler(Looper.getMainLooper());
mGatt = connectGatt();
mHasEnabledNotifications = false;
mHasSeenInputUpdate = false;
// final HIDDeviceBLESteamController finalThis = this;
// mHandler.postDelayed(new Runnable() {
// @Override
@ -414,21 +440,30 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe
mCurrentOperation = mOperations.removeFirst();
}
// Run in main thread
mHandler.post(new Runnable() {
@Override
public void run() {
synchronized (mOperations) {
if (mCurrentOperation == null) {
Log.e(TAG, "Current operation null in executor?");
return;
}
Runnable gattOperationRunnable = new Runnable() {
@Override
public void run() {
synchronized (mOperations) {
if (mCurrentOperation == null) {
Log.e(TAG, "Current operation null in executor?");
return;
}
mCurrentOperation.run();
// now wait for the GATT callback and when it comes, finish this operation
mCurrentOperation.run();
// now wait for the GATT callback and when it comes, finish this operation
}
}
}
});
};
if (mCurrentOperation.getDelayMs() == 0) {
// Run in main thread
mHandler.post(gattOperationRunnable);
}
else {
// If we have a delay on this operation, wait before we post it.
mHandler.postDelayed(gattOperationRunnable, mCurrentOperation.getDelayMs());
}
}
private void queueGattOperation(GattOperation op) {
@ -439,8 +474,39 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe
}
private void enableNotification(UUID chrUuid) {
GattOperation op = HIDDeviceBLESteamController.GattOperation.enableNotification(mGatt, chrUuid);
// Add a 500ms delay to notification write for Amazon Fire TV devices, as otherwise if we do this too quickly after connecting
// it will return success and then silently drop the operation on the floor.
GattOperation op = HIDDeviceBLESteamController.GattOperation.enableNotification(mGatt, chrUuid, 500);
queueGattOperation(op);
// Amazon Fire devices can also silently timeout on writeDescriptor, so
// set up a little delayed check that will attempt to write a second time.
//
// While this only seems to be needed on Amazon Fire TV devices at present, it
// doesn't hurt to have a retry on other devices as well.
//
final HIDDeviceBLESteamController finalThis = this;
final UUID finalUuid = chrUuid;
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
if (!finalThis.mHasEnabledNotifications) {
if (finalThis.mHasSeenInputUpdate) {
// Amazon Five devices may have enabled notifications on the input characteristic and not given us a callback. If we've seen
// input reports, though, somewhat by definition notifications are enabled.
Log.w(TAG, "WriteDescriptor has never returned, but we've seen input reports. Moving on with controller initialization.");
finalThis.mHasEnabledNotifications = true;
finalThis.enableValveMode();
return;
}
// Give one more try.
GattOperation retry = HIDDeviceBLESteamController.GattOperation.enableNotification(finalThis.mGatt, finalUuid, 500);
finalThis.queueGattOperation(retry);
}
}
}, 1000);
}
void writeCharacteristic(UUID uuid, byte[] value) {
@ -538,6 +604,7 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe
//Log.v(TAG, "onCharacteristicChanged uuid=" + characteristic.getUuid() + " data=" + HexDump.dumpHexString(characteristic.getValue()));
if (characteristic.getUuid().equals(getInputCharacteristic()) && !mFrozen) {
mHasSeenInputUpdate = true;
mManager.HIDDeviceInputReport(getId(), characteristic.getValue());
}
}
@ -547,27 +614,36 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe
//Log.v(TAG, "onDescriptorRead status=" + status);
}
private void enableValveMode()
{
BluetoothGattService valveService = mGatt.getService(steamControllerService);
if (valveService == null)
return;
BluetoothGattCharacteristic reportChr = valveService.getCharacteristic(reportCharacteristic);
if (reportChr != null) {
if (getProductId() == TRITON_BLE_PID) {
// For Triton we just mark things registered.
Log.v(TAG, "Registering Triton Steam Controller with ID: " + getId());
mManager.HIDDeviceConnected(getId(), getIdentifier(), getVendorId(), getProductId(), getSerialNumber(), getVersion(), getManufacturerName(), getProductName(), 0, 0, 0, 0, true);
setRegistered();
} else {
// For the original controller, we need to manually enter Valve mode.
Log.v(TAG, "Writing report characteristic to enter valve mode");
reportChr.setValue(enterValveMode);
mGatt.writeCharacteristic(reportChr);
}
}
}
@Override
public void onDescriptorWrite(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status) {
BluetoothGattCharacteristic chr = descriptor.getCharacteristic();
//Log.v(TAG, "onDescriptorWrite status=" + status + " uuid=" + chr.getUuid() + " descriptor=" + descriptor.getUuid());
if (chr.getUuid().equals(getInputCharacteristic())) {
boolean hasWrittenInputDescriptor = true;
BluetoothGattCharacteristic reportChr = chr.getService().getCharacteristic(reportCharacteristic);
if (reportChr != null) {
if (getProductId() == TRITON_BLE_PID) {
// For Triton we just mark things registered.
Log.v(TAG, "Registering Triton Steam Controller with ID: " + getId());
mManager.HIDDeviceConnected(getId(), getIdentifier(), getVendorId(), getProductId(), getSerialNumber(), getVersion(), getManufacturerName(), getProductName(), 0, 0, 0, 0, true);
setRegistered();
} else {
// For the original controller, we need to manually enter Valve mode.
Log.v(TAG, "Writing report characteristic to enter valve mode");
reportChr.setValue(enterValveMode);
gatt.writeCharacteristic(reportChr);
}
}
mHasEnabledNotifications = true;
enableValveMode();
}
finishCurrentGattOperation();
@ -682,7 +758,7 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe
if (getProductId() == D0G_BLE2_PID) {
//Log.v(TAG, "writeOutputReport " + HexDump.dumpHexString(report));
writeCharacteristic(reportCharacteristic, report);
return report.length;
return report.length;
}
// If we're a Triton, we need to find the correct report characteristic.

View file

@ -256,6 +256,7 @@ public class HIDDeviceManager {
0x24c6, // PowerA
0x2c22, // Qanba
0x2dc8, // 8BitDo
0x3537, // GameSir
0x37d7, // Flydigi
0x9886, // ASTRO Gaming
};

View file

@ -132,8 +132,10 @@ class HIDDeviceUSB implements HIDDevice {
}
}
// Make sure the required endpoints were present
if (mInputEndpoint == null || mOutputEndpoint == null) {
// Make sure the required endpoints were present. The original Steam Controller and the wireless dongle for it do NOT
// actually have -- or require -- output endpoints, so we need to accept only an input one for them or else we'll fall
// back to the Android system gamepad functionality (and lose our paddles et al).
if (mInputEndpoint == null) {
Log.w(TAG, "Missing required endpoint on USB device " + getDeviceName());
close();
return false;
@ -185,6 +187,11 @@ class HIDDeviceUSB implements HIDDevice {
}
return length;
} else {
if (mOutputEndpoint == null)
{
Log.e(TAG, "Tried to write an output report to an interface with no output endpoint!");
return -1;
}
int res = mConnection.bulkTransfer(mOutputEndpoint, report, report.length, 1000);
if (res != report.length) {
Log.w(TAG, "writeOutputReport() returned " + res + " on device " + getDeviceName());

View file

@ -26,6 +26,7 @@ import android.os.Handler;
import android.os.LocaleList;
import android.os.Message;
import android.os.ParcelFileDescriptor;
import android.provider.DocumentsContract;
import android.util.DisplayMetrics;
import android.util.Log;
import android.util.SparseArray;
@ -170,26 +171,40 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
// Cursor types
// private static final int SDL_SYSTEM_CURSOR_NONE = -1;
private static final int SDL_SYSTEM_CURSOR_ARROW = 0;
private static final int SDL_SYSTEM_CURSOR_IBEAM = 1;
private static final int SDL_SYSTEM_CURSOR_DEFAULT = 0;
private static final int SDL_SYSTEM_CURSOR_TEXT = 1;
private static final int SDL_SYSTEM_CURSOR_WAIT = 2;
private static final int SDL_SYSTEM_CURSOR_CROSSHAIR = 3;
private static final int SDL_SYSTEM_CURSOR_WAITARROW = 4;
private static final int SDL_SYSTEM_CURSOR_SIZENWSE = 5;
private static final int SDL_SYSTEM_CURSOR_SIZENESW = 6;
private static final int SDL_SYSTEM_CURSOR_SIZEWE = 7;
private static final int SDL_SYSTEM_CURSOR_SIZENS = 8;
private static final int SDL_SYSTEM_CURSOR_SIZEALL = 9;
private static final int SDL_SYSTEM_CURSOR_NO = 10;
private static final int SDL_SYSTEM_CURSOR_HAND = 11;
private static final int SDL_SYSTEM_CURSOR_WINDOW_TOPLEFT = 12;
private static final int SDL_SYSTEM_CURSOR_WINDOW_TOP = 13;
private static final int SDL_SYSTEM_CURSOR_WINDOW_TOPRIGHT = 14;
private static final int SDL_SYSTEM_CURSOR_WINDOW_RIGHT = 15;
private static final int SDL_SYSTEM_CURSOR_WINDOW_BOTTOMRIGHT = 16;
private static final int SDL_SYSTEM_CURSOR_WINDOW_BOTTOM = 17;
private static final int SDL_SYSTEM_CURSOR_WINDOW_BOTTOMLEFT = 18;
private static final int SDL_SYSTEM_CURSOR_WINDOW_LEFT = 19;
private static final int SDL_SYSTEM_CURSOR_PROGRESS = 4;
private static final int SDL_SYSTEM_CURSOR_NWSE_RESIZE = 5;
private static final int SDL_SYSTEM_CURSOR_NESW_RESIZE = 6;
private static final int SDL_SYSTEM_CURSOR_EW_RESIZE = 7;
private static final int SDL_SYSTEM_CURSOR_NS_RESIZE = 8;
private static final int SDL_SYSTEM_CURSOR_MOVE = 9;
private static final int SDL_SYSTEM_CURSOR_NOT_ALLOWED = 10;
private static final int SDL_SYSTEM_CURSOR_POINTER = 11;
private static final int SDL_SYSTEM_CURSOR_NW_RESIZE = 12;
private static final int SDL_SYSTEM_CURSOR_N_RESIZE = 13;
private static final int SDL_SYSTEM_CURSOR_NE_RESIZE = 14;
private static final int SDL_SYSTEM_CURSOR_E_RESIZE = 15;
private static final int SDL_SYSTEM_CURSOR_SE_RESIZE = 16;
private static final int SDL_SYSTEM_CURSOR_S_RESIZE = 17;
private static final int SDL_SYSTEM_CURSOR_SW_RESIZE = 18;
private static final int SDL_SYSTEM_CURSOR_W_RESIZE = 19;
private static final int SDL_SYSTEM_CURSOR_CONTEXT_MENU = 20;
private static final int SDL_SYSTEM_CURSOR_HELP = 21;
private static final int SDL_SYSTEM_CURSOR_CELL = 22;
private static final int SDL_SYSTEM_CURSOR_VERTICAL_TEXT = 23;
private static final int SDL_SYSTEM_CURSOR_ALIAS = 24;
private static final int SDL_SYSTEM_CURSOR_COPY = 25;
private static final int SDL_SYSTEM_CURSOR_NO_DROP = 26;
private static final int SDL_SYSTEM_CURSOR_GRAB = 27;
private static final int SDL_SYSTEM_CURSOR_GRABBING = 28;
private static final int SDL_SYSTEM_CURSOR_COL_RESIZE = 29;
private static final int SDL_SYSTEM_CURSOR_ROW_RESIZE = 30;
private static final int SDL_SYSTEM_CURSOR_ALL_SCROLL = 31;
private static final int SDL_SYSTEM_CURSOR_ZOOM_IN = 32;
private static final int SDL_SYSTEM_CURSOR_ZOOM_OUT = 33;
protected static final int SDL_ORIENTATION_UNKNOWN = 0;
protected static final int SDL_ORIENTATION_LANDSCAPE = 1;
@ -570,7 +585,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
public static int getNaturalOrientation() {
int result = SDL_ORIENTATION_UNKNOWN;
Activity activity = (Activity)getContext();
Activity activity = getContext();
if (activity != null) {
Configuration config = activity.getResources().getConfiguration();
Display display = activity.getWindowManager().getDefaultDisplay();
@ -590,7 +605,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
public static int getCurrentRotation() {
int result = 0;
Activity activity = (Activity)getContext();
Activity activity = getContext();
if (activity != null) {
Display display = activity.getWindowManager().getDefaultDisplay();
switch (display.getRotation()) {
@ -730,6 +745,11 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
}
}
// File dialog types
private static final int SDL_FILEDIALOG_OPENFILE = 0;
private static final int SDL_FILEDIALOG_SAVEFILE = 1;
private static final int SDL_FILEDIALOG_OPENFOLDER = 2;
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
@ -738,7 +758,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
/* This is our file dialog */
String[] filelist = null;
if (data != null) {
if (data != null && resultCode == Activity.RESULT_OK) {
Uri singleFileUri = data.getData();
if (singleFileUri == null) {
@ -753,6 +773,13 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
filelist[i] = uri;
}
} else {
/* If the user selected a directory and the persistent permission hint has been set,
make the permission persistable */
if (mFileDialogState.type == SDL_FILEDIALOG_OPENFOLDER && mFileDialogState.persistable) {
mSingleton.getContentResolver().takePersistableUriPermission(singleFileUri,
Intent.FLAG_GRANT_READ_URI_PERMISSION |
Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
}
/* Only one file is selected. */
filelist = new String[]{singleFileUri.toString()};
}
@ -1292,7 +1319,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
public static double getDiagonal()
{
DisplayMetrics metrics = new DisplayMetrics();
Activity activity = (Activity)getContext();
Activity activity = getContext();
if (activity == null) {
return 0.0;
}
@ -1481,11 +1508,11 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
if (SDLControllerManager.isDeviceSDLJoystick(deviceId)) {
// Note that we process events with specific key codes here
if (event.getAction() == KeyEvent.ACTION_DOWN) {
if (SDLControllerManager.onNativePadDown(deviceId, keyCode)) {
if (SDLControllerManager.onNativePadDown(deviceId, keyCode, event.getScanCode())) {
return true;
}
} else if (event.getAction() == KeyEvent.ACTION_UP) {
if (SDLControllerManager.onNativePadUp(deviceId, keyCode)) {
if (SDLControllerManager.onNativePadUp(deviceId, keyCode, event.getScanCode())) {
return true;
}
}
@ -1860,10 +1887,10 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
public static boolean setSystemCursor(int cursorID) {
int cursor_type = 0; //PointerIcon.TYPE_NULL;
switch (cursorID) {
case SDL_SYSTEM_CURSOR_ARROW:
case SDL_SYSTEM_CURSOR_DEFAULT:
cursor_type = 1000; //PointerIcon.TYPE_ARROW;
break;
case SDL_SYSTEM_CURSOR_IBEAM:
case SDL_SYSTEM_CURSOR_TEXT:
cursor_type = 1008; //PointerIcon.TYPE_TEXT;
break;
case SDL_SYSTEM_CURSOR_WAIT:
@ -1872,54 +1899,96 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
case SDL_SYSTEM_CURSOR_CROSSHAIR:
cursor_type = 1007; //PointerIcon.TYPE_CROSSHAIR;
break;
case SDL_SYSTEM_CURSOR_WAITARROW:
case SDL_SYSTEM_CURSOR_PROGRESS:
cursor_type = 1004; //PointerIcon.TYPE_WAIT;
break;
case SDL_SYSTEM_CURSOR_SIZENWSE:
case SDL_SYSTEM_CURSOR_NWSE_RESIZE:
cursor_type = 1017; //PointerIcon.TYPE_TOP_LEFT_DIAGONAL_DOUBLE_ARROW;
break;
case SDL_SYSTEM_CURSOR_SIZENESW:
case SDL_SYSTEM_CURSOR_NESW_RESIZE:
cursor_type = 1016; //PointerIcon.TYPE_TOP_RIGHT_DIAGONAL_DOUBLE_ARROW;
break;
case SDL_SYSTEM_CURSOR_SIZEWE:
case SDL_SYSTEM_CURSOR_EW_RESIZE:
cursor_type = 1014; //PointerIcon.TYPE_HORIZONTAL_DOUBLE_ARROW;
break;
case SDL_SYSTEM_CURSOR_SIZENS:
case SDL_SYSTEM_CURSOR_NS_RESIZE:
cursor_type = 1015; //PointerIcon.TYPE_VERTICAL_DOUBLE_ARROW;
break;
case SDL_SYSTEM_CURSOR_SIZEALL:
case SDL_SYSTEM_CURSOR_MOVE:
cursor_type = 1020; //PointerIcon.TYPE_GRAB;
break;
case SDL_SYSTEM_CURSOR_NO:
case SDL_SYSTEM_CURSOR_NOT_ALLOWED:
cursor_type = 1012; //PointerIcon.TYPE_NO_DROP;
break;
case SDL_SYSTEM_CURSOR_HAND:
case SDL_SYSTEM_CURSOR_POINTER:
cursor_type = 1002; //PointerIcon.TYPE_HAND;
break;
case SDL_SYSTEM_CURSOR_WINDOW_TOPLEFT:
case SDL_SYSTEM_CURSOR_NW_RESIZE:
cursor_type = 1017; //PointerIcon.TYPE_TOP_LEFT_DIAGONAL_DOUBLE_ARROW;
break;
case SDL_SYSTEM_CURSOR_WINDOW_TOP:
case SDL_SYSTEM_CURSOR_N_RESIZE:
cursor_type = 1015; //PointerIcon.TYPE_VERTICAL_DOUBLE_ARROW;
break;
case SDL_SYSTEM_CURSOR_WINDOW_TOPRIGHT:
case SDL_SYSTEM_CURSOR_NE_RESIZE:
cursor_type = 1016; //PointerIcon.TYPE_TOP_RIGHT_DIAGONAL_DOUBLE_ARROW;
break;
case SDL_SYSTEM_CURSOR_WINDOW_RIGHT:
case SDL_SYSTEM_CURSOR_E_RESIZE:
cursor_type = 1014; //PointerIcon.TYPE_HORIZONTAL_DOUBLE_ARROW;
break;
case SDL_SYSTEM_CURSOR_WINDOW_BOTTOMRIGHT:
case SDL_SYSTEM_CURSOR_SE_RESIZE:
cursor_type = 1017; //PointerIcon.TYPE_TOP_LEFT_DIAGONAL_DOUBLE_ARROW;
break;
case SDL_SYSTEM_CURSOR_WINDOW_BOTTOM:
case SDL_SYSTEM_CURSOR_S_RESIZE:
cursor_type = 1015; //PointerIcon.TYPE_VERTICAL_DOUBLE_ARROW;
break;
case SDL_SYSTEM_CURSOR_WINDOW_BOTTOMLEFT:
case SDL_SYSTEM_CURSOR_SW_RESIZE:
cursor_type = 1016; //PointerIcon.TYPE_TOP_RIGHT_DIAGONAL_DOUBLE_ARROW;
break;
case SDL_SYSTEM_CURSOR_WINDOW_LEFT:
case SDL_SYSTEM_CURSOR_W_RESIZE:
cursor_type = 1014; //PointerIcon.TYPE_HORIZONTAL_DOUBLE_ARROW;
break;
case SDL_SYSTEM_CURSOR_CONTEXT_MENU:
cursor_type = 1001; //PointerIcon.TYPE_CONTEXT_MENU;
break;
case SDL_SYSTEM_CURSOR_HELP:
cursor_type = 1003; //PointerIcon.TYPE_HELP;
break;
case SDL_SYSTEM_CURSOR_CELL:
cursor_type = 1006; //PointerIcon.TYPE_CELL;
break;
case SDL_SYSTEM_CURSOR_VERTICAL_TEXT:
cursor_type = 1009; //PointerIcon.TYPE_VERTICAL_TEXT;
break;
case SDL_SYSTEM_CURSOR_ALIAS:
cursor_type = 1010; //PointerIcon.TYPE_ALIAS;
break;
case SDL_SYSTEM_CURSOR_COPY:
cursor_type = 1011; //PointerIcon.TYPE_COPY;
break;
case SDL_SYSTEM_CURSOR_NO_DROP:
cursor_type = 1012; //PointerIcon.TYPE_NO_DROP;
break;
case SDL_SYSTEM_CURSOR_GRAB:
cursor_type = 1020; //PointerIcon.TYPE_GRAB;
break;
case SDL_SYSTEM_CURSOR_GRABBING:
cursor_type = 1021; //PointerIcon.TYPE_GRABBING;
break;
case SDL_SYSTEM_CURSOR_COL_RESIZE:
cursor_type = 1014; //PointerIcon.TYPE_HORIZONTAL_DOUBLE_ARROW;
break;
case SDL_SYSTEM_CURSOR_ROW_RESIZE:
cursor_type = 1015; //PointerIcon.TYPE_VERTICAL_DOUBLE_ARROW;
break;
case SDL_SYSTEM_CURSOR_ALL_SCROLL:
cursor_type = 1013; //PointerIcon.TYPE_ALL_SCROLL;
break;
case SDL_SYSTEM_CURSOR_ZOOM_IN:
cursor_type = 1018; //PointerIcon.TYPE_ZOOM_IN;
break;
case SDL_SYSTEM_CURSOR_ZOOM_OUT:
cursor_type = 1019; //PointerIcon.TYPE_ZOOM_OUT;
break;
}
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */) {
try {
@ -1940,7 +2009,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
return;
}
Activity activity = (Activity)getContext();
Activity activity = getContext();
if (activity.checkSelfPermission(permission) != PackageManager.PERMISSION_GRANTED) {
activity.requestPermissions(new String[]{permission}, requestCode);
} else {
@ -1963,7 +2032,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
int flags = Intent.FLAG_ACTIVITY_NO_HISTORY
int flags = Intent.FLAG_ACTIVITY_NO_HISTORY
| Intent.FLAG_ACTIVITY_MULTIPLE_TASK
| Intent.FLAG_ACTIVITY_NEW_DOCUMENT;
i.addFlags(flags);
@ -2041,19 +2110,16 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
/**
* This method is called by SDL using JNI.
*/
public static boolean showFileDialog(String[] filters, boolean allowMultiple, boolean forWrite, int requestCode) {
public static boolean showFileDialog(String[] filters, boolean allowMultiple,
int type, String initialPath, int requestCode) {
if (mSingleton == null) {
return false;
}
if (forWrite) {
allowMultiple = false;
}
/* Convert string list of extensions to their respective MIME types */
/* Convert string list of extensions to their respective MIME types (not needed for folder selection) */
ArrayList<String> mimes = new ArrayList<>();
MimeTypeMap mimeTypeMap = MimeTypeMap.getSingleton();
if (filters != null) {
if (filters != null && type != SDL_FILEDIALOG_OPENFOLDER) {
for (String pattern : filters) {
String[] extensions = pattern.split(";");
@ -2071,40 +2137,89 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
}
}
/* Display the file dialog */
Intent intent = new Intent(forWrite ? Intent.ACTION_CREATE_DOCUMENT : Intent.ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, allowMultiple);
switch (mimes.size()) {
case 0:
intent.setType("*/*");
break;
case 1:
intent.setType(mimes.get(0));
break;
default:
intent.setType("*/*");
intent.putExtra(Intent.EXTRA_MIME_TYPES, mimes.toArray(new String[]{}));
/* Handle the initial path, if set */
Uri initialPathUri = null;
if (initialPath != null && !initialPath.isEmpty()) {
try {
initialPathUri = Uri.parse(initialPath);
} catch (Exception e) {
Log.e(TAG, "Failed to parse initial path URI, ignoring initial path", e);
}
}
boolean persistable = SDLActivity.nativeGetHintBoolean("SDL_ANDROID_ALLOW_PERSISTENT_FOLDER_ACCESS", false);
/* Select the intent based on the type */
String action;
switch (type) {
case SDL_FILEDIALOG_OPENFILE:
action = Intent.ACTION_OPEN_DOCUMENT;
break;
case SDL_FILEDIALOG_SAVEFILE:
action = Intent.ACTION_CREATE_DOCUMENT;
allowMultiple = false;
break;
case SDL_FILEDIALOG_OPENFOLDER:
action = Intent.ACTION_OPEN_DOCUMENT_TREE;
break;
default:
Log.e(TAG, "Unsupported file dialog type: " + type);
return false;
}
/* Prepare the intent with the proper values */
Intent intent = new Intent(action);
if (type != SDL_FILEDIALOG_OPENFOLDER) {
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, allowMultiple);
switch (mimes.size()) {
case 0:
intent.setType("*/*");
break;
case 1:
intent.setType(mimes.get(0));
break;
default:
intent.setType("*/*");
intent.putExtra(Intent.EXTRA_MIME_TYPES, mimes.toArray(new String[]{}));
}
} else {
int intent_flags = Intent.FLAG_GRANT_READ_URI_PERMISSION |
Intent.FLAG_GRANT_WRITE_URI_PERMISSION;
if (persistable) {
intent_flags |= Intent.FLAG_GRANT_PREFIX_URI_PERMISSION |
Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION;
}
intent.addFlags(intent_flags);
}
if (initialPathUri != null) {
intent.putExtra(DocumentsContract.EXTRA_INITIAL_URI, initialPathUri);
}
/* Display the file/folder dialog */
try {
mSingleton.startActivityForResult(intent, requestCode);
} catch (ActivityNotFoundException e) {
Log.e(TAG, "Unable to open file dialog.", e);
Log.e(TAG, "Unable to open dialog.", e);
return false;
}
/* Save current dialog state */
mFileDialogState = new SDLFileDialogState();
mFileDialogState.requestCode = requestCode;
mFileDialogState.multipleChoice = allowMultiple;
mFileDialogState.type = type;
mFileDialogState.persistable = persistable;
return true;
}
/* Internal class used to track active open file dialog */
/* Internal class used to track active file dialog */
static class SDLFileDialogState {
int requestCode;
boolean multipleChoice;
int type;
boolean persistable;
}
/**

View file

@ -10,6 +10,10 @@ import android.hardware.lights.Light;
import android.hardware.lights.LightsRequest;
import android.hardware.lights.LightsManager;
import android.hardware.lights.LightState;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.graphics.Color;
import android.os.Build;
import android.os.VibrationEffect;
@ -30,16 +34,18 @@ public class SDLControllerManager
static native void nativeAddJoystick(int device_id, String name, String desc,
int vendor_id, int product_id,
int button_mask,
int naxes, int axis_mask, int nhats, boolean can_rumble, boolean has_rgb_led);
int naxes, int axis_mask, int nhats, boolean can_rumble, boolean has_rgb_led,
boolean has_accelerometer, boolean has_gyroscope);
static native void nativeRemoveJoystick(int device_id);
static native void nativeAddHaptic(int device_id, String name);
static native void nativeRemoveHaptic(int device_id);
static public native boolean onNativePadDown(int device_id, int keycode);
static public native boolean onNativePadUp(int device_id, int keycode);
static public native boolean onNativePadDown(int device_id, int keycode, int scancode);
static public native boolean onNativePadUp(int device_id, int keycode, int scancode);
static native void onNativeJoy(int device_id, int axis,
float value);
static native void onNativeHat(int device_id, int hat_id,
int x, int y);
static native void onNativeJoySensor(int device_id, int sensor_type, long sensor_timestamp, float x, float y, float z);
protected static SDLJoystickHandler mJoystickHandler;
protected static SDLHapticHandler mHapticHandler;
@ -81,6 +87,13 @@ public class SDLControllerManager
mJoystickHandler.setLED(device_id, red, green, blue);
}
/**
* This method is called by SDL using JNI.
*/
static void joystickSetSensorsEnabled(int device_id, boolean enabled) {
mJoystickHandler.setSensorsEnabled(device_id, enabled);
}
/**
* This method is called by SDL using JNI.
*/
@ -153,6 +166,10 @@ class SDLJoystickHandler {
ArrayList<InputDevice.MotionRange> hats;
ArrayList<Light> lights;
LightsManager.LightsSession lightsSession;
SensorManager sensorManager;
SDLJoySensorListener sensorListener;
Sensor accelerometerSensor;
Sensor gyroscopeSensor;
}
static class RangeComparator implements Comparator<InputDevice.MotionRange> {
@Override
@ -241,6 +258,8 @@ class SDLJoystickHandler {
boolean can_rumble = false;
boolean has_rgb_led = false;
boolean has_accelerometer = false;
boolean has_gyroscope = false;
if (Build.VERSION.SDK_INT >= 31 /* Android 12.0 (S) */) {
VibratorManager vibratorManager = joystickDevice.getVibratorManager();
int[] vibrators = vibratorManager.getVibratorIds();
@ -258,12 +277,26 @@ class SDLJoystickHandler {
joystick.lightsSession = lightsManager.openSession();
has_rgb_led = true;
}
SensorManager sensorManager = joystickDevice.getSensorManager();
if (sensorManager != null) {
joystick.sensorManager = sensorManager;
joystick.sensorListener = new SDLJoySensorListener(joystick.device_id);
joystick.accelerometerSensor = sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
if (joystick.accelerometerSensor != null) {
has_accelerometer = true;
}
joystick.gyroscopeSensor = sensorManager.getDefaultSensor(Sensor.TYPE_GYROSCOPE);
if (joystick.gyroscopeSensor != null) {
has_gyroscope = true;
}
}
}
mJoysticks.add(joystick);
SDLControllerManager.nativeAddJoystick(joystick.device_id, joystick.name, joystick.desc,
getVendorId(joystickDevice), getProductId(joystickDevice),
getButtonMask(joystickDevice), joystick.axes.size(), getAxisMask(joystick.axes), joystick.hats.size()/2, can_rumble, has_rgb_led);
getButtonMask(joystickDevice), joystick.axes.size(), getAxisMask(joystick.axes), joystick.hats.size()/2, can_rumble, has_rgb_led,
has_accelerometer, has_gyroscope);
}
}
}
@ -508,6 +541,31 @@ class SDLJoystickHandler {
}
joystick.lightsSession.requestLights(lightsRequest.build());
}
void setSensorsEnabled(int device_id, boolean enabled) {
if (Build.VERSION.SDK_INT < 31 /* Android 12.0 (S) */) {
return;
}
SDLJoystick joystick = getJoystick(device_id);
if (joystick == null || joystick.sensorManager == null) {
return;
}
if (enabled) {
if (joystick.accelerometerSensor != null) {
SDLSensorManager.registerListener(joystick.sensorManager, joystick.sensorListener, joystick.accelerometerSensor, SensorManager.SENSOR_DELAY_GAME);
}
if (joystick.gyroscopeSensor != null) {
SDLSensorManager.registerListener(joystick.sensorManager, joystick.sensorListener, joystick.gyroscopeSensor, SensorManager.SENSOR_DELAY_GAME);
}
} else {
if (joystick.accelerometerSensor != null) {
SDLSensorManager.unregisterListener(joystick.sensorManager, joystick.sensorListener, joystick.accelerometerSensor);
}
if (joystick.gyroscopeSensor != null) {
SDLSensorManager.unregisterListener(joystick.sensorManager, joystick.sensorListener, joystick.gyroscopeSensor);
}
}
}
}
class SDLHapticHandler_API31 extends SDLHapticHandler {
@ -933,3 +991,19 @@ class SDLGenericMotionListener_API29 extends SDLGenericMotionListener_API26 {
return penDevice.isExternal() ? SDL_PEN_DEVICE_TYPE_INDIRECT : SDL_PEN_DEVICE_TYPE_DIRECT;
}
}
class SDLJoySensorListener implements SensorEventListener {
int device_id;
public SDLJoySensorListener(int device_id) {
this.device_id = device_id;
}
@Override
public void onAccuracyChanged(Sensor sensor, int accuracy) {}
@Override
public void onSensorChanged(SensorEvent event) {
SDLControllerManager.onNativeJoySensor(device_id, event.sensor.getType(), event.timestamp, event.values[0], event.values[1], event.values[2]);
}
}

View file

@ -0,0 +1,32 @@
package org.libsdl.app;
import android.hardware.Sensor;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
// This class coordinates synchronized access to sensor manager registration
//
// This prevents a java.util.ConcurrentModificationException exception on
// Android 16, specifically on the Samsung Tab S9 Ultra.
class SDLSensorManager
{
static private SDLSensorManager mManager = new SDLSensorManager();
public static void registerListener(SensorManager manager, SensorEventListener listener, Sensor sensor, int samplingPeriodUs) {
mManager.RegisterListener(manager, listener, sensor, samplingPeriodUs);
}
public static void unregisterListener(SensorManager manager, SensorEventListener listener, Sensor sensor) {
mManager.UnregisterListener(manager, listener, sensor);
}
private synchronized void RegisterListener(SensorManager manager, SensorEventListener listener, Sensor sensor, int samplingPeriodUs) {
manager.registerListener(listener, sensor, samplingPeriodUs, null);
}
private synchronized void UnregisterListener(SensorManager manager, SensorEventListener listener, Sensor sensor) {
manager.unregisterListener(listener, sensor);
}
}

View file

@ -45,6 +45,9 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
// Is SurfaceView ready for rendering
protected boolean mIsSurfaceReady;
// Is on-screen keyboard visible
protected boolean mKeyboardVisible;
// Pinch events
private final ScaleGestureDetector scaleGestureDetector;
@ -208,6 +211,18 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
WindowInsets.Type.displayCutout());
SDLActivity.onNativeInsetsChanged(combined.left, combined.right, combined.top, combined.bottom);
if (insets.isVisible(WindowInsets.Type.ime())) {
if (!mKeyboardVisible) {
mKeyboardVisible = true;
SDLActivity.onNativeScreenKeyboardShown();
}
} else {
if (mKeyboardVisible) {
mKeyboardVisible = false;
SDLActivity.onNativeScreenKeyboardHidden();
}
}
}
// Pass these to any child views in case they need them
@ -313,11 +328,11 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
protected void enableSensor(int sensortype, boolean enabled) {
// TODO: This uses getDefaultSensor - what if we have >1 accels?
if (enabled) {
mSensorManager.registerListener(this,
SDLSensorManager.registerListener(mSensorManager, this,
mSensorManager.getDefaultSensor(sensortype),
SensorManager.SENSOR_DELAY_GAME, null);
SensorManager.SENSOR_DELAY_GAME);
} else {
mSensorManager.unregisterListener(this,
SDLSensorManager.unregisterListener(mSensorManager, this,
mSensorManager.getDefaultSensor(sensortype));
}
}

View file

@ -175,12 +175,15 @@ class VisualStudio:
assert msbuild_path.is_file(), "MSBuild.exe does not exist"
return msbuild_path
def build(self, arch_platform: VsArchPlatformConfig, projects: list[Path]):
def build(self, arch_platform: VsArchPlatformConfig, projects: list[Path], include_paths: list[str]):
assert projects, "Need at least one project to build"
vsdev_cmd_str = f"\"{self.vsdevcmd}\" -arch={arch_platform.arch}"
msbuild_cmd_str = " && ".join([f"\"{self.msbuild}\" \"{project}\" /m /p:BuildInParallel=true /p:Platform={arch_platform.platform} /p:Configuration={arch_platform.configuration}" for project in projects])
bat_contents = f"{vsdev_cmd_str} && {msbuild_cmd_str}\n"
include_contents = "%INCLUDE%"
if include_paths:
include_contents = f"{';'.join(str(p) for p in include_paths)};" + include_contents
bat_contents = textwrap.dedent(f"{vsdev_cmd_str} && set INCLUDE={include_contents} && {msbuild_cmd_str}")
bat_path = Path(tempfile.gettempdir()) / "cmd.bat"
with bat_path.open("w") as f:
f.write(bat_contents)
@ -740,6 +743,12 @@ class Releaser:
member.name = "/".join(Path(member.name).parts[1:])
return member
for dep in self.release_info.get("dependencies", {}):
if "command" in self.release_info["dependencies"][dep]:
for arch, triplet in ARCH_TO_TRIPLET.items():
shutil.copytree(self.deps_path / dep, str(mingw_deps_path / triplet), dirs_exist_ok=True)
(mingw_deps_path / triplet / "bin").mkdir(exist_ok=True)
(mingw_deps_path / triplet / "lib/pkgconfig").mkdir(exist_ok=True, parents=True)
continue
extract_path = mingw_deps_path / f"extract-{dep}"
extract_path.mkdir()
with chdir(extract_path):
@ -856,8 +865,8 @@ class Releaser:
f"cmake",
f"-S", str(self.root), "-B", str(build_path),
f"-DCMAKE_BUILD_TYPE={build_type}",
f'''-DCMAKE_C_FLAGS="-ffile-prefix-map={self.root}=/src/{self.project}"''',
f'''-DCMAKE_CXX_FLAGS="-ffile-prefix-map={self.root}=/src/{self.project}"''',
f'''-DCMAKE_C_FLAGS="-ffile-prefix-map={self.root}=/src/{self.project}" "-I{str(mingw_deps_path / triplet)}/include"''',
f'''-DCMAKE_CXX_FLAGS="-ffile-prefix-map={self.root}=/src/{self.project}" "-I{str(mingw_deps_path / triplet)}/include"''',
f"-DCMAKE_PREFIX_PATH={mingw_deps_path / triplet}",
f"-DCMAKE_INSTALL_PREFIX={install_path}",
f"-DCMAKE_INSTALL_INCLUDEDIR=include",
@ -1129,6 +1138,15 @@ class Releaser:
f.write(f"dep-path={self.deps_path.absolute()}\n")
for dep, depinfo in self.release_info.get("dependencies", {}).items():
if "command" in depinfo:
(self.deps_path / dep).mkdir(exist_ok=True, parents=True)
command_args = configure_text_list(shlex.split(depinfo["command"]), context=self.get_context(extra_context={
"DEPS_PATH": str(self.deps_path / dep),
}))
if command_args[0].endswith(".py"):
command_args.insert(0, sys.executable)
self.executer.run(command_args)
continue
startswith = depinfo["startswith"]
dep_repo = depinfo["repo"]
dep_string_data = self.executer.check_output(["gh", "-R", dep_repo, "release", "list", "--exclude-drafts", "--exclude-pre-releases", "--json", "name,createdAt,tagName", "--jq", f'[.[]|select(.name|startswith("{startswith}"))]|max_by(.createdAt)']).strip()
@ -1143,6 +1161,10 @@ class Releaser:
def verify_dependencies(self):
for dep, depinfo in self.release_info.get("dependencies", {}).items():
if "command" in depinfo:
command_matches = glob.glob(depinfo["artifact"], root_dir=self.deps_path)
assert len(command_matches) == 1, f"Exactly one archive matches command {dep} dependency: {command_matches}"
continue
if "mingw" in self.release_info:
mingw_matches = glob.glob(self.release_info["mingw"]["dependencies"][dep]["artifact"], root_dir=self.deps_path)
assert len(mingw_matches) == 1, f"Exactly one archive matches mingw {dep} dependency: {mingw_matches}"
@ -1174,7 +1196,12 @@ class Releaser:
deps_path = self.root / "msvc-deps"
shutil.rmtree(deps_path, ignore_errors=True)
dep_roots = []
for dep, depinfo in self.release_info["msvc"].get("dependencies", {}).items():
dep_includes = []
for dep in self.release_info.get("dependencies"):
if "command" in self.release_info["dependencies"][dep]:
dep_includes.append(self.deps_path / dep / "include")
continue
depinfo = self.release_info["msvc"]["dependencies"][dep]
dep_extract_path = deps_path / f"extract-{dep}"
msvc_zip = self.deps_path / glob.glob(depinfo["artifact"], root_dir=self.deps_path)[0]
with zipfile.ZipFile(msvc_zip, "r") as zf:
@ -1184,13 +1211,18 @@ class Releaser:
dep_roots.append(contents_msvc_zip[0])
for arch in self.release_info["msvc"].get("cmake", {}).get("archs", []):
self._build_msvc_cmake(arch_platform=self._arch_to_vs_platform(arch=arch), dep_roots=dep_roots)
self._build_msvc_cmake(arch_platform=self._arch_to_vs_platform(arch=arch), dep_roots=dep_roots, dep_includes=dep_includes)
with self.section_printer.group("Create SDL VC development zip"):
self._build_msvc_devel()
def _build_msvc_msbuild(self, arch_platform: VsArchPlatformConfig, vs: VisualStudio):
platform_context = self.get_context(arch_platform.extra_context())
for dep, depinfo in self.release_info["msvc"].get("dependencies", {}).items():
include_paths = []
for dep in self.release_info.get("dependencies", {}):#release_info["msvc"].get("dependencies", {}).items():
if "command" in self.release_info["dependencies"][dep]:
include_paths.append(self.deps_path / dep / "include")
continue
depinfo = self.release_info["msvc"]["dependencies"][dep]
msvc_zip = self.deps_path / glob.glob(depinfo["artifact"], root_dir=self.deps_path)[0]
src_globs = [configure_text(instr["src"], context=platform_context) for instr in depinfo["copy"]]
@ -1238,7 +1270,7 @@ class Releaser:
shutil.copy(src=src, dst=dir_b_props)
with self.section_printer.group(f"Build {arch_platform.arch} VS binary"):
vs.build(arch_platform=arch_platform, projects=projects)
vs.build(arch_platform=arch_platform, projects=projects, include_paths=include_paths)
if self.dry:
for b in built_paths:
@ -1274,7 +1306,7 @@ class Releaser:
def _arch_platform_to_install_path(self, arch_platform: VsArchPlatformConfig) -> Path:
return self._arch_platform_to_build_path(arch_platform) / "prefix"
def _build_msvc_cmake(self, arch_platform: VsArchPlatformConfig, dep_roots: list[Path]):
def _build_msvc_cmake(self, arch_platform: VsArchPlatformConfig, dep_roots: list[Path], dep_includes: list[Path]):
build_path = self._arch_platform_to_build_path(arch_platform)
install_path = self._arch_platform_to_install_path(arch_platform)
platform_context = self.get_context(extra_context=arch_platform.extra_context())
@ -1290,7 +1322,7 @@ class Releaser:
if not self.fast:
for b in built_paths:
b.unlink(missing_ok=True)
cppflags = list(f"-I{inc}" for inc in dep_includes)
shutil.rmtree(install_path, ignore_errors=True)
build_path.mkdir(parents=True, exist_ok=True)
with self.section_printer.group(f"Configure VC CMake project for {arch_platform.arch}"):
@ -1303,6 +1335,8 @@ class Releaser:
"-DCMAKE_INSTALL_LIBDIR=lib",
f"-DCMAKE_BUILD_TYPE={build_type}",
f"-DCMAKE_INSTALL_PREFIX={install_path}",
f"-DCMAKE_C_FLAGS={shlex.join(cppflags)}",
f"-DCMAKE_CXX_FLAGS={shlex.join(cppflags)}",
# MSVC debug information format flags are selected by an abstraction
"-DCMAKE_POLICY_DEFAULT_CMP0141=NEW",
# MSVC debug information format

View file

@ -0,0 +1,17 @@
# DJGPP platform overrides for DOS
#
# CMake's built-in Platform/DOS.cmake assumes OpenWatcom naming conventions
# (no prefix, .lib suffix, CMAKE_LINK_LIBRARY_SUFFIX=".lib"). DJGPP uses
# standard Unix/GCC conventions for its system libraries (lib prefix, .a
# suffix e.g. libm.a).
#
# This file is loaded via CMAKE_USER_MAKE_RULES_OVERRIDE in the toolchain
# file, which runs *after* the platform module has set its defaults, giving
# us the final say on these variables.
set(CMAKE_STATIC_LIBRARY_PREFIX "lib")
set(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
set(CMAKE_LINK_LIBRARY_SUFFIX "")
set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "")
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" ".lib")
set(CMAKE_EXECUTABLE_SUFFIX ".exe")

View file

@ -0,0 +1,44 @@
#!/usr/bin/env python3
import argparse
import logging
from pathlib import Path
import urllib.request
logger = logging.getLogger(__name__)
def download_headers(tag: str, lowercase: bool, output: Path):
base_url = f"https://raw.githubusercontent.com/microsoftconnect/GameInput/refs/tags/{tag}/"
url_relpaths = (
"include/GameInput.h",
"include/v0/GameInput.h",
"include/v1/GameInput.h",
"include/v2/GameInput.h",
)
remove_prefix = "include/"
for url_relpath in url_relpaths:
url = base_url + url_relpath
local_relpath = url_relpath.removeprefix(remove_prefix)
if lowercase:
local_relpath = local_relpath.lower()
local_path = output / local_relpath
local_dirpath = local_path.parent
local_dirpath.mkdir(parents=False, exist_ok=True)
logger.info("Downloading %s to %s...", url, local_path)
urllib.request.urlretrieve(url, local_path)
logger.info("... done")
def main():
logging.basicConfig(level=logging.INFO)
parser = argparse.ArgumentParser(description="Download Microsoft.GameInput headers", allow_abbrev=False)
parser.add_argument("--version", required=True, help="GameInput release tag (see https://github.com/microsoftconnect/GameInput/tags)")
parser.add_argument("--no-lowercase", action="store_false", dest="lowercase", help="Don't lowercase downloaded headers")
parser.add_argument("-o", "--output", type=Path, default=Path.cwd(), help="Headers will be stored here (subdirectories created as ")
args = parser.parse_args()
download_headers(tag=args.version, lowercase=args.lowercase, output=args.output)
if __name__ == "__main__":
raise SystemExit(main())

View file

@ -0,0 +1,82 @@
set(CMAKE_SYSTEM_NAME DOS)
set(DJGPP TRUE)
# CMake's Platform/DOS.cmake assumes OpenWatcom naming conventions (no prefix,
# .lib suffix). DJGPP uses standard Unix/GCC conventions for its system
# libraries (lib prefix, .a suffix e.g. libm.a), so we override the platform
# defaults via CMAKE_USER_MAKE_RULES_OVERRIDE, which runs *after* the platform
# module has set its defaults, giving us the final say on these variables.
# The path must be cached because CMake re-parses the toolchain file during
# try_compile, where CMAKE_CURRENT_LIST_DIR may point elsewhere.
set(DJGPP_PLATFORM_OVERRIDES "${CMAKE_CURRENT_LIST_DIR}/djgpp-platform-overrides.cmake" CACHE FILEPATH "" FORCE)
set(CMAKE_USER_MAKE_RULES_OVERRIDE "${DJGPP_PLATFORM_OVERRIDES}")
set(CMAKE_STATIC_LIBRARY_PREFIX "lib")
set(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
set(CMAKE_SHARED_LIBRARY_PREFIX "")
set(CMAKE_SHARED_LIBRARY_SUFFIX ".dll")
set(CMAKE_IMPORT_LIBRARY_PREFIX "lib")
set(CMAKE_IMPORT_LIBRARY_SUFFIX ".a")
set(CMAKE_EXECUTABLE_SUFFIX ".exe")
set(CMAKE_LINK_LIBRARY_SUFFIX "")
set(CMAKE_DL_LIBS "")
set(CMAKE_FIND_LIBRARY_PREFIXES "lib")
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
#
# CMake toolchain file for DJGPP. Usage:
#
# 1. Download and extract DGJPP
# 2. Add directory containing i586-pc-msdosdjgpp-gcc to PATH environment variable
# 3. When configuring your CMake project, specify the toolchain file like this:
#
# cmake -DCMAKE_TOOLCHAIN_FILE=path/to/i586-pc-msdosdjgpp.cmake ...
#
# specify the cross compiler
find_program(CMAKE_C_COMPILER NAMES "i586-pc-msdosdjgpp-gcc" "i386-pc-msdosdjgpp-gcc" REQUIRED)
find_program(CMAKE_CXX_COMPILER NAMES "i586-pc-msdosdjgpp-g++" "i386-pc-msdosdjgpp-g++" REQUIRED)
execute_process(COMMAND "${CMAKE_C_COMPILER}" -print-search-dirs
RESULT_VARIABLE CC_SEARCH_DIRS_RESULT
OUTPUT_VARIABLE CC_SEARCH_DIRS_OUTPUT)
if(CC_SEARCH_DIRS_RESULT)
message(FATAL_ERROR "Could not determine search dirs")
endif()
string(REGEX MATCH ".*libraries: (.*).*" CC_SD_LIBS "${CC_SEARCH_DIRS_OUTPUT}")
string(STRIP "${CMAKE_MATCH_1}" CC_SEARCH_DIRS)
string(REPLACE ":" ";" CC_SEARCH_DIRS "${CC_SEARCH_DIRS}")
foreach(CC_SEARCH_DIR ${CC_SEARCH_DIRS})
if(CC_SEARCH_DIR MATCHES "=.*")
string(REGEX MATCH "=(.*)" CC_LIB "${CC_SEARCH_DIR}")
set(CC_SEARCH_DIR "${CMAKE_MATCH_1}")
endif()
if(IS_DIRECTORY "${CC_SEARCH_DIR}")
if(IS_DIRECTORY "${CC_SEARCH_DIR}/../include" OR IS_DIRECTORY "${CC_SEARCH_DIR}/../lib" OR IS_DIRECTORY "${CC_SEARCH_DIR}/../bin")
list(APPEND CC_ROOTS "${CC_SEARCH_DIR}/..")
else()
list(APPEND CC_ROOTS "${CC_SEARCH_DIR}")
endif()
endif()
endforeach()
list(APPEND CMAKE_FIND_ROOT_PATH ${CC_ROOTS})
# search for programs in the host directories
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries, headers and packages in the target directories
if(NOT DEFINED CACHE{CMAKE_FIND_ROOT_PATH_MODE_LIBRARY})
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
endif()
if(NOT DEFINED CACHE{CMAKE_FIND_ROOT_PATH_MODE_INCLUDE})
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
endif()
if(NOT DEFINED CACHE{CMAKE_FIND_ROOT_PATH_MODE_PACKAGE})
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
endif()

View file

@ -1,6 +1,12 @@
{
"name": "SDL3",
"remote": "libsdl-org/SDL",
"dependencies": {
"gameinput": {
"command": "build-scripts/download-gameinput-headers.py -o @<@DEPS_PATH@>@/include --version v3.3.195.0",
"artifact": "gameinput/include/gameinput.h"
}
},
"version": {
"file": "include/SDL3/SDL_version.h",
"re_major": "^#define SDL_MAJOR_VERSION\\s+([0-9]+)$",
@ -54,6 +60,9 @@
"build-scripts/pkg-support/mingw/cmake/SDL3Config.cmake",
"build-scripts/pkg-support/mingw/cmake/SDL3ConfigVersion.cmake"
]
},
"dependencies": {
"gameinput": {}
}
},
"msvc": {
@ -129,6 +138,9 @@
"include/SDL3": [
"include/SDL3/*.h"
]
},
"dependencies": {
"gameinput": {}
}
},
"android": {

View file

@ -262,8 +262,6 @@ def main():
parser.add_argument("--no-user-props", required=False, dest="user_props", action="store_false", help="Don't ")
args = parser.parse_args()
logging.basicConfig(level=logging.INFO)
git_ref = None
gdk_edition = None
if args.ref_edition is not None:

View file

@ -2912,6 +2912,11 @@ __EOF__
$brief = shift @briefsplit;
$brief = dewikify($wikitype, $brief);
# Hack: `apropros` doesn't like escaped character things like `\[char46]` for `.`...since almost every
# manpage will end their Brief section with a period and it won't wordwrap to risk being a groff control
# character, just replace it.
$brief =~ s/\\\[char46\]/./g;
if (defined $remarks) {
$remarks = dewikify($wikitype, join("\n", @briefsplit) . $remarks);
}

208
cmake/PreseedDOSCache.cmake Normal file
View file

@ -0,0 +1,208 @@
if(CMAKE_SYSTEM_NAME STREQUAL "DOS")
function(SDL_Preseed_CMakeCache)
# SIMD intrinsics: disabled for DOS regardless of compiler version.
# The DJGPP cross-compiler can *compile* SSE/AVX/MMX, but no real DOS
# target machine supports them. Enabling these caused audio breakage.
set(COMPILER_SUPPORTS_ARMNEON "" CACHE INTERNAL "Test COMPILER_SUPPORTS_ARMNEON")
set(COMPILER_SUPPORTS_AVX "" CACHE INTERNAL "Test COMPILER_SUPPORTS_AVX")
set(COMPILER_SUPPORTS_AVX2 "" CACHE INTERNAL "Test COMPILER_SUPPORTS_AVX2")
set(COMPILER_SUPPORTS_AVX512F "" CACHE INTERNAL "Test COMPILER_SUPPORTS_AVX512F")
set(COMPILER_SUPPORTS_MMX "" CACHE INTERNAL "Test COMPILER_SUPPORTS_MMX")
set(COMPILER_SUPPORTS_SSE "" CACHE INTERNAL "Test COMPILER_SUPPORTS_SSE")
set(COMPILER_SUPPORTS_SSE2 "" CACHE INTERNAL "Test COMPILER_SUPPORTS_SSE2")
set(COMPILER_SUPPORTS_SSE3 "" CACHE INTERNAL "Test COMPILER_SUPPORTS_SSE3")
set(COMPILER_SUPPORTS_SSE4_1 "" CACHE INTERNAL "Test COMPILER_SUPPORTS_SSE4_1")
set(COMPILER_SUPPORTS_SSE4_2 "" CACHE INTERNAL "Test COMPILER_SUPPORTS_SSE4_2")
check_c_source_compiles("
#if !defined(__GNUC__) || (__GNUC__ < 7)
#error Preseeding is only supported for DJGPP GCC 7 or newer
#endif
int main(int argc, char **argv) { return 0; }
" CAN_PRESEED
)
if(CAN_PRESEED)
set(COMPILER_SUPPORTS_FDIAGNOSTICS_COLOR_ALWAYS "1" CACHE INTERNAL "Test COMPILER_SUPPORTS_FDIAGNOSTICS_COLOR_ALWAYS")
set(COMPILER_SUPPORTS_GCC_ATOMICS "" CACHE INTERNAL "Test COMPILER_SUPPORTS_GCC_ATOMICS")
set(COMPILER_SUPPORTS_SYNC_LOCK_TEST_AND_SET "1" CACHE INTERNAL "Test COMPILER_SUPPORTS_SYNC_LOCK_TEST_AND_SET")
set(HAVE_CLANG_COMMENT_BLOCK_COMMANDS "" CACHE INTERNAL "Test HAVE_CLANG_COMMENT_BLOCK_COMMANDS")
set(HAVE_ALLOCA_H "" CACHE INTERNAL "Have include alloca.h")
set(HAVE_LIBM "1" CACHE INTERNAL "Have library m")
set(HAVE_POSIX_SPAWN "" CACHE INTERNAL "Have symbol posix_spawn")
set(HAVE_FSEEKO "1" CACHE INTERNAL "Have symbol fseeko")
set(HAVE_OFF64_T "1" CACHE INTERNAL "Have symbol off64_t")
set(LIBC_HAS_ABS "1" CACHE INTERNAL "Have symbol abs")
set(LIBC_HAS_ACOS "1" CACHE INTERNAL "Have symbol acos")
set(LIBC_HAS_ACOSF "1" CACHE INTERNAL "Have symbol acosf")
set(LIBC_HAS_ASIN "1" CACHE INTERNAL "Have symbol asin")
set(LIBC_HAS_ASINF "1" CACHE INTERNAL "Have symbol asinf")
set(LIBC_HAS_ATAN "1" CACHE INTERNAL "Have symbol atan")
set(LIBC_HAS_ATAN2 "1" CACHE INTERNAL "Have symbol atan2")
set(LIBC_HAS_ATAN2F "1" CACHE INTERNAL "Have symbol atan2f")
set(LIBC_HAS_ATANF "1" CACHE INTERNAL "Have symbol atanf")
set(LIBC_HAS_ATOF "1" CACHE INTERNAL "Have symbol atof")
set(LIBC_HAS_ATOI "1" CACHE INTERNAL "Have symbol atoi")
set(LIBC_HAS_BCOPY "1" CACHE INTERNAL "Have symbol bcopy")
set(LIBC_HAS_CALLOC "" CACHE INTERNAL "Have symbol calloc")
set(LIBC_HAS_CEIL "1" CACHE INTERNAL "Have symbol ceil")
set(LIBC_HAS_CEILF "1" CACHE INTERNAL "Have symbol ceilf")
set(LIBC_HAS_COPYSIGN "1" CACHE INTERNAL "Have symbol copysign")
set(LIBC_HAS_COPYSIGNF "1" CACHE INTERNAL "Have symbol copysignf")
set(LIBC_HAS_COS "1" CACHE INTERNAL "Have symbol cos")
set(LIBC_HAS_COSF "1" CACHE INTERNAL "Have symbol cosf")
set(LIBC_HAS_EXP "1" CACHE INTERNAL "Have symbol exp")
set(LIBC_HAS_EXPF "1" CACHE INTERNAL "Have symbol expf")
set(LIBC_HAS_FABS "1" CACHE INTERNAL "Have symbol fabs")
set(LIBC_HAS_FABSF "1" CACHE INTERNAL "Have symbol fabsf")
set(LIBC_HAS_FLOAT_H "1" CACHE INTERNAL "Have include float.h")
set(LIBC_HAS_FLOOR "1" CACHE INTERNAL "Have symbol floor")
set(LIBC_HAS_FLOORF "1" CACHE INTERNAL "Have symbol floorf")
set(LIBC_HAS_FMOD "1" CACHE INTERNAL "Have symbol fmod")
set(LIBC_HAS_FMODF "1" CACHE INTERNAL "Have symbol fmodf")
set(LIBC_HAS_FOPEN64 "" CACHE INTERNAL "Have symbol fopen64")
set(LIBC_HAS_FREE "" CACHE INTERNAL "Have symbol free")
set(LIBC_HAS_FSEEKO "1" CACHE INTERNAL "Have symbol fseeko")
set(LIBC_HAS_FSEEKO64 "" CACHE INTERNAL "Have symbol fseeko64 (broken in DJGPP)")
set(LIBC_HAS_GETENV "1" CACHE INTERNAL "Have symbol getenv")
set(LIBC_HAS_ICONV_H "" CACHE INTERNAL "Have include iconv.h")
set(LIBC_HAS_INDEX "1" CACHE INTERNAL "Have symbol index")
set(LIBC_HAS_INTTYPES_H "1" CACHE INTERNAL "Have include inttypes.h")
set(LIBC_HAS_ISINF "1" CACHE INTERNAL "Have include isinf(double)")
set(LIBC_ISINF_HANDLES_FLOAT "1" CACHE INTERNAL "Have include isinf(float)")
set(LIBC_HAS_ISINFF "1" CACHE INTERNAL "Have include isinff(float)")
set(LIBC_HAS_ISNAN "1" CACHE INTERNAL "Have include isnan(double)")
set(LIBC_ISNAN_HANDLES_FLOAT "1" CACHE INTERNAL "Have include isnan(float)")
set(LIBC_HAS_ISNANF "1" CACHE INTERNAL "Have include isnanf(float)")
set(LIBC_HAS_ITOA "1" CACHE INTERNAL "Have symbol itoa")
set(LIBC_HAS_LIMITS_H "1" CACHE INTERNAL "Have include limits.h")
set(LIBC_HAS_LOG "1" CACHE INTERNAL "Have symbol log")
set(LIBC_HAS_LOG10 "1" CACHE INTERNAL "Have symbol log10")
set(LIBC_HAS_LOG10F "1" CACHE INTERNAL "Have symbol log10f")
set(LIBC_HAS_LOGF "1" CACHE INTERNAL "Have symbol logf")
set(LIBC_HAS_LROUND "1" CACHE INTERNAL "Have symbol lround")
set(LIBC_HAS_LROUNDF "1" CACHE INTERNAL "Have symbol lroundf")
set(LIBC_HAS_MALLOC "1" CACHE INTERNAL "Have symbol malloc")
set(LIBC_HAS_MALLOC_H "1" CACHE INTERNAL "Have include malloc.h")
set(LIBC_HAS_MATH_H "1" CACHE INTERNAL "Have include math.h")
set(LIBC_HAS_MEMCMP "1" CACHE INTERNAL "Have symbol memcmp")
set(LIBC_HAS_MEMCPY "1" CACHE INTERNAL "Have symbol memcpy")
set(LIBC_HAS_MEMMOVE "1" CACHE INTERNAL "Have symbol memmove")
set(LIBC_HAS_MEMORY_H "1" CACHE INTERNAL "Have include memory.h")
set(LIBC_HAS_MEMSET "1" CACHE INTERNAL "Have symbol memset")
set(LIBC_HAS_MODF "1" CACHE INTERNAL "Have symbol modf")
set(LIBC_HAS_MODFF "1" CACHE INTERNAL "Have symbol modff")
set(LIBC_HAS_POW "1" CACHE INTERNAL "Have symbol pow")
set(LIBC_HAS_POWF "1" CACHE INTERNAL "Have symbol powf")
set(LIBC_HAS_PUTENV "1" CACHE INTERNAL "Have symbol putenv")
set(LIBC_HAS_REALLOC "" CACHE INTERNAL "Have symbol realloc")
set(LIBC_HAS_RINDEX "1" CACHE INTERNAL "Have symbol rindex")
set(LIBC_HAS_ROUND "1" CACHE INTERNAL "Have symbol round")
set(LIBC_HAS_ROUNDF "1" CACHE INTERNAL "Have symbol roundf")
set(LIBC_HAS_SCALBN "1" CACHE INTERNAL "Have symbol scalbn")
set(LIBC_HAS_SCALBNF "1" CACHE INTERNAL "Have symbol scalbnf")
set(LIBC_HAS_SETENV "1" CACHE INTERNAL "Have symbol setenv")
set(LIBC_HAS_SIGNAL_H "1" CACHE INTERNAL "Have include signal.h")
set(LIBC_HAS_SIN "1" CACHE INTERNAL "Have symbol sin")
set(LIBC_HAS_SINF "1" CACHE INTERNAL "Have symbol sinf")
set(LIBC_HAS_SQR "" CACHE INTERNAL "Have symbol sqr")
set(LIBC_HAS_SQRT "1" CACHE INTERNAL "Have symbol sqrt")
set(LIBC_HAS_SQRTF "1" CACHE INTERNAL "Have symbol sqrtf")
set(LIBC_HAS_SSCANF "1" CACHE INTERNAL "Have symbol sscanf")
set(LIBC_HAS_STDARG_H "1" CACHE INTERNAL "Have include stdarg.h")
set(LIBC_HAS_STDBOOL_H "1" CACHE INTERNAL "Have include stdbool.h")
set(LIBC_HAS_STDDEF_H "1" CACHE INTERNAL "Have include stddef.h")
set(LIBC_HAS_STDINT_H "1" CACHE INTERNAL "Have include stdint.h")
set(LIBC_HAS_STDIO_H "1" CACHE INTERNAL "Have include stdio.h")
set(LIBC_HAS_STDLIB_H "1" CACHE INTERNAL "Have include stdlib.h")
set(LIBC_HAS_STRCASESTR "" CACHE INTERNAL "Have symbol strcasestr")
set(LIBC_HAS_STRCHR "1" CACHE INTERNAL "Have symbol strchr")
set(LIBC_HAS_STRCMP "1" CACHE INTERNAL "Have symbol strcmp")
set(LIBC_HAS_STRINGS_H "1" CACHE INTERNAL "Have include strings.h")
set(LIBC_HAS_STRING_H "1" CACHE INTERNAL "Have include string.h")
set(LIBC_HAS_STRLCAT "1" CACHE INTERNAL "Have symbol strlcat")
set(LIBC_HAS_STRLCPY "1" CACHE INTERNAL "Have symbol strlcpy")
set(LIBC_HAS_STRLEN "1" CACHE INTERNAL "Have symbol strlen")
set(LIBC_HAS_STRNCMP "1" CACHE INTERNAL "Have symbol strncmp")
set(LIBC_HAS_STRNLEN "1" CACHE INTERNAL "Have symbol strnlen")
set(LIBC_HAS_STRNSTR "" CACHE INTERNAL "Have symbol strnstr")
set(LIBC_HAS_STRPBRK "1" CACHE INTERNAL "Have symbol strpbrk")
set(LIBC_HAS_STRRCHR "1" CACHE INTERNAL "Have symbol strrchr")
set(LIBC_HAS_STRSTR "1" CACHE INTERNAL "Have symbol strstr")
set(LIBC_HAS_STRTOD "1" CACHE INTERNAL "Have symbol strtod")
set(LIBC_HAS_STRTOK_R "1" CACHE INTERNAL "Have symbol strtok_r")
set(LIBC_HAS_STRTOL "1" CACHE INTERNAL "Have symbol strtol")
set(LIBC_HAS_STRTOLL "1" CACHE INTERNAL "Have symbol strtoll")
set(LIBC_HAS_STRTOUL "1" CACHE INTERNAL "Have symbol strtoul")
set(LIBC_HAS_STRTOULL "1" CACHE INTERNAL "Have symbol strtoull")
set(LIBC_HAS_SYS_TYPES_H "1" CACHE INTERNAL "Have include sys/types.h")
set(LIBC_HAS_TAN "1" CACHE INTERNAL "Have symbol tan")
set(LIBC_HAS_TANF "1" CACHE INTERNAL "Have symbol tanf")
set(LIBC_HAS_TIME_H "1" CACHE INTERNAL "Have include time.h")
set(LIBC_HAS_TRUNC "1" CACHE INTERNAL "Have symbol trunc")
set(LIBC_HAS_TRUNCF "1" CACHE INTERNAL "Have symbol truncf")
set(LIBC_HAS_UNSETENV "1" CACHE INTERNAL "Have symbol unsetenv")
set(LIBC_HAS_VSNPRINTF "1" CACHE INTERNAL "Have symbol vsnprintf")
set(LIBC_HAS_VSSCANF "1" CACHE INTERNAL "Have symbol vsscanf")
set(LIBC_HAS_WCHAR_H "1" CACHE INTERNAL "Have include wchar.h")
set(LIBC_HAS_WCSCMP "" CACHE INTERNAL "Have symbol wcscmp")
set(LIBC_HAS_WCSDUP "" CACHE INTERNAL "Have symbol wcsdup")
set(LIBC_HAS_WCSLCAT "" CACHE INTERNAL "Have symbol wcslcat")
set(LIBC_HAS_WCSLCPY "" CACHE INTERNAL "Have symbol wcslcpy")
set(LIBC_HAS_WCSLEN "" CACHE INTERNAL "Have symbol wcslen")
set(LIBC_HAS_WCSNCMP "" CACHE INTERNAL "Have symbol wcsncmp")
set(LIBC_HAS_WCSNLEN "" CACHE INTERNAL "Have symbol wcsnlen")
set(LIBC_HAS_WCSSTR "" CACHE INTERNAL "Have symbol wcsstr")
set(LIBC_HAS_WCSTOL "" CACHE INTERNAL "Have symbol wcstol")
set(LIBC_HAS__EXIT "1" CACHE INTERNAL "Have symbol _Exit")
set(LIBC_HAS__I64TOA "" CACHE INTERNAL "Have symbol _i64toa")
set(LIBC_HAS__LTOA "" CACHE INTERNAL "Have symbol _ltoa")
set(LIBC_HAS__STRREV "" CACHE INTERNAL "Have symbol _strrev")
set(LIBC_HAS__UITOA "" CACHE INTERNAL "Have symbol _uitoa")
set(LIBC_HAS__ULTOA "" CACHE INTERNAL "Have symbol _ultoa")
set(LIBC_HAS__WCSDUP "" CACHE INTERNAL "Have symbol _wcsdup")
set(LIBC_IS_GLIBC "" CACHE INTERNAL "Have symbol __GLIBC__")
set(HAVE_GCC_WALL "1" CACHE INTERNAL "Test HAVE_GCC_WALL")
set(HAVE_GCC_WUNDEF "1" CACHE INTERNAL "Test HAVE_GCC_WUNDEF")
set(HAVE_GCC_WFLOAT_CONVERSION "1" CACHE INTERNAL "Test HAVE_GCC_WFLOAT_CONVERSION")
set(HAVE_GCC_NO_STRICT_ALIASING "1" CACHE INTERNAL "Test HAVE_GCC_NO_STRICT_ALIASING")
set(HAVE_GCC_WDOCUMENTATION "" CACHE INTERNAL "Test HAVE_GCC_WDOCUMENTATION")
set(HAVE_GCC_WDOCUMENTATION_UNKNOWN_COMMAND "" CACHE INTERNAL "Test HAVE_GCC_WDOCUMENTATION_UNKNOWN_COMMAND")
set(HAVE_GCC_COMMENT_BLOCK_COMMANDS "" CACHE INTERNAL "Test HAVE_GCC_COMMENT_BLOCK_COMMANDS")
set(HAVE_GCC_WSHADOW "1" CACHE INTERNAL "Test HAVE_GCC_WSHADOW")
set(HAVE_GCC_WUNUSED_LOCAL_TYPEDEFS "1" CACHE INTERNAL "Test HAVE_GCC_WUNUSED_LOCAL_TYPEDEFS")
set(HAVE_GCC_WIMPLICIT_FALLTHROUGH "1" CACHE INTERNAL "Test HAVE_GCC_WIMPLICIT_FALLTHROUGH")
set(HAVE_GCC_FVISIBILITY "" CACHE INTERNAL "Test HAVE_GCC_FVISIBILITY")
set(HAVE_ST_MTIM "" CACHE INTERNAL "Test HAVE_ST_MTIM")
set(HAVE_LD_VERSION_SCRIPT "1" CACHE INTERNAL "Test HAVE_LD_VERSION_SCRIPT")
set(HAVE_WL_VERSION_SCRIPT "1" CACHE INTERNAL "Test HAVE_WL_VERSION_SCRIPT")
set(LINKER_SUPPORTS_VERSION_SCRIPT "1" CACHE INTERNAL "Test LINKER_SUPPORTS_VERSION_SCRIPT")
set(LINKER_SUPPORTS_WL_NO_UNDEFINED "1" CACHE INTERNAL "Test LINKER_SUPPORTS_WL_NO_UNDEFINED")
set(ICONV_IN_LIBC "" CACHE INTERNAL "Test ICONV_IN_LIBC")
set(ICONV_IN_LIBICONV "" CACHE INTERNAL "Test ICONV_IN_LIBICONV")
set(HAVE_GETPAGESIZE "1" CACHE INTERNAL "Have symbol getpagesize")
set(HAVE_SIGACTION "1" CACHE INTERNAL "Have symbol sigaction")
set(HAVE_SA_SIGACTION "" CACHE INTERNAL "Have symbol sa_sigaction")
set(HAVE_SETJMP "1" CACHE INTERNAL "Have symbol setjmp")
set(HAVE_NANOSLEEP "" CACHE INTERNAL "Have symbol nanosleep")
set(HAVE_GMTIME_R "1" CACHE INTERNAL "Have symbol gmtime_r")
set(HAVE_LOCALTIME_R "1" CACHE INTERNAL "Have symbol localtime_r")
set(HAVE_NL_LANGINFO "" CACHE INTERNAL "Have symbol nl_langinfo")
set(HAVE_SYSCONF "1" CACHE INTERNAL "Have symbol sysconf")
set(HAVE_SYSCTLBYNAME "" CACHE INTERNAL "Have symbol sysctlbyname")
set(HAVE_GETAUXVAL "" CACHE INTERNAL "Have symbol getauxval")
set(HAVE_ELF_AUX_INFO "" CACHE INTERNAL "Have symbol elf_aux_info")
set(HAVE_POLL "" CACHE INTERNAL "Have symbol poll")
set(HAVE_MEMFD_CREATE "" CACHE INTERNAL "Have symbol memfd_create")
set(HAVE_POSIX_FALLOCATE "" CACHE INTERNAL "Have symbol posix_fallocate")
set(HAVE_DLOPEN_IN_LIBC "" CACHE INTERNAL "Have symbol dlopen")
set(HAVE_GETHOSTNAME "1" CACHE INTERNAL "Have symbol gethostname")
set(HAVE_SIGTIMEDWAIT "" CACHE INTERNAL "Have symbol sigtimedwait")
set(HAVE_PPOLL "" CACHE INTERNAL "Have symbol ppoll")
set(HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR "" CACHE INTERNAL "Have symbol addchdir")
set(HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR_NP "" CACHE INTERNAL "Have symbol addchdir_np")
set(HAVE_FDATASYNC "" CACHE INTERNAL "Have symbol fdatasync")
set(HAVE_GETRESUID "" CACHE INTERNAL "Have symbol getresuid")
set(HAVE_GETRESGID "" CACHE INTERNAL "Have symbol getresgid")
endif()
endfunction()
endif()

View file

@ -181,5 +181,13 @@ if(EMSCRIPTEN)
set(HAVE_PPOLL "" CACHE INTERNAL "Have symbol ppoll")
set(HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR "" CACHE INTERNAL "Have symbol posix_spawn_file_actions_addchdir")
set(HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR_NP "1" CACHE INTERNAL "Have symbol posix_spawn_file_actions_addchdir_np")
set(LIBC_HAS_VFORK "1" CACHE INTERNAL "Have symbol vfork")
set(HAVE_GETRESUID "1" CACHE INTERNAL "Have symbol getresuid")
set(HAVE_GETRESGID "1" CACHE INTERNAL "Have symbol getresgid")
set(HAVE_LIBUDEV_H "" CACHE INTERNAL "Have include libudev.h")
set(HAVE_WFORMAT "" CACHE INTERNAL "Test COMPILER_SUPPORTS_WFORMAT")
set(HAVE_WFORMAT_OVERFLOW "" CACHE INTERNAL "Test COMPILER_SUPPORTS_WFORMAT_OVERFLOW")
set(HAVE_WFORMAT_EXTRA_ARGS "1" CACHE INTERNAL "Test COMPILER_SUPPORTS_WFORMAT_EXTRA_ARGS")
set(COMPILER_SUPPORTS_FCOLOR_DIAGNOSTICS "1" CACHE INTERNAL "Test COMPILER_SUPPORTS_FCOLOR_DIAGNOSTICS")
endfunction()
endif()

View file

@ -21,7 +21,7 @@ macro(option_string _NAME _DESC _VALUE)
add_to_alloptions(${_NAME})
set(${_NAME} ${_VALUE} CACHE STRING "${_DESC}")
set(HAVE_${_NAME} ${_VALUE})
ENDMACRO()
endmacro()
macro(message_bool_option _NAME _VALUE)
set(_PAD "\t")
@ -412,10 +412,10 @@ function(SDL_PrintSummary)
PrintEnabledBackends("X11 libraries" "^SDL_VIDEO_DRIVER_X11_([A-Z0-9]*)$")
endif()
PrintEnabledBackends("Render drivers" "^SDL_VIDEO_RENDER_([A-Z0-9_]*)$")
PrintEnabledBackends("GPU drivers" "^SDL_GPU_([A-Z0-9]*)$")
PrintEnabledBackends("Audio drivers" "^SDL_AUDIO_DRIVER_([A-Z0-9]*)$")
PrintEnabledBackends("Joystick drivers" "^SDL_JOYSTICK_([A-Z0-9]*)$")
PrintEnabledBackends("Camera drivers" "^SDL_CAMERA_DRIVER_([A-Z0-9]*)$")
PrintEnabledBackends("GPU drivers" "^SDL_GPU_([A-Z0-9_]*)$")
PrintEnabledBackends("Audio drivers" "^SDL_AUDIO_DRIVER_([A-Z0-9_]*)$")
PrintEnabledBackends("Joystick drivers" "^SDL_JOYSTICK_([A-Z0-9_]*)$")
PrintEnabledBackends("Camera drivers" "^SDL_CAMERA_DRIVER_([A-Z0-9_]*)$")
message(STATUS "")
if(UNIX)
@ -425,7 +425,7 @@ function(SDL_PrintSummary)
message(STATUS "")
endif()
if(UNIX AND NOT (ANDROID OR APPLE OR EMSCRIPTEN OR HAIKU OR RISCOS OR OHOS))
if(UNIX AND NOT (ANDROID OR APPLE OR EMSCRIPTEN OR HAIKU OR RISCOS OR OHOS OR DJGPP OR CYGWIN))
if(NOT (HAVE_X11 OR HAVE_WAYLAND))
if(NOT SDL_UNIX_CONSOLE_BUILD)
message(FATAL_ERROR

View file

@ -11,7 +11,7 @@ macro(SDL_DetectCompiler)
if(MSVC)
set(MSVC_CLANG TRUE)
endif()
elseif(CMAKE_COMPILER_IS_GNUCC)
elseif(CMAKE_C_COMPILER_ID STREQUAL "GNU")
set(USE_GCC TRUE)
elseif(CMAKE_C_COMPILER_ID MATCHES "^Intel$")
set(USE_INTELCC TRUE)

View file

@ -1,6 +1,6 @@
function(SDL_DetectTargetCPUArchitectures DETECTED_ARCHS)
set(known_archs EMSCRIPTEN ARM32 ARM64 ARM64EC LOONGARCH64 POWERPC32 POWERPC64 RISCV32 RISCV64 X86 X64)
set(known_archs EMSCRIPTEN ARM32 ARM64 ARM64EC LOONGARCH64 MIPS32 MIPS64 POWERPC32 POWERPC64 RISCV32 RISCV64 X86 X64)
if(APPLE AND CMAKE_OSX_ARCHITECTURES)
foreach(known_arch IN LISTS known_archs)
@ -37,6 +37,8 @@ function(SDL_DetectTargetCPUArchitectures DETECTED_ARCHS)
set(arch_check_ARM64EC "defined(_M_ARM64EC)")
set(arch_check_EMSCRIPTEN "defined(__EMSCRIPTEN__)")
set(arch_check_LOONGARCH64 "defined(__loongarch64)")
set(arch_check_MIPS32 "(defined(__mips__) && !defined(__mips64))")
set(arch_check_MIPS64 "(defined(__mips__) && defined(__mips64))")
set(arch_check_POWERPC32 "(defined(__PPC__) || defined(__powerpc__)) && !defined(__powerpc64__)")
set(arch_check_POWERPC64 "defined(__PPC64__) || defined(__powerpc64__)")
set(arch_check_RISCV32 "defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 32")

View file

@ -4,6 +4,10 @@ function(SDL_DetectCMakePlatform)
set(sdl_cmake_platform Windows)
elseif(PSP)
set(sdl_cmake_platform psp)
elseif(CYGWIN AND NOT MSYS)
set(sdl_cmake_platform Cygwin)
elseif(MSYS)
set(sdl_cmake_platform Msys)
elseif(APPLE)
if(CMAKE_SYSTEM_NAME MATCHES ".*(Darwin|MacOS).*")
set(sdl_cmake_platform macOS)
@ -22,6 +26,8 @@ function(SDL_DetectCMakePlatform)
set(sdl_cmake_platform Haiku)
elseif(NINTENDO_3DS)
set(sdl_cmake_platform n3ds)
elseif(CMAKE_SYSTEM_NAME STREQUAL "DOS")
set(sdl_cmake_platform dos)
elseif(NGAGESDK)
set(sdl_cmake_platform ngage)
elseif(PS2)

View file

@ -168,7 +168,7 @@ build-scripts/create-android-project.py --variant aar com.yourcompany.yourapp <
Customizing your application name
================================================================================
To customize your application name, edit AndroidManifest.xml and build.gradle to replace
To customize your application name, edit build.gradle to replace
"org.libsdl.app" with an identifier for your product package.
Then create a Java class extending SDLActivity and place it in a directory
@ -194,6 +194,8 @@ Here's an example of a minimal class file:
Then replace "SDLActivity" in AndroidManifest.xml with the name of your
class, .e.g. "MyGame"
Then edit app/src/main/res/values/strings.xml and change the name there.
Customizing your application icon
================================================================================
@ -210,6 +212,24 @@ Any files you put in the "app/src/main/assets" directory of your project
directory will get bundled into the application package and you can load
them using the standard functions in SDL_iostream.h.
As of SDL 3.6.0, SDL APIs, such as SDL_EnumerateDirectory() and
SDL_IOFromFile(), understand paths that are prefixed with "assets://" and will
look for paths exclusively inside the APK's "assets" directory. Since this is
where app-specific data files are meant to be located, SDL_GetBasePath() on
Android now returns "assets://" to make this work as expected across platforms.
Note that SDL 3.2.28 to 3.6.0 returned "./" on Android, and before that,
SDL_GetBasePath() always returned NULL on this platform.
Obviously, paths prefixed with "assets://" are only useful to SDL; other APIs,
like fopen(), will not understand them at all.
As an alternate approach: SDL APIs on Android treat relative paths in a
special way. It will look for files under the path returned by
SDL_GetAndroidInternalStoragePath() first, and failing that, will attempt to
look for them as if they were prefixed by "assets://", with the relative path
starting in the base of the assets tree. Absolute paths never check against
internal storage or assets.
There are also a few Android specific functions that allow you to get other
useful paths for saving and loading data:
* SDL_GetAndroidInternalStoragePath()
@ -252,7 +272,7 @@ e.g.
*/
return false;
case SDL_EVENT_LOW_MEMORY:
/* You will get this when your app is paused and iOS wants more memory.
/* You will get this when your app is paused and Android wants more memory.
Release as much memory as possible.
*/
return false;

View file

@ -95,6 +95,7 @@ Its behaviour can be influenced slightly by including SDL-specific tags in your
- `[sdl-ci-filter GLOB]` limits the platforms for which to run ci.
- `[sdl-ci-artifacts]` forces SDL artifacts, which can then be downloaded from the summary page.
- `[sdl-ci-trackmem-symbol-names]` makes sure the final report generated by `--trackmem` contains symbol names.
- `[sdl-ci-ctest-args]` allows overriding the ctest arguments. Adding `--repeat-until-fail N` and `-R NAME` is useful.
## Contributing to the documentation

90
docs/README-dos.md Normal file
View file

@ -0,0 +1,90 @@
# DOS
SDL port for MS-DOS using the [DJGPP](https://www.delorie.com/djgpp/) GCC cross-compiler.
## Building
To build for DOS, make sure you have a DJGPP cross-compiler in your PATH and run:
```bash
cmake -S. -Bbuild -DCMAKE_TOOLCHAIN_FILE=build-scripts/i586-pc-msdosdjgpp.cmake -DCMAKE_BUILD_TYPE=Release
cmake --build build
```
The toolchain file looks for `i586-pc-msdosdjgpp-gcc` or `i386-pc-msdosdjgpp-gcc` in PATH.
## Running
DOS executables require a DPMI host. Place `CWSDPMI.EXE` next to your executable.
To run in DOSBox:
```bash
dosbox myapp.exe
```
## System Requirements
| Component | Minimum |
| --------- | ------------------------------ |
| CPU | i386 or higher |
| RAM | 4 MB |
| Video | VGA (256-color mode 13h) |
| Audio | Sound Blaster |
| DPMI | CWSDPMI.exe or compatible host |
Higher resolutions (640×480 and above) require a VESA VBE 1.2+ compatible video card.
## Notes
### Memory Model
The DOS port produces 32-bit protected-mode DPMI executables. It uses the "fat DS" nearptr trick (`__djgpp_nearptr_enable()`) to convert physical addresses to usable C pointers. This allows direct access to the VESA linear framebuffer and DMA buffers from C code without segment descriptor manipulation.
SDL on DOS requires the fat DS trick. `SDL_RunApp()` enables it automatically via `SDL_main.h`. If you define `SDL_MAIN_HANDLED`, you must call `__djgpp_nearptr_enable()` yourself before initializing SDL, or video initialization will fail with a clear error message.
### Threading
DOS has no OS-level threads. SDL on DOS implements cooperative threading via a mini-scheduler that uses `setjmp`/`longjmp` for context switching. Threads are never preempted mid-instruction. Context switches occur only at explicit yield points such as `SDL_Delay` and the event pump, so make sure your main loop calls `SDL_PumpEvents` or `SDL_Delay` regularly. `SDL_Delay(0)` yields to other threads without sleeping and is safe to call in tight loops. In some cases, like a load screen, a longer delay (e.g. `SDL_Delay(16)`) may be needed to give background threads enough CPU time.
### Video
The video driver supports VGA mode 13h (320×200×256) on any VGA card, and higher resolutions via VESA BIOS Extensions (VBE 1.2+). Both linear framebuffer (VBE 2.0+) and banked framebuffer modes are supported. Hardware page-flipping is used for tear-free rendering when available.
Only software rendering is supported. There is no GPU renderer.
All video modes are effectively fullscreen. When creating a window, the driver selects the closest available video mode to the requested size.
8-bit indexed color (INDEX8) modes with programmable VGA DAC palettes are supported but will only be used when explicitly requested via the `SDL_PIXELFORMAT` window creation property.
EGA and CGA cards are not supported. The driver detects VGA hardware at initialization and will fail with a clear error message if VGA is not present.
#### Direct Framebuffer Hint
Setting `SDL_HINT_DOS_ALLOW_DIRECT_FRAMEBUFFER` to `"1"` before calling `SDL_GetWindowSurface()` enables a fast path that skips the normal surface copy. `SDL_UpdateWindowSurface()` copies the system-RAM surface directly to VRAM via `dosmemput` and only programs the VGA DAC palette when it changes. Page flipping is done without waiting for vblank. No software cursor compositing is performed.
This mode is designed for applications like Quake that manage their own rendering and want maximum frame throughput. The trade-offs are:
- No vsync. Tearing is expected.
- No software cursor. The application must draw its own cursor if needed.
- Reading back the surface may be slow on real hardware (uncached VRAM).
The hint must be set before the first call to `SDL_GetWindowSurface()`. Changing it after that has no effect.
### Audio
Sound Blaster support is available for SB16 (16-bit stereo), SB Pro (8-bit stereo), and SB 2.0/1.x (8-bit mono). Configured automatically from the `BLASTER` environment variable.
A ring buffer sits between the SDL audio pipeline and the DMA hardware. The audio thread fills the ring buffer cooperatively, and the Sound Blaster IRQ handler copies data from the ring buffer to the DMA buffer directly. This gives roughly 45 ms of cushion before audio would stutter. If your game runs at 22 fps or above, audio will be glitch-free with no extra effort. Below 20 fps, adding a `SDL_Delay(0)` in the middle of your game loop should be enough to keep the ring buffer fed.
Audio recording is not implemented.
### Input
- Keyboard: IRQ1-driven with full extended scancode (0xE0 prefix) support.
- Mouse: INT 33h mouse driver with relative motion via mickeys.
- Joystick: gameport joystick via BIOS INT 15h (axes) and direct port 0x201 reads (buttons) with software calibration.
### Limitations
- No shared library / dynamic loading support (no `SDL_LoadObject`). DXE support may be added in the future.

View file

@ -346,6 +346,64 @@ all has to live in memory at runtime.
[Emscripten's documentation on the matter](https://emscripten.org/docs/porting/files/packaging_files.html)
gives other options and details, and is worth a read.
Please also read the next section on persistent storage, for a little help
from SDL.
## Automount persistent storage
The file tree in Emscripten is provided by MEMFS by default, which stores all
files in RAM. This is often what you want, because it's fast and can be
accessed with the usual synchronous i/o functions like fopen or SDL_IOFromFile.
You can also write files to MEMFS, but when the browser tab goes away, so do
the files. But we want things like high scores, save games, etc, to still
exist if we reload the game later.
For this, Emscripten offers IDBFS, which backs files with the browser's
[IndexedDB](https://en.wikipedia.org/wiki/IndexedDB) functionality.
To use this, the app has to mount the IDBFS filesystem somewhere in the
virtual file tree, and then wait for it to sync up. This needs to be done in
Javascript code. The sync will not complete until at least one (but possibly
several) iterations of the mainloop have passed, which means you can not
access any saved files during main() or SDL_AppInit() by default.
SDL can solve this problem for you: it can be built to automatically mount the
persistent files from IDBFS to a specific place in the file tree and wait
until the sync has completed before calling main() or SDL_AppInit(), so to
your C code, it looks like the files were always available.
To use this functionality, set the CMake variable
`SDL_EMSCRIPTEN_PERSISTENT_PATH` to a path in the filetree where persistent
storage should be mounted:
```bash
mkdir build
cd build
emcmake cmake -DSDL_EMSCRIPTEN_PERSISTENT_PATH=/storage ..
```
You should also link your app with `-lidbfs.js`. If your project links to SDL
using CMake's find_package(SDL3), or uses `pkg-config sdl3 --libs`, this will
be handled for you when used with an SDL built with
`-DSDL_EMSCRIPTEN_PERSISTENT_PATH`.
Now `/storage` will be prepared when your program runs, and SDL_GetPrefPath()
will return a directory under that path. The storage is mounted with the
`autoPersist: true` option, so when you write to that tree, whether with
SDL APIs or other functions like fopen(), Emscripten will know it needs to
sync that data back to the persistent database, and will do so automatically
within the next few iterations of the mainloop.
It's best to assume the sync will take a few frames to complete, and the
data is not safe until it does.
To summarize how to automate this:
- Build with `emcmake cmake -DSDL_EMSCRIPTEN_PERSISTENT_PATH=/storage`
- Link your app with `-lidbfs.js` if not handled automatically.
- Write under `/storage`, or use SDL_GetPrefPath()
## Customizing index.html

View file

@ -103,6 +103,19 @@ matrix using the size in points (SDL_GetWindowSize()) can be used in order to
display content at the same scale no matter whether a Retina device is used or not.
Notes -- Getting full screen resolution
==============================================================================
Make sure that you have a Launch Screen key in your Info.plist, e.g.
```
<key>UILaunchScreen</key>
<dict/>
```
If you don't specify a launch screen, then the OS will assume that your
application needs an older compatibility mode and will get a limited
resolution screen.
Notes -- Application events
==============================================================================

View file

@ -20,7 +20,7 @@ Ubuntu 18.04, all available features enabled:
libaudio-dev libfribidi-dev libjack-dev libsndio-dev libx11-dev libxext-dev \
libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libxtst-dev \
libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \
libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev libthai-dev
libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev libthai-dev libusb-1.0-0-dev
Ubuntu 22.04+ can also add `libpipewire-0.3-dev libwayland-dev libdecor-0-dev liburing-dev` to that command line.

View file

@ -32,6 +32,10 @@ sudo cmake --install .
Please note that building SDL requires at least Xcode 12.2 and the macOS 11.0 SDK.
If you are getting errors building SDL_mfijoystick.m with Xcode 12.2, find your SDKs
directory and move MacOSX10.15.sdk out of the way so it isn't accidentally being used
by the build environment.
To use the library once it's built, you essential have two possibilities:
use the traditional autoconf/automake/make method, or use Xcode.
@ -246,6 +250,22 @@ You are free to modify your Cocoa app with generally no consequence
to SDL. You cannot, however, easily change the SDL window itself.
Functionality may be added in the future to help this.
## Raw Mouse Input
On macOS 14.0 (Sonoma) and later, SDL uses the Game Controller framework's
GCMouse API to provide raw, unaccelerated mouse input in relative mode. This
is ideal for games and applications requiring precise 1:1 mouse movement.
On older macOS versions, SDL falls back to NSEvent-based mouse input, which
includes system mouse acceleration.
To use accelerated (system-scaled) mouse movement on macOS 14.0+, set the hint:
```c
SDL_SetHint(SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE, "1");
```
# Bug reports
Bugs are tracked at [the GitHub issue tracker](https://github.com/libsdl-org/SDL/issues/).

View file

@ -1447,7 +1447,7 @@ The following functions have been removed:
* SDL_GetTextureUserData() - use SDL_GetTextureProperties() instead
* SDL_RenderGetIntegerScale()
* SDL_RenderSetIntegerScale() - this is now explicit with SDL_LOGICAL_PRESENTATION_INTEGER_SCALE
* SDL_RenderTargetSupported() - render targets are always supported
* SDL_RenderTargetSupported() - render targets are usually supported; just create a texture with SDL_TEXTUREACCESS_TARGET and see if it fails.
* SDL_SetTextureUserData() - use SDL_GetTextureProperties() instead
The following enums have been renamed:
@ -1461,7 +1461,7 @@ The following symbols have been removed:
* SDL_RENDERER_ACCELERATED - all renderers except `SDL_SOFTWARE_RENDERER` are accelerated
* SDL_RENDERER_PRESENTVSYNC - replaced with SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER during renderer creation and SDL_PROP_RENDERER_VSYNC_NUMBER after renderer creation
* SDL_RENDERER_SOFTWARE - you can check whether the name of the renderer is `SDL_SOFTWARE_RENDERER`
* SDL_RENDERER_TARGETTEXTURE - all renderers support target texture functionality
* SDL_RENDERER_TARGETTEXTURE - most renderers support target texture functionality; just create a texture with SDL_TEXTUREACCESS_TARGET and see if it fails.
* SDL_ScaleModeBest - use SDL_SCALEMODE_LINEAR instead
## SDL_rwops.h

View file

@ -33,14 +33,6 @@ software renderer has been removed.
The outcome is a significantly leaner and more efficient SDL port, which we hope
will breathe new life into this beloved yet obscure platform.
## To the Stubborn Legends of the DC Scene
This port is lovingly dedicated to the ever-nostalgic Dreamcast homebrew scene --
because if we managed to pull this off for the N-Gage (yes, the N-Gage), surely
you guys can stop clinging to SDL2 like it's a rare Shenmue prototype and finally
make the leap to SDL3. It's 2025, not 1999 -- and let's be honest, you're rocking
a state-of-the-art C23 compiler. The irony writes itself.
## Existing Issues and Limitations
- For now, the new
@ -62,3 +54,6 @@ a state-of-the-art C23 compiler. The irony writes itself.
expected to be resolved in a future update.
- Dependency tracking is currently non-functional.
- The compiler doesn't support aggregate initialization for structs, so
each field must be assigned explicitly.

View file

@ -5,6 +5,7 @@
SDL3 has been known to work on the following platforms at some point:
- [Android](README-android.md)
- [DOS](README-dos.md)
- [Emscripten](README-emscripten.md) (Web browsers)
- [FreeBSD](README-bsd.md)
- [Haiku OS](README-haiku.md)
@ -12,7 +13,7 @@ SDL3 has been known to work on the following platforms at some point:
- [Linux](README-linux.md)
- [macOS](README-macos.md) (10.14 and later)
- [NetBSD](README-bsd.md)
- [Nintendo Switch](README-switch.md) (Separate NDA-only fork)
- [Nintendo Switch and Switch 2](README-switch.md) (Separate NDA-only fork)
- [Nintendo 3DS](README-n3ds.md) (Homebrew)
- [Nokia N-Gage](README-ngage.md)
- [OpenBSD](README-bsd.md)

View file

@ -45,11 +45,17 @@ Remember to do a clean compilation every time you enable or disable the `SDL_PS2
## Getting PS2 Dev
[Installing PS2 Dev](https://github.com/ps2dev/ps2dev)
## Running on PCSX2 Emulator
## Running on Emulators
[PCSX2](https://github.com/PCSX2/pcsx2)
[More PCSX2 information](https://pcsx2.net/)
[Iris](https://github.com/allkern/iris)
[More Iris information](https://allkern.dev/iris)
[Play!](https://github.com/jpd002/Play-)
## To Do
- PS2 Screen Keyboard
- Dialogs

View file

@ -142,6 +142,7 @@ add_sdl_example_executable(renderer-cliprect SOURCES renderer/15-cliprect/clipre
add_sdl_example_executable(renderer-read-pixels SOURCES renderer/17-read-pixels/read-pixels.c DATAFILES ${CMAKE_CURRENT_SOURCE_DIR}/../test/sample.png)
add_sdl_example_executable(renderer-debug-text SOURCES renderer/18-debug-text/debug-text.c)
add_sdl_example_executable(renderer-affine-textures SOURCES renderer/19-affine-textures/affine-textures.c DATAFILES ${CMAKE_CURRENT_SOURCE_DIR}/../test/sample.png)
add_sdl_example_executable(renderer-blending SOURCES renderer/20-blending/blending.c)
add_sdl_example_executable(audio-simple-playback SOURCES audio/01-simple-playback/simple-playback.c)
add_sdl_example_executable(audio-simple-playback-callback SOURCES audio/02-simple-playback-callback/simple-playback-callback.c)
add_sdl_example_executable(audio-load-wav SOURCES audio/03-load-wav/load-wav.c DATAFILES ${CMAKE_CURRENT_SOURCE_DIR}/../test/sample.wav)

View file

@ -44,6 +44,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
return SDL_APP_FAILURE;
} else if (devcount == 0) {
SDL_Log("Couldn't find any camera devices! Please connect a camera and try again.");
SDL_free(devices);
return SDL_APP_FAILURE;
}

View file

@ -206,7 +206,7 @@ static void draw(SDL_Renderer *renderer, const float (*edges)[6], const Player p
for (i = 0; i < players_len; i++) {
const Player *player = &players[i];
float mod_x = (float)(i % part_hor);
float mod_y = (float)(i / part_hor);
float mod_y = (float)i / part_hor;
float hor_origin = (mod_x + 0.5f) * size_hor;
float ver_origin = (mod_y + 0.5f) * size_ver;
float cam_origin = (float)(0.5 * SDL_sqrt(size_hor * size_hor + size_ver * size_ver));

View file

@ -33,7 +33,6 @@ typedef struct {
SDL_Renderer* renderer;
SDL_Palette* palette;
SDL_Texture* texture;
SDL_Texture* rendertarget; /* we need this render target for text to look good */
SDL_AudioStream* audiostream;
char status[SCREEN_W / 8];
int status_ticks;
@ -75,6 +74,8 @@ static bool load(BytePusher* vm, SDL_IOStream* stream, bool closeio) {
size_t bytes_read = 0;
bool ok = true;
vm->display_help = true; // will set to false if load succeeds.
SDL_memset(vm->ram, 0, RAM_SIZE);
if (!stream) {
@ -199,13 +200,11 @@ SDL_AppResult SDL_AppInit(void** appstate, int argc, char* argv[]) {
}
vm->texture = SDL_CreateTexture(vm->renderer, SDL_PIXELFORMAT_INDEX8, SDL_TEXTUREACCESS_STREAMING, SCREEN_W, SCREEN_H);
vm->rendertarget = SDL_CreateTexture(vm->renderer, SDL_PIXELFORMAT_UNKNOWN, SDL_TEXTUREACCESS_TARGET, SCREEN_W, SCREEN_H);
if (!vm->texture || !vm->rendertarget) {
if (!vm->texture) {
return SDL_APP_FAILURE;
}
SDL_SetTexturePalette(vm->texture, vm->palette);
SDL_SetTextureScaleMode(vm->texture, SDL_SCALEMODE_NEAREST);
SDL_SetTextureScaleMode(vm->rendertarget, SDL_SCALEMODE_NEAREST);
if (!(vm->audiostream = SDL_OpenAudioDeviceStream(
SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, &audiospec, NULL, NULL
@ -274,26 +273,26 @@ SDL_AppResult SDL_AppIterate(void* appstate) {
if (updated) {
const void *pixels = &vm->ram[(Uint32)vm->ram[IO_SCREEN_PAGE] << 16];
SDL_UpdateTexture(vm->texture, NULL, pixels, SCREEN_W);
SDL_SetRenderTarget(vm->renderer, vm->rendertarget);
SDL_RenderTexture(vm->renderer, vm->texture, NULL, NULL);
if (vm->display_help) {
print(vm, 4, 4, "Drop a BytePusher file in this");
print(vm, 8, 12, "window to load and run it!");
print(vm, 4, 28, "Press ENTER to switch between");
print(vm, 8, 36, "positional and symbolic input.");
}
if (vm->status_ticks > 0) {
vm->status_ticks -= 1;
print(vm, 4, SCREEN_H - 12, vm->status);
}
}
SDL_SetRenderTarget(vm->renderer, NULL);
SDL_RenderClear(vm->renderer);
SDL_RenderTexture(vm->renderer, vm->rendertarget, NULL, NULL);
if (vm->display_help) {
print(vm, 4, 4, "Drop a BytePusher file in this");
print(vm, 8, 12, "window to load and run it!");
print(vm, 4, 28, "Press ENTER to switch between");
print(vm, 8, 36, "positional and symbolic input.");
} else {
SDL_RenderTexture(vm->renderer, vm->texture, NULL, NULL);
}
if (vm->status_ticks > 0) {
if (updated) {
vm->status_ticks--;
}
print(vm, 4, SCREEN_H - 12, vm->status);
}
SDL_RenderPresent(vm->renderer);
return SDL_APP_CONTINUE;
@ -387,7 +386,6 @@ void SDL_AppQuit(void* appstate, SDL_AppResult result) {
if (appstate) {
BytePusher* vm = (BytePusher*)appstate;
SDL_DestroyAudioStream(vm->audiostream);
SDL_DestroyTexture(vm->rendertarget);
SDL_DestroyTexture(vm->texture);
SDL_DestroyPalette(vm->palette);
SDL_DestroyRenderer(vm->renderer);

View file

@ -90,7 +90,7 @@ SDL_AppResult SDL_AppIterate(void *appstate)
/* ...and also fill a bunch of rectangles at once... */
for (i = 0; i < SDL_arraysize(rects); i++) {
const float w = (float) (WINDOW_WIDTH / SDL_arraysize(rects));
const float w = ((float) WINDOW_WIDTH / SDL_arraysize(rects));
const float h = i * 8.0f;
rects[i].x = i * w;
rects[i].y = WINDOW_HEIGHT - h;

View file

@ -66,7 +66,7 @@ SDL_AppResult SDL_AppIterate(void *appstate)
SDL_SetRenderScale(renderer, 1.0f, 1.0f);
SDL_RenderDebugText(renderer, 64, 350, "This only does ASCII chars. So this laughing emoji won't draw: 🤣");
SDL_RenderDebugTextFormat(renderer, (float) ((WINDOW_WIDTH - (charsize * 46)) / 2), 400, "(This program has been running for %" SDL_PRIu64 " seconds.)", SDL_GetTicks() / 1000);
SDL_RenderDebugTextFormat(renderer, ((float) (WINDOW_WIDTH - (charsize * 46)) / 2), 400, "(This program has been running for %" SDL_PRIu64 " seconds.)", SDL_GetTicks() / 1000);
SDL_RenderPresent(renderer); /* put it all on the screen! */

View file

@ -0,0 +1,5 @@
This example uses SDL_SetTextureBlendMode() to apply blending to textures,
and SDL_ComposeCustomBlendMode() to create a custom blend mode.
You can also use SDL_SetRenderDrawBlendMode() to apply blending to the
entire renderer, but it only affects filled rects and lines, not texture

View file

@ -0,0 +1,245 @@
/*
* Blending combines a source color 'src',
* with the pixels already on the screen 'dst',
* to produce transparency and other visual effects.
*
* formula: dst := (a * dst) op (b * src)
*
* where:
* dst: existed pixel on the screen.
* src: new pixel.
* a: dst factor.
* b: src factor.
* op: blend operation (usually addition).
*
* In graphics programming, color and alpha are usually blended separately:
* dstRGB := (a * srcRGB) op (b * dstRGB)
* dstA := (c * srcA) op (d * dstA)
*
* This example uses SDL_SetTextureBlendMode() to apply blending to textures,
* and uses SDL_ComposeCustomBlendMode() to create a custom blend mode.
*
* You can also use SDL_SetRenderDrawBlendMode() to apply blending to the
* entire renderer, but it only affects filled rects and lines, not textures.
*
* This code is public domain. Feel free to use it for any purpose!
*/
#define SDL_MAIN_USE_CALLBACKS 1
#include <SDL3/SDL.h>
#include <SDL3/SDL_main.h>
#define WINDOW_WIDTH 640
#define WINDOW_HEIGHT 480
/* UI Constants */
#define ROWS 2
#define COLS 3
#define GRID_SIZE ((WINDOW_WIDTH - 1) / 18.0f)
#define PANEL_SIZE (GRID_SIZE * 4)
#define ROW_OFFSET ((WINDOW_HEIGHT - ROWS * PANEL_SIZE) / 4)
#define COL_OFFSET (GRID_SIZE * COLS)
#define RECT_SIZE 50.0f
#define RED_OFFSET (GRID_SIZE)
#define GREEN_OFFSET (RECT_SIZE / 3 + GRID_SIZE)
#define BLUE_OFFSET (RECT_SIZE * 2 / 3 + GRID_SIZE)
static SDL_FRect panels[ROWS*COLS];
static SDL_Window *window = NULL;
static SDL_Renderer *renderer = NULL;
static SDL_Texture *red_rect_texture = NULL;
static SDL_Texture *green_rect_texture = NULL;
static SDL_Texture *blue_rect_texture = NULL;
static Uint8 alpha = 255;
static SDL_BlendMode blend_modes[] = {
/*The default no blending: dstRGB := srcRGB
dstA := srcA */
SDL_BLENDMODE_NONE,
/* Alpha blending: dstRGB := srcA * srcRGB + (1 - srcA) * dstRGB
dstA := srcA + (1 - srcA) * dstA */
SDL_BLENDMODE_BLEND,
/* Additive blending: dstRGB := srcRGB + dstRGB
dstA := srcA + dstA */
SDL_BLENDMODE_ADD,
/* Modulate blending: dstRGB := srcRGB * dstRGB
dstA := dstA */
SDL_BLENDMODE_MOD,
/* Multiply blending: dstRGB := srcRGB * dstRGB + (1 - srcA) * dstRGB
dstA := dstA */
SDL_BLENDMODE_MUL,
/* Our custom blending 'Screen Blending': dstRGB := 1 - (1 - dstRGB) * (1 - srcRGB)
dstA := dstA */
0
};
static const char *blend_mode_names[] = { "NONE", "BLEND", "ADD", "MOD", "MUL", "SCREEN \"CUSTOM\"" };
SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
{
SDL_Surface *surface = NULL;
SDL_SetAppMetadata("Example Blending", "1.0", "com.example.blending");
if (!SDL_Init(SDL_INIT_VIDEO)) {
SDL_Log("Couldn't initialize SDL: %s", SDL_GetError());
return SDL_APP_FAILURE;
}
if (!SDL_CreateWindowAndRenderer("examples/renderer/blending", WINDOW_WIDTH, WINDOW_HEIGHT, SDL_WINDOW_RESIZABLE, &window, &renderer)) {
SDL_Log("Couldn't create window/renderer: %s", SDL_GetError());
return SDL_APP_FAILURE;
}
SDL_SetRenderLogicalPresentation(renderer, WINDOW_WIDTH, WINDOW_HEIGHT, SDL_LOGICAL_PRESENTATION_LETTERBOX);
int row = 0;
int col = 0;
for (row = 0; row < ROWS; row++)
{
for (col = 0; col < COLS; col++)
{
panels[col + row*COLS] = (SDL_FRect){ col*PANEL_SIZE + col*COL_OFFSET, row*PANEL_SIZE + (row+1)*ROW_OFFSET, PANEL_SIZE, PANEL_SIZE };
}
}
/* Create 'screen blend' mode */
blend_modes[ROWS*COLS - 1] = SDL_ComposeCustomBlendMode(
SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR, /* srcRGB factor := (1 - dstRGB) */
SDL_BLENDFACTOR_ONE, /* dstRGB factor := 1 */
SDL_BLENDOPERATION_ADD, /* RGB operation := + */
SDL_BLENDFACTOR_ZERO, /* srcA factor := 0 */
SDL_BLENDFACTOR_ONE, /* dstA factor := dstA */
SDL_BLENDOPERATION_ADD /* A operation := + */
);
surface = SDL_CreateSurface((int)RECT_SIZE, (int)RECT_SIZE, SDL_PIXELFORMAT_RGBA8888);
if (!surface) {
SDL_Log("Couldn't create surface: %s", SDL_GetError());
return SDL_APP_FAILURE;
}
SDL_FillSurfaceRect(surface, NULL, 0xFF0000FF); /* Red */
red_rect_texture = SDL_CreateTextureFromSurface(renderer, surface);
if (!red_rect_texture) {
SDL_Log("Couldn't create texture: %s", SDL_GetError());
return SDL_APP_FAILURE;
}
SDL_FillSurfaceRect(surface, NULL, 0x00FF00FF); /* Green */
green_rect_texture = SDL_CreateTextureFromSurface(renderer, surface);
if (!green_rect_texture) {
SDL_Log("Couldn't create texture: %s", SDL_GetError());
return SDL_APP_FAILURE;
}
SDL_FillSurfaceRect(surface, NULL, 0x0000FFFF); /* Blue */
blue_rect_texture = SDL_CreateTextureFromSurface(renderer, surface);
if (!blue_rect_texture) {
SDL_Log("Couldn't create texture: %s", SDL_GetError());
return SDL_APP_FAILURE;
}
SDL_DestroySurface(surface);
return SDL_APP_CONTINUE;
}
SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event)
{
if (event->type == SDL_EVENT_QUIT) {
return SDL_APP_SUCCESS;
}
if (event->type == SDL_EVENT_KEY_DOWN) {
/* UP arrow increase alpha */
if (event->key.key == SDLK_UP && alpha <= 255-8) alpha += 8;
/* DOWN arrow decrease alpha */
if (event->key.key == SDLK_DOWN && alpha >= 8) alpha -= 8;
}
return SDL_APP_CONTINUE;
}
SDL_AppResult SDL_AppIterate(void *appstate)
{
SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE);
SDL_RenderClear(renderer);
int i = 0;
float x;
float y;
/* Render checkerboard panels */
for (i = 0; i < ROWS*COLS; i++)
{
/* Loop through the panel pixels */
for (y = panels[i].y; y < PANEL_SIZE + panels[i].y; y += GRID_SIZE)
{
for (x = panels[i].x; x < PANEL_SIZE + panels[i].x; x += GRID_SIZE)
{
SDL_FRect grid = { x, y, GRID_SIZE, GRID_SIZE };
bool dark = (int)(x/GRID_SIZE + y/GRID_SIZE) % 2;
if (dark) SDL_SetRenderDrawColor(renderer, 70, 70, 70, 255); /* Darker color */
else SDL_SetRenderDrawColor(renderer, 110, 110, 110, 255); /* Lighter color */
SDL_RenderFillRect(renderer, &grid);
}
}
/* Label the blend mode */
SDL_SetRenderDrawColor(renderer, 255, 255, 255, SDL_ALPHA_OPAQUE);
SDL_RenderDebugText(renderer, panels[i].x, panels[i].y - 15, blend_mode_names[i]);
}
/* Render panels */
SDL_RenderRects(renderer, panels, ROWS*COLS);
/* Render UI text */
SDL_RenderDebugText(renderer, (WINDOW_WIDTH - 176) / 2, WINDOW_HEIGHT - 30, "UP/DOWN: CHANGE ALPHA");
SDL_RenderDebugTextFormat(renderer, (WINDOW_WIDTH - 80) / 2, WINDOW_HEIGHT - 20, "ALPHA: %d", alpha);
/* Update textures alpha mod */
SDL_SetTextureAlphaMod(red_rect_texture, alpha);
SDL_SetTextureAlphaMod(green_rect_texture, alpha);
SDL_SetTextureAlphaMod(blue_rect_texture, alpha);
/* Render panels */
for (i = 0; i < ROWS*COLS; i++) {
/* Update rects destination */
SDL_FRect red_dst = { panels[i].x + RED_OFFSET, panels[i].y + RED_OFFSET, RECT_SIZE, RECT_SIZE };
SDL_FRect green_dst = { panels[i].x + GREEN_OFFSET, panels[i].y + GREEN_OFFSET, RECT_SIZE, RECT_SIZE };
SDL_FRect blue_dst = { panels[i].x + BLUE_OFFSET, panels[i].y + BLUE_OFFSET, RECT_SIZE, RECT_SIZE };
/* Apply the current blend mode */
const bool supported = SDL_SetTextureBlendMode(red_rect_texture, blend_modes[i]); /* just make sure the renderer supports this blend mode */
SDL_SetTextureBlendMode(green_rect_texture, blend_modes[i]);
SDL_SetTextureBlendMode(blue_rect_texture, blend_modes[i]);
/* Render textures */
SDL_RenderTexture(renderer, red_rect_texture, NULL, &red_dst);
SDL_RenderTexture(renderer, green_rect_texture, NULL, &green_dst);
SDL_RenderTexture(renderer, blue_rect_texture, NULL, &blue_dst);
/* Not all renderers support all blend modes. The renderer will try to pick something close in this case,
but it should be noted that the results might be unexpected, so we add "[UNSUPPORTED]" to this panel. */
if (!supported) {
const float textwidth = 104.0f;
const SDL_FRect dst = { panels[i].x + ((panels[i].w - textwidth) / 2.0f), panels[i].y + (panels[i].h - 8), textwidth, 8 };
SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE);
SDL_RenderFillRect(renderer, &dst);
SDL_SetRenderDrawColor(renderer, 255, 255, 255, SDL_ALPHA_OPAQUE);
SDL_RenderDebugText(renderer, dst.x, dst.y, "[UNSUPPORTED]");
}
}
SDL_RenderPresent(renderer);
return SDL_APP_CONTINUE;
}
void SDL_AppQuit(void *appstate, SDL_AppResult result)
{
SDL_DestroyTexture(red_rect_texture);
SDL_DestroyTexture(green_rect_texture);
SDL_DestroyTexture(blue_rect_texture);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

View file

@ -32,6 +32,11 @@ static bool SAVERENDERING_SDL_RenderPresent(SDL_Renderer *renderer)
if (!surface) {
SDL_LogError(SDL_LOG_CATEGORY_RENDER, "Failed to read pixels for frame #%u! (%s)", framenum, SDL_GetError());
} else {
SDL_Surface *cvt = SDL_ConvertSurface(surface, SDL_PIXELFORMAT_RGBX32);
if (cvt) {
SDL_DestroySurface(surface);
surface = cvt;
}
char fname[64];
SDL_snprintf(fname, sizeof (fname), "frame%05u.png", framenum);
if (!SDL_SavePNG(surface, fname)) {

View file

@ -265,7 +265,7 @@ disable assertions.
*/
#define SDL_NULL_WHILE_LOOP_CONDITION (0)
#elif defined(_MSC_VER) /* Avoid /W4 warnings. */
#elif defined(_MSC_VER) && !defined(__clang__) /* Avoid /W4 warnings. */
/* "while (0,0)" fools Microsoft's compiler's /W4 warning level into thinking
this condition isn't constant. And looks like an owl's face! */
#define SDL_NULL_WHILE_LOOP_CONDITION (0,0)

View file

@ -156,6 +156,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockSpinlock(SDL_SpinLock *lock);
*/
#define SDL_CompilerBarrier() DoCompilerSpecificReadWriteBarrier()
#elif SDL_HAS_BUILTIN(__atomic_signal_fence) || (defined(__GNUC__) && (__GNUC__ >= 5))
#define SDL_CompilerBarrier() __atomic_signal_fence(__ATOMIC_SEQ_CST)
#elif defined(_MSC_VER) && (_MSC_VER > 1200) && !defined(__clang__)
void _ReadWriteBarrier(void);
#pragma intrinsic(_ReadWriteBarrier)
@ -167,8 +169,9 @@ void _ReadWriteBarrier(void);
extern __inline void SDL_CompilerBarrier(void);
#pragma aux SDL_CompilerBarrier = "" parm [] modify exact [];
#else
/* We don't unlock here to avoid possible infinite recursion */
#define SDL_CompilerBarrier() \
{ SDL_SpinLock _tmp = 0; SDL_LockSpinlock(&_tmp); SDL_UnlockSpinlock(&_tmp); }
{ SDL_SpinLock _tmp = 0; SDL_LockSpinlock(&_tmp); }
#endif
/**
@ -275,12 +278,19 @@ extern SDL_DECLSPEC void SDLCALL SDL_MemoryBarrierAcquireFunction(void);
*/
#define SDL_MemoryBarrierAcquire() SDL_MemoryBarrierAcquireFunction()
#elif SDL_HAS_BUILTIN(__atomic_thread_fence) || (defined(__GNUC__) && (__GNUC__ >= 5))
#define SDL_MemoryBarrierRelease() __atomic_thread_fence(__ATOMIC_RELEASE)
#define SDL_MemoryBarrierAcquire() __atomic_thread_fence(__ATOMIC_ACQUIRE)
#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("lwsync" : : : "memory")
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("lwsync" : : : "memory")
#elif defined(__GNUC__) && defined(__aarch64__)
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory")
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory")
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ishld" : : : "memory")
#elif defined(_MSC_VER) && (defined(_M_ARM64) || defined(_M_ARM64EC))
#include <arm64intr.h>
#define SDL_MemoryBarrierRelease() __dmb(_ARM64_BARRIER_ISH)
#define SDL_MemoryBarrierAcquire() __dmb(_ARM64_BARRIER_ISHLD)
#elif defined(__GNUC__) && defined(__arm__)
#if 0 /* defined(SDL_PLATFORM_LINUX) || defined(SDL_PLATFORM_ANDROID) */
/* Information from:

View file

@ -281,6 +281,22 @@
*/
#define SDL_HAS_BUILTIN(x) __has_builtin(x)
/**
* Check if the compiler supports a given extension.
*
* This allows preprocessor checks for things that otherwise might fail to
* compile.
*
* Supported by virtually all clang versions and more-recent GCCs. Use this
* instead of checking the clang version if possible.
*
* On compilers without has_extension support, this is defined to 0 (always
* false).
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_HAS_EXTENSION(x) __has_extension(x)
/**
* A macro to specify data alignment.
*
@ -344,6 +360,14 @@
#endif
#endif
#ifndef SDL_HAS_EXTENSION
#ifdef __has_extension
#define SDL_HAS_EXTENSION(x) __has_extension(x)
#else
#define SDL_HAS_EXTENSION(x) 0
#endif
#endif
#ifndef SDL_DEPRECATED
# if defined(__GNUC__) && (__GNUC__ >= 4) /* technically, this arrived in gcc 3.1, but oh well. */
# define SDL_DEPRECATED __attribute__((deprecated))

View file

@ -48,8 +48,8 @@ extern __inline int _SDL_bsr_watcom(Uint32);
/**
* Get the index of the most significant (set) bit in a 32-bit number.
*
* Result is undefined when called with 0. This operation can also be stated
* as "count leading zeroes" and "log base 2".
* This operation can also be stated as "count leading zeroes" and "log base
* 2".
*
* Note that this is a forced-inline function in a header, and not a public
* API function available in the SDL library (which is to say, the code is

View file

@ -252,7 +252,7 @@ typedef void (SDLCALL *SDL_ClipboardCleanupCallback)(void *userdata);
* \sa SDL_GetClipboardData
* \sa SDL_HasClipboardData
*/
extern SDL_DECLSPEC bool SDLCALL SDL_SetClipboardData(SDL_ClipboardDataCallback callback, SDL_ClipboardCleanupCallback cleanup, void *userdata, const char **mime_types, size_t num_mime_types);
extern SDL_DECLSPEC bool SDLCALL SDL_SetClipboardData(SDL_ClipboardDataCallback callback, SDL_ClipboardCleanupCallback cleanup, void *userdata, const char *const *mime_types, size_t num_mime_types);
/**
* Clear the clipboard data.

View file

@ -281,6 +281,18 @@ extern SDL_DECLSPEC bool SDLCALL SDL_HasARMSIMD(void);
*/
extern SDL_DECLSPEC bool SDLCALL SDL_HasNEON(void);
/**
* Determine whether the CPU has SVE2 (Scalable Vector Extension 2).
*
* This is only relevant on ARM64 Linux. On other platforms it always returns
* false.
*
* \returns true if the CPU has SVE2, false otherwise.
*
* \since This function is available since SDL 3.6.0.
*/
extern SDL_DECLSPEC bool SDLCALL SDL_HasSVE2(void);
/**
* Determine whether the CPU has LSX (LOONGARCH SIMD) features.
*

View file

@ -164,6 +164,8 @@
#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
/* Win32 but not WinCE */
# define KHRONOS_APIENTRY __stdcall
#elif defined(__CYGWIN__) /* __CYGWIN__ added by SDL */
# define KHRONOS_APIENTRY __stdcall
#else
# define KHRONOS_APIENTRY
#endif
@ -419,7 +421,13 @@ typedef HDC EGLNativeDisplayType;
typedef HBITMAP EGLNativePixmapType;
typedef HWND EGLNativeWindowType;
#elif defined(SDL_PLATFORM_EMSCRIPTEN)
#elif defined(__QNX__)
typedef khronos_uintptr_t EGLNativeDisplayType;
typedef struct _screen_pixmap* EGLNativePixmapType; /* screen_pixmap_t */
typedef struct _screen_window* EGLNativeWindowType; /* screen_window_t */
#elif defined(__EMSCRIPTEN__)
typedef int EGLNativeDisplayType;
typedef int EGLNativePixmapType;
@ -540,7 +548,7 @@ extern "C" {
** used to make the header, and the header can be found at
** http://www.khronos.org/registry/egl
**
** Khronos $Git commit SHA1: 6fb1daea15 $ on $Git commit date: 2022-05-25 09:41:13 -0600 $
** Khronos $Git commit SHA1: e80a2e0050 $ on $Git commit date: 2026-03-19 06:21:49 +0100 $
*/
/*#include <EGL/eglplatform.h>*/
@ -549,7 +557,7 @@ extern "C" {
#define EGL_EGL_PROTOTYPES 1
#endif
/* Generated on date 20220525 */
/* Generated on date 20260319 */
/* Generated C header for:
* API: egl
@ -884,12 +892,12 @@ extern "C" {
** used to make the header, and the header can be found at
** http://www.khronos.org/registry/egl
**
** Khronos $Git commit SHA1: 6fb1daea15 $ on $Git commit date: 2022-05-25 09:41:13 -0600 $
** Khronos $Git commit SHA1: e80a2e0050 $ on $Git commit date: 2026-03-19 06:21:49 +0100 $
*/
/*#include <EGL/eglplatform.h>*/
#define EGL_EGLEXT_VERSION 20220525
#define EGL_EGLEXT_VERSION 20260319
/* Generated C header for:
* API: egl
@ -1421,6 +1429,11 @@ EGLAPI EGLBoolean EGLAPIENTRY eglPresentationTimeANDROID (EGLDisplay dpy, EGLSur
#define EGL_RECORDABLE_ANDROID 0x3142
#endif /* EGL_ANDROID_recordable */
#ifndef EGL_ANDROID_telemetry_hint
#define EGL_ANDROID_telemetry_hint 1
#define EGL_TELEMETRY_HINT_ANDROID 0x3570
#endif /* EGL_ANDROID_telemetry_hint */
#ifndef EGL_ANGLE_d3d_share_handle_client_buffer
#define EGL_ANGLE_d3d_share_handle_client_buffer 1
#define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200
@ -1593,10 +1606,33 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQueryDeviceBinaryEXT (EGLDeviceEXT device, EGLi
#define EGL_RENDERER_EXT 0x335F
#endif /* EGL_EXT_device_query_name */
#ifndef EGL_EXT_device_type
#define EGL_EXT_device_type 1
#define EGL_DEVICE_TYPE_EXT 0x3590
#define EGL_DEVICE_TYPE_OTHER_EXT 0x3591
#define EGL_DEVICE_TYPE_INTEGRATED_GPU_EXT 0x3592
#define EGL_DEVICE_TYPE_DISCRETE_GPU_EXT 0x3593
#define EGL_DEVICE_TYPE_CPU_EXT 0x3594
#endif /* EGL_EXT_device_type */
#ifndef EGL_EXT_display_alloc
#define EGL_EXT_display_alloc 1
#define EGL_ALLOC_NEW_DISPLAY_EXT 0x3379
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYDISPLAYEXTPROC) (EGLDisplay dpy);
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglDestroyDisplayEXT (EGLDisplay dpy);
#endif
#endif /* EGL_EXT_display_alloc */
#ifndef EGL_EXT_explicit_device
#define EGL_EXT_explicit_device 1
#endif /* EGL_EXT_explicit_device */
#ifndef EGL_EXT_gl_colorspace_bt2020_hlg
#define EGL_EXT_gl_colorspace_bt2020_hlg 1
#define EGL_GL_COLORSPACE_BT2020_HLG_EXT 0x3540
#endif /* EGL_EXT_gl_colorspace_bt2020_hlg */
#ifndef EGL_EXT_gl_colorspace_bt2020_linear
#define EGL_EXT_gl_colorspace_bt2020_linear 1
#define EGL_GL_COLORSPACE_BT2020_LINEAR_EXT 0x333F
@ -1793,6 +1829,10 @@ EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurfaceEXT (EGLDisplay dpy,
#define EGL_EXT_protected_surface 1
#endif /* EGL_EXT_protected_surface */
#ifndef EGL_EXT_query_reset_notification_strategy
#define EGL_EXT_query_reset_notification_strategy 1
#endif /* EGL_EXT_query_reset_notification_strategy */
#ifndef EGL_EXT_stream_consumer_egloutput
#define EGL_EXT_stream_consumer_egloutput 1
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMEROUTPUTEXTPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLOutputLayerEXT layer);
@ -2093,6 +2133,11 @@ EGLAPI EGLBoolean EGLAPIENTRY eglStreamReleaseImageNV (EGLDisplay dpy, EGLStream
#endif
#endif /* EGL_NV_stream_consumer_eglimage */
#ifndef EGL_NV_stream_consumer_eglimage_use_scanout_attrib
#define EGL_NV_stream_consumer_eglimage_use_scanout_attrib 1
#define EGL_STREAM_CONSUMER_IMAGE_USE_SCANOUT_NV 0x3378
#endif /* EGL_NV_stream_consumer_eglimage_use_scanout_attrib */
#ifndef EGL_NV_stream_consumer_gltexture_yuv
#define EGL_NV_stream_consumer_gltexture_yuv 1
#define EGL_YUV_PLANE0_TEXTURE_UNIT_NV 0x332C
@ -2302,6 +2347,16 @@ EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV (void);
#define EGL_TRIPLE_BUFFER_NV 0x3230
#endif /* EGL_NV_triple_buffer */
#ifndef EGL_QNX_image_native_buffer
#define EGL_QNX_image_native_buffer 1
#define EGL_NATIVE_BUFFER_QNX 0x3551
#endif /* EGL_QNX_image_native_buffer */
#ifndef EGL_QNX_platform_screen
#define EGL_QNX_platform_screen 1
#define EGL_PLATFORM_SCREEN_QNX 0x3550
#endif /* EGL_QNX_platform_screen */
#ifndef EGL_TIZEN_image_native_buffer
#define EGL_TIZEN_image_native_buffer 1
#define EGL_NATIVE_BUFFER_TIZEN 0x32A0

View file

@ -163,8 +163,9 @@ typedef enum SDL_EventType
associated with the window. Otherwise, the handle has already been destroyed and all resources
associated with it are invalid */
SDL_EVENT_WINDOW_HDR_STATE_CHANGED, /**< Window HDR properties have changed */
SDL_EVENT_WINDOW_SETTINGS_CHANGED, /**< Window settings have changed (on visionOS) */
SDL_EVENT_WINDOW_FIRST = SDL_EVENT_WINDOW_SHOWN,
SDL_EVENT_WINDOW_LAST = SDL_EVENT_WINDOW_HDR_STATE_CHANGED,
SDL_EVENT_WINDOW_LAST = SDL_EVENT_WINDOW_SETTINGS_CHANGED,
/* Keyboard events */
SDL_EVENT_KEY_DOWN = 0x300, /**< Key pressed */
@ -211,6 +212,8 @@ typedef enum SDL_EventType
SDL_EVENT_GAMEPAD_SENSOR_UPDATE, /**< Gamepad sensor was updated */
SDL_EVENT_GAMEPAD_UPDATE_COMPLETE, /**< Gamepad update is complete */
SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED, /**< Gamepad Steam handle has changed */
SDL_EVENT_GAMEPAD_CAPSENSE_TOUCH, /**< Gamepad capsense was touched */
SDL_EVENT_GAMEPAD_CAPSENSE_RELEASE, /**< Gamepad capsense was released */
/* Touch events */
SDL_EVENT_FINGER_DOWN = 0x700,
@ -456,7 +459,7 @@ typedef struct SDL_MouseMotionEvent
Uint32 reserved;
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
SDL_WindowID windowID; /**< The window with mouse focus, if any */
SDL_MouseID which; /**< The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 */
SDL_MouseID which; /**< The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, SDL_PEN_MOUSEID for pen events, or 0 */
SDL_MouseButtonFlags state; /**< The current button state */
float x; /**< X coordinate, relative to window */
float y; /**< Y coordinate, relative to window */
@ -710,6 +713,23 @@ typedef struct SDL_GamepadSensorEvent
Uint64 sensor_timestamp; /**< The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock */
} SDL_GamepadSensorEvent;
/**
* Gamepad capsense event structure (event.gcapsense.*)
*
* \since This struct is available since SDL 3.6.0.
*/
typedef struct SDL_GamepadCapSenseEvent
{
SDL_EventType type; /**< SDL_EVENT_GAMEPAD_CAPSENSE_TOUCH or SDL_EVENT_GAMEPAD_CAPSENSE_RELEASE */
Uint32 reserved;
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
SDL_JoystickID which; /**< The joystick instance id */
Uint8 capsense; /**< The capsense type (SDL_GamepadCapSenseType) */
bool down; /**< true if the capsense is touched */
Uint8 padding1;
Uint8 padding2;
} SDL_GamepadCapSenseEvent;
/**
* Audio device event structure (event.adevice.*)
*
@ -1039,6 +1059,7 @@ typedef union SDL_Event
SDL_GamepadButtonEvent gbutton; /**< Gamepad button event data */
SDL_GamepadTouchpadEvent gtouchpad; /**< Gamepad touchpad event data */
SDL_GamepadSensorEvent gsensor; /**< Gamepad sensor event data */
SDL_GamepadCapSenseEvent gcapsense; /**< Gamepad capsense event data */
SDL_AudioDeviceEvent adevice; /**< Audio device event data */
SDL_CameraDeviceEvent cdevice; /**< Camera device event data */
SDL_SensorEvent sensor; /**< Sensor event data */
@ -1343,7 +1364,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_WaitEvent(SDL_Event *event);
* \param event the SDL_Event structure to be filled in with the next event
* from the queue, or NULL.
* \param timeoutMS the maximum number of milliseconds to wait for the next
* available event.
* available event, or -1 to wait indefinitely.
* \returns true if this got an event or false if the timeout elapsed without
* any events available.
*

View file

@ -122,6 +122,7 @@ typedef enum SDL_GamepadType
SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT,
SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR,
SDL_GAMEPAD_TYPE_GAMECUBE,
SDL_GAMEPAD_TYPE_STEAM,
SDL_GAMEPAD_TYPE_COUNT
} SDL_GamepadType;
@ -167,11 +168,11 @@ typedef enum SDL_GamepadButton
SDL_GAMEPAD_BUTTON_DPAD_DOWN,
SDL_GAMEPAD_BUTTON_DPAD_LEFT,
SDL_GAMEPAD_BUTTON_DPAD_RIGHT,
SDL_GAMEPAD_BUTTON_MISC1, /**< Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button, Google Stadia capture button) */
SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1, /**< Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button) */
SDL_GAMEPAD_BUTTON_LEFT_PADDLE1, /**< Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button) */
SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2, /**< Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button) */
SDL_GAMEPAD_BUTTON_LEFT_PADDLE2, /**< Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button) */
SDL_GAMEPAD_BUTTON_MISC1, /**< Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Steam Controller QAM button, Amazon Luna microphone button, Google Stadia capture button) */
SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1, /**< Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button, Steam Controller R4 button) */
SDL_GAMEPAD_BUTTON_LEFT_PADDLE1, /**< Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button, Steam Controller L4 button) */
SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2, /**< Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button, Steam Controller R5 button) */
SDL_GAMEPAD_BUTTON_LEFT_PADDLE2, /**< Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button, Steam Controller L5 button) */
SDL_GAMEPAD_BUTTON_TOUCHPAD, /**< PS4/PS5 touchpad button */
SDL_GAMEPAD_BUTTON_MISC2, /**< Additional button */
SDL_GAMEPAD_BUTTON_MISC3, /**< Additional button (e.g. Nintendo GameCube left trigger click) */
@ -231,6 +232,24 @@ typedef enum SDL_GamepadAxis
SDL_GAMEPAD_AXIS_COUNT
} SDL_GamepadAxis;
/**
* The list of capsense types on a gamepad
*
* \since This enum is available since SDL 3.6.0.
*
* \sa SDL_GamepadHasCapSense
* \sa SDL_GetGamepadCapSense
*/
typedef enum SDL_GamepadCapSenseType
{
SDL_GAMEPAD_CAPSENSE_INVALID = -1,
SDL_GAMEPAD_CAPSENSE_LEFT_STICK, /**< Activated by touching the top of the left thumbstick */
SDL_GAMEPAD_CAPSENSE_RIGHT_STICK, /**< Activated by touching the top of the right thumbstick */
SDL_GAMEPAD_CAPSENSE_LEFT_GRIP, /**< Activated by gripping the left handle of the controller */
SDL_GAMEPAD_CAPSENSE_RIGHT_GRIP, /**< Activated by gripping the right handle of the controller */
SDL_GAMEPAD_CAPSENSE_COUNT
} SDL_GamepadCapSenseType;
/**
* Types of gamepad control bindings.
*
@ -1510,6 +1529,36 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetGamepadSensorDataRate(SDL_Gamepad *game
*/
extern SDL_DECLSPEC bool SDLCALL SDL_GetGamepadSensorData(SDL_Gamepad *gamepad, SDL_SensorType type, float *data, int num_values);
/**
* Return whether a gamepad has a particular capsense.
*
* \param gamepad the gamepad to query.
* \param type the type of capsense to query.
* \returns true if the capsense exists, false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.6.0.
*
* \sa SDL_GetGamepadCapSense
*/
extern SDL_DECLSPEC bool SDLCALL SDL_GamepadHasCapSense(SDL_Gamepad *gamepad, SDL_GamepadCapSenseType type);
/**
* Get the current state of a capsense on a gamepad.
*
* \param gamepad a gamepad.
* \param type the type of capsense to query.
* \returns true if the capsense is touched, false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.6.0.
*
* \sa SDL_GamepadHasCapSense
*/
extern SDL_DECLSPEC bool SDLCALL SDL_GetGamepadCapSense(SDL_Gamepad *gamepad, SDL_GamepadCapSenseType type);
/**
* Start a rumble effect on a gamepad.
*

View file

@ -1873,6 +1873,7 @@ typedef struct SDL_GPUMultisampleState
* \since This struct is available since SDL 3.2.0.
*
* \sa SDL_GPUGraphicsPipelineCreateInfo
* \sa SDL_GPUStencilOpState
*/
typedef struct SDL_GPUDepthStencilState
{

View file

@ -140,6 +140,27 @@ extern "C" {
*/
#define SDL_HINT_ANDROID_TRAP_BACK_BUTTON "SDL_ANDROID_TRAP_BACK_BUTTON"
/**
* A variable to control whether we allow persistent folder access on Android
* when using the SDL select folder dialog.
*
* If set to `1`, the selected folder will be accessible persistently across
* app launches. That allows the user to only have to select the directory
* once, and then the app can access it again in the future without needing to
* ask the user to select it again.
*
* The variable can be set to the following values:
*
* - "0": Persistent folder access is not allowed. (default)
* - "1": Persistent folder access is allowed.
*
* This hint should be set before the SDL folder selection dialog is shown,
* and can be changed between dialog invocations.
*
* \since This hint is available since SDL 3.6.0.
*/
#define SDL_HINT_ANDROID_ALLOW_PERSISTENT_FOLDER_ACCESS "SDL_ANDROID_ALLOW_PERSISTENT_FOLDER_ACCESS"
/**
* A variable setting the app ID string.
*
@ -273,9 +294,9 @@ extern "C" {
*
* The variable can be set to the following values:
*
* - "playback": Use the AVAudioSessionCategoryPlayback category. (default)
* - "ambient": Use the AVAudioSessionCategoryAmbient audio category, will be
* muted by the phone mute switch (default)
* - "playback": Use the AVAudioSessionCategoryPlayback category.
* muted by the phone mute switch.
*
* For more information, see Apple's documentation:
* https://developer.apple.com/library/content/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/AudioSessionCategoriesandModes/AudioSessionCategoriesandModes.html
@ -402,6 +423,11 @@ extern "C" {
* - "Movie" - Music or sound with dialog
* - "Media" - Music or sound without dialog
*
* Android's AAudio target supports this hint as of SDL 3.4.4. Android does
* not support the exact same options as WASAPI, but for portability, will
* attempt to map these same strings to the `aaudio_usage_t` constants. For
* example, "Movie" and "Media" will both map to `AAUDIO_USAGE_MEDIA`, etc.
*
* If your application applies its own echo cancellation, gain control, and
* noise reduction it should also set SDL_HINT_AUDIO_DEVICE_RAW_STREAM.
*
@ -480,6 +506,23 @@ extern "C" {
*/
#define SDL_HINT_AUDIO_DRIVER "SDL_AUDIO_DRIVER"
/**
* Specify whether this audio stream should duck other audio.
*
* On Apple platforms, this hint controls whether other audio streams are
* ducked (reduced in volume) while your application is in the foreground.
*
* The variable can be set to the following values:
*
* - "0": Other audio will not be ducked. (default)
* - "1": Other audio will be ducked.
*
* This hint should be set before an audio device is opened.
*
* \since This hint is available since SDL 3.6.0.
*/
#define SDL_HINT_AUDIO_DUCK_OTHERS "SDL_AUDIO_DUCK_OTHERS"
/**
* A variable controlling the audio rate when using the dummy audio driver.
*
@ -649,6 +692,7 @@ extern "C" {
* - "avx512f"
* - "arm-simd"
* - "neon"
* - "sve2"
* - "lsx"
* - "lasx"
*
@ -719,6 +763,23 @@ extern "C" {
*/
#define SDL_HINT_DISPLAY_USABLE_BOUNDS "SDL_DISPLAY_USABLE_BOUNDS"
/**
* A variable that enables a fast framebuffer path on DOS.
*
* When set to "1", SDL_UpdateWindowSurface() copies the system-RAM surface
* directly to VRAM and skips software cursor compositing and vsync.
*
* The variable can be set to the following values:
*
* - "0": Use the normal path with cursor compositing and vsync. (default)
* - "1": Use the fast direct-to-VRAM path when available.
*
* This hint must be set before the first call to SDL_GetWindowSurface().
*
* \since This hint is available since SDL 3.6.0.
*/
#define SDL_HINT_DOS_ALLOW_DIRECT_FRAMEBUFFER "SDL_DOS_ALLOW_DIRECT_FRAMEBUFFER"
/**
* Set the level of checking for invalid parameters passed to SDL functions.
*
@ -1439,6 +1500,26 @@ extern "C" {
*/
#define SDL_HINT_JOYSTICK_GAMEINPUT "SDL_JOYSTICK_GAMEINPUT"
/**
* A variable controlling whether GameInput should be used for handling GIP
* devices that require raw report processing, but aren't supported by HIDRAW,
* such as Xbox One Guitars.
*
* Note that this is only supported with GameInput 3 or newer.
*
* The variable can be set to the following values:
*
* - "0": GameInput is not used to handle raw GIP devices.
* - "1": GameInput is used.
*
* The default is "1" when using GameInput 3 or newer, and is "0" otherwise.
*
* This hint should be set before SDL is initialized.
*
* \since This hint is available since SDL 3.4.4.
*/
#define SDL_HINT_JOYSTICK_GAMEINPUT_RAW "SDL_JOYSTICK_GAMEINPUT_RAW"
/**
* A variable containing a list of devices known to have a GameCube form
* factor.
@ -2813,7 +2894,7 @@ extern "C" {
* (default)
* - "1": Cursors will automatically match the display content scale (e.g. a
* 2x sized cursor will be used when the window is on a monitor with 200%
* scale). This is currently implemented on Windows and Wayland.
* scale). This is currently implemented on Windows.
*
* This hint needs to be set before creating cursors.
*
@ -3995,9 +4076,8 @@ extern "C" {
* The variable can be set to the following values:
*
* - "aspect" - Video modes will be displayed scaled, in their proper aspect
* ratio, with black bars.
* ratio, with black bars. (default)
* - "stretch" - Video modes will be scaled to fill the entire display.
* (default)
* - "none" - Video modes will be displayed as 1:1 with no scaling.
*
* This hint should be set before creating a window.
@ -4087,6 +4167,33 @@ extern "C" {
*/
#define SDL_HINT_VIDEO_WIN_D3DCOMPILER "SDL_VIDEO_WIN_D3DCOMPILER"
/**
* A variable controlling whether the X Synchronization Extension is enabled.
*
* If set, this can result in smoother window resizing when rendering using
* OpenGL, however, there are some conditions:
*
* - It is only activated on windows created with the `SDL_WINDOW_OPENGL` flag
* (windows using an SDL OpenGL renderer have this automatically set).
* - When activated, presentation must be done with `SDL_GL_SwapWindow()`
* (`SDL_RenderPresent()` calls this internally for OpenGL renderers as
* well).
*
* Enabling this and presenting via an external mechanism will result in sync
* requests not being acked, and hangs and other odd window behavior may
* result.
*
* The variable can be set to the following values:
*
* - "0": The X Synchronization Extension is disabled. (default)
* - "1": The X Synchronization Extension is enabled.
*
* This hint should be set before creating a window.
*
* \since This hint is available since SDL 3.4.10.
*/
#define SDL_HINT_VIDEO_X11_ENABLE_XSYNC_EXT "SDL_VIDEO_X11_ENABLE_XSYNC_EXT"
/**
* A variable controlling whether SDL should call XSelectInput() to enable
* input events on X11 windows wrapped by SDL windows.

View file

@ -85,6 +85,16 @@
*/
#define SDL_NEON_INTRINSICS 1
/**
* Defined if (and only if) the compiler supports ARM SVE2 intrinsics.
*
* If this macro is defined, SDL will have already included `<arm_sve.h>` as
* appropriate.
*
* \since This macro is available since SDL 3.6.0.
*/
#define SDL_SVE2_INTRINSICS 1
/**
* Defined if (and only if) the compiler supports PowerPC Altivec intrinsics.
*
@ -237,6 +247,10 @@ _m_prefetch(void *__P)
# define SDL_NEON_INTRINSICS 1
# include <arm_neon.h>
#endif
#if defined(__ARM_FEATURE_SVE2) && !defined(SDL_DISABLE_SVE2)
# define SDL_SVE2_INTRINSICS 1
# include <arm_sve.h>
#endif
#else
/* altivec.h redefining bool causes a number of problems, see bugs 3993 and 4392, so you need to explicitly define SDL_ENABLE_ALTIVEC to have it included. */
@ -265,6 +279,23 @@ _m_prefetch(void *__P)
# endif
# endif
#endif
#ifndef SDL_DISABLE_SVE2
# if defined(SDL_PLATFORM_WINDOWS)
/* Visual Studio doesn't define __ARM_ARCH, but _M_ARM (if set, always 7), and _M_ARM64 (if set, always 1). */
# if defined (_M_ARM64) && 0 /* Please only remove this 0 when MSVC releasing support for SVE2 officially. */
# define SDL_SVE2_INTRINSICS 1
# include <arm_sve.h>
# define __ARM_FEATURE_SVE2 1 /* Set __ARM_FEATURE_SVE2 so that it can be used elsewhere, at compile time */
# define __ARM_ARCH 8
# endif
# elif defined(SDL_PLATFORM_APPLE)
/* Apple has no AArch64 device supporting SVE2 */
# elif defined(__ARM_ARCH) && (__ARM_ARCH >= 8) && (defined(__aarch64__) || defined(_M_ARM64)) && \
defined(__has_include) && __has_include(<arm_sve.h>) && defined(__ARM_FEATURE_SVE)
# define SDL_SVE2_INTRINSICS 1
# include <arm_sve.h>
# endif
#endif
#endif /* compiler version */
#ifdef SDL_WIKI_DOCUMENTATION_SECTION

View file

@ -449,6 +449,14 @@ typedef enum SDL_Capitalization
* are allowed. This defaults to true if SDL_HINT_RETURN_KEY_HIDES_IME is
* "0" or is not set, and defaults to false if SDL_HINT_RETURN_KEY_HIDES_IME
* is "1".
* - `SDL_PROP_TEXTINPUT_TITLE_STRING` - a title for the top of the on-screen
* keyboard window, if it has one.
* - `SDL_PROP_TEXTINPUT_PLACEHOLDER_STRING` - the placeholder shown before
* the user starts typing, when the field is empty.
* - `SDL_PROP_TEXTINPUT_DEFAULT_TEXT_STRING` - text to prefill the text field
* with.
* - `SDL_PROP_TEXTINPUT_MAX_LENGTH_NUMBER` - maximum length for the text
* field, in characters (not bytes).
*
* On Android you can directly specify the input type:
*
@ -476,6 +484,10 @@ extern SDL_DECLSPEC bool SDLCALL SDL_StartTextInputWithProperties(SDL_Window *wi
#define SDL_PROP_TEXTINPUT_CAPITALIZATION_NUMBER "SDL.textinput.capitalization"
#define SDL_PROP_TEXTINPUT_AUTOCORRECT_BOOLEAN "SDL.textinput.autocorrect"
#define SDL_PROP_TEXTINPUT_MULTILINE_BOOLEAN "SDL.textinput.multiline"
#define SDL_PROP_TEXTINPUT_TITLE_STRING "SDL.textinput.title"
#define SDL_PROP_TEXTINPUT_PLACEHOLDER_STRING "SDL.textinput.placeholder"
#define SDL_PROP_TEXTINPUT_DEFAULT_TEXT_STRING "SDL.textinput.default_text"
#define SDL_PROP_TEXTINPUT_MAX_LENGTH_NUMBER "SDL.textinput.max_length"
#define SDL_PROP_TEXTINPUT_ANDROID_INPUTTYPE_NUMBER "SDL.textinput.android.inputtype"
/**

View file

@ -219,6 +219,19 @@
void reset_IOP(); \
void reset_IOP() {}
#elif defined(SDL_PLATFORM_DOS)
/*
On DOS, SDL provides a main function that sets up memory
page locking (code, data, stack are locked, future
malloc calls are not locked), and sets up the "fat DS"
trick, so we can use C pointers from protected mode that
access conventional memory. SDL _requires_ the "fat DS"
trick!
If you provide this yourself, you may define SDL_MAIN_HANDLED
*/
#define SDL_MAIN_AVAILABLE
#elif defined(SDL_PLATFORM_3DS)
/*
On N3DS, SDL provides a main function that sets up the screens

View file

@ -116,6 +116,20 @@ typedef enum SDL_SystemCursor
SDL_SYSTEM_CURSOR_S_RESIZE, /**< Window resize bottom. May be NS_RESIZE. */
SDL_SYSTEM_CURSOR_SW_RESIZE, /**< Window resize bottom-left. May be NESW_RESIZE. */
SDL_SYSTEM_CURSOR_W_RESIZE, /**< Window resize left. May be EW_RESIZE. */
SDL_SYSTEM_CURSOR_CONTEXT_MENU, /**< A context menu is available for the object under the cursor. */
SDL_SYSTEM_CURSOR_HELP, /**< Help is available for the object under the cursor. */
SDL_SYSTEM_CURSOR_CELL, /**< A set of cells may be selected. */
SDL_SYSTEM_CURSOR_VERTICAL_TEXT,/**< Text selection. May be TEXT */
SDL_SYSTEM_CURSOR_ALIAS, /**< A shortcut is to be created. */
SDL_SYSTEM_CURSOR_COPY, /**< Something is to be copied. */
SDL_SYSTEM_CURSOR_NO_DROP, /**< The dragged item cannot be dropped at this location. May be NOT_ALLOWED. */
SDL_SYSTEM_CURSOR_GRAB, /**< The object under the cursor can be grabbed */
SDL_SYSTEM_CURSOR_GRABBING, /**< An object is currently being grabbed. */
SDL_SYSTEM_CURSOR_COL_RESIZE, /**< Column resize. May be EW_RESIZE. */
SDL_SYSTEM_CURSOR_ROW_RESIZE, /**< Row resize. May be NS_RESIZE. */
SDL_SYSTEM_CURSOR_ALL_SCROLL, /**< Four pointed arrow pointing north, south, east, and west. */
SDL_SYSTEM_CURSOR_ZOOM_IN, /**< Zoom in. */
SDL_SYSTEM_CURSOR_ZOOM_OUT, /**< Zoom out. */
SDL_SYSTEM_CURSOR_COUNT
} SDL_SystemCursor;

View file

@ -31,6 +31,10 @@
#include <SDL3/SDL_platform.h>
#if defined(SDL_PLATFORM_CYGWIN) && !defined(USE_OPENGL32)
#define USE_OPENGL32 1 /* use native windows opengl32 */
#endif
#ifndef SDL_PLATFORM_IOS /* No OpenGL on iOS. */
/*

View file

@ -10,7 +10,7 @@ extern "C" {
#endif
/*
** Copyright 2013-2020 The Khronos Group Inc.
** Copyright 2013-2026 The Khronos Group Inc.
** SPDX-License-Identifier: MIT
**
** This header is generated from the Khronos OpenGL / OpenGL ES XML
@ -36,7 +36,7 @@ extern "C" {
#define GLAPI extern
#endif
#define GL_GLEXT_VERSION 20220530
#define GL_GLEXT_VERSION 20260319
/*#include <KHR/khrplatform.h>*/
#ifndef __khrplatform_h_
@ -5712,12 +5712,12 @@ typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severi
typedef void (APIENTRYP PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf);
typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, void *userParam);
typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufSize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message);
typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufSize, GLenum *categories, GLenum *severities, GLuint *ids, GLsizei *lengths, GLchar *message);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glDebugMessageEnableAMD (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
GLAPI void APIENTRY glDebugMessageInsertAMD (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf);
GLAPI void APIENTRY glDebugMessageCallbackAMD (GLDEBUGPROCAMD callback, void *userParam);
GLAPI GLuint APIENTRY glGetDebugMessageLogAMD (GLuint count, GLsizei bufSize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message);
GLAPI GLuint APIENTRY glGetDebugMessageLogAMD (GLuint count, GLsizei bufSize, GLenum *categories, GLenum *severities, GLuint *ids, GLsizei *lengths, GLchar *message);
#endif
#endif /* GL_AMD_debug_output */
@ -7673,6 +7673,47 @@ GLAPI void APIENTRY glFogCoordPointerEXT (GLenum type, GLsizei stride, const voi
#endif
#endif /* GL_EXT_fog_coord */
#ifndef GL_EXT_fragment_shading_rate
#define GL_EXT_fragment_shading_rate 1
#define GL_SHADING_RATE_1X1_PIXELS_EXT 0x96A6
#define GL_SHADING_RATE_1X2_PIXELS_EXT 0x96A7
#define GL_SHADING_RATE_2X1_PIXELS_EXT 0x96A8
#define GL_SHADING_RATE_2X2_PIXELS_EXT 0x96A9
#define GL_SHADING_RATE_1X4_PIXELS_EXT 0x96AA
#define GL_SHADING_RATE_4X1_PIXELS_EXT 0x96AB
#define GL_SHADING_RATE_4X2_PIXELS_EXT 0x96AC
#define GL_SHADING_RATE_2X4_PIXELS_EXT 0x96AD
#define GL_SHADING_RATE_4X4_PIXELS_EXT 0x96AE
#define GL_SHADING_RATE_EXT 0x96D0
#define GL_SHADING_RATE_ATTACHMENT_EXT 0x96D1
#define GL_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_EXT 0x96D2
#define GL_FRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_EXT 0x96D3
#define GL_FRAGMENT_SHADING_RATE_COMBINER_OP_MIN_EXT 0x96D4
#define GL_FRAGMENT_SHADING_RATE_COMBINER_OP_MAX_EXT 0x96D5
#define GL_FRAGMENT_SHADING_RATE_COMBINER_OP_MUL_EXT 0x96D6
#define GL_MIN_FRAGMENT_SHADING_RATE_ATTACHMENT_TEXEL_WIDTH_EXT 0x96D7
#define GL_MAX_FRAGMENT_SHADING_RATE_ATTACHMENT_TEXEL_WIDTH_EXT 0x96D8
#define GL_MIN_FRAGMENT_SHADING_RATE_ATTACHMENT_TEXEL_HEIGHT_EXT 0x96D9
#define GL_MAX_FRAGMENT_SHADING_RATE_ATTACHMENT_TEXEL_HEIGHT_EXT 0x96DA
#define GL_MAX_FRAGMENT_SHADING_RATE_ATTACHMENT_TEXEL_ASPECT_RATIO_EXT 0x96DB
#define GL_MAX_FRAGMENT_SHADING_RATE_ATTACHMENT_LAYERS_EXT 0x96DC
#define GL_FRAGMENT_SHADING_RATE_WITH_SHADER_DEPTH_STENCIL_WRITES_SUPPORTED_EXT 0x96DD
#define GL_FRAGMENT_SHADING_RATE_WITH_SAMPLE_MASK_SUPPORTED_EXT 0x96DE
#define GL_FRAGMENT_SHADING_RATE_ATTACHMENT_WITH_DEFAULT_FRAMEBUFFER_SUPPORTED_EXT 0x96DF
#define GL_FRAGMENT_SHADING_RATE_NON_TRIVIAL_COMBINERS_SUPPORTED_EXT 0x8F6F
#define GL_FRAGMENT_SHADING_RATE_PRIMITIVE_RATE_WITH_MULTI_VIEWPORT_SUPPORTED_EXT 0x9780
typedef void (APIENTRYP PFNGLGETFRAGMENTSHADINGRATESEXTPROC) (GLsizei samples, GLsizei maxCount, GLsizei *count, GLenum *shadingRates);
typedef void (APIENTRYP PFNGLSHADINGRATEEXTPROC) (GLenum rate);
typedef void (APIENTRYP PFNGLSHADINGRATECOMBINEROPSEXTPROC) (GLenum combinerOp0, GLenum combinerOp1);
typedef void (APIENTRYP PFNGLFRAMEBUFFERSHADINGRATEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint baseLayer, GLsizei numLayers, GLsizei texelWidth, GLsizei texelHeight);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glGetFragmentShadingRatesEXT (GLsizei samples, GLsizei maxCount, GLsizei *count, GLenum *shadingRates);
GLAPI void APIENTRY glShadingRateEXT (GLenum rate);
GLAPI void APIENTRY glShadingRateCombinerOpsEXT (GLenum combinerOp0, GLenum combinerOp1);
GLAPI void APIENTRY glFramebufferShadingRateEXT (GLenum target, GLenum attachment, GLuint texture, GLint baseLayer, GLsizei numLayers, GLsizei texelWidth, GLsizei texelHeight);
#endif
#endif /* GL_EXT_fragment_shading_rate */
#ifndef GL_EXT_framebuffer_blit
#define GL_EXT_framebuffer_blit 1
#define GL_READ_FRAMEBUFFER_EXT 0x8CA8
@ -7685,6 +7726,16 @@ GLAPI void APIENTRY glBlitFramebufferEXT (GLint srcX0, GLint srcY0, GLint srcX1,
#endif
#endif /* GL_EXT_framebuffer_blit */
#ifndef GL_EXT_framebuffer_blit_layers
#define GL_EXT_framebuffer_blit_layers 1
typedef void (APIENTRYP PFNGLBLITFRAMEBUFFERLAYERSEXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
typedef void (APIENTRYP PFNGLBLITFRAMEBUFFERLAYEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint srcLayer, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLint dstLayer, GLbitfield mask, GLenum filter);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glBlitFramebufferLayersEXT (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
GLAPI void APIENTRY glBlitFramebufferLayerEXT (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint srcLayer, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLint dstLayer, GLbitfield mask, GLenum filter);
#endif
#endif /* GL_EXT_framebuffer_blit_layers */
#ifndef GL_EXT_framebuffer_multisample
#define GL_EXT_framebuffer_multisample 1
#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB
@ -8121,6 +8172,86 @@ GLAPI void APIENTRY glImportMemoryWin32NameEXT (GLuint memory, GLuint64 size, GL
#endif
#endif /* GL_EXT_memory_object_win32 */
#ifndef GL_EXT_mesh_shader
#define GL_EXT_mesh_shader 1
#define GL_MESH_SHADER_EXT 0x9559
#define GL_TASK_SHADER_EXT 0x955A
#define GL_MAX_MESH_UNIFORM_BLOCKS_EXT 0x8E60
#define GL_MAX_MESH_TEXTURE_IMAGE_UNITS_EXT 0x8E61
#define GL_MAX_MESH_IMAGE_UNIFORMS_EXT 0x8E62
#define GL_MAX_MESH_UNIFORM_COMPONENTS_EXT 0x8E63
#define GL_MAX_MESH_ATOMIC_COUNTER_BUFFERS_EXT 0x8E64
#define GL_MAX_MESH_ATOMIC_COUNTERS_EXT 0x8E65
#define GL_MAX_MESH_SHADER_STORAGE_BLOCKS_EXT 0x8E66
#define GL_MAX_COMBINED_MESH_UNIFORM_COMPONENTS_EXT 0x8E67
#define GL_MAX_TASK_UNIFORM_BLOCKS_EXT 0x8E68
#define GL_MAX_TASK_TEXTURE_IMAGE_UNITS_EXT 0x8E69
#define GL_MAX_TASK_IMAGE_UNIFORMS_EXT 0x8E6A
#define GL_MAX_TASK_UNIFORM_COMPONENTS_EXT 0x8E6B
#define GL_MAX_TASK_ATOMIC_COUNTER_BUFFERS_EXT 0x8E6C
#define GL_MAX_TASK_ATOMIC_COUNTERS_EXT 0x8E6D
#define GL_MAX_TASK_SHADER_STORAGE_BLOCKS_EXT 0x8E6E
#define GL_MAX_COMBINED_TASK_UNIFORM_COMPONENTS_EXT 0x8E6F
#define GL_MAX_TASK_WORK_GROUP_TOTAL_COUNT_EXT 0x9740
#define GL_MAX_MESH_WORK_GROUP_TOTAL_COUNT_EXT 0x9741
#define GL_MAX_MESH_WORK_GROUP_INVOCATIONS_EXT 0x9757
#define GL_MAX_TASK_WORK_GROUP_INVOCATIONS_EXT 0x9759
#define GL_MAX_TASK_PAYLOAD_SIZE_EXT 0x9742
#define GL_MAX_TASK_SHARED_MEMORY_SIZE_EXT 0x9743
#define GL_MAX_MESH_SHARED_MEMORY_SIZE_EXT 0x9744
#define GL_MAX_TASK_PAYLOAD_AND_SHARED_MEMORY_SIZE_EXT 0x9745
#define GL_MAX_MESH_PAYLOAD_AND_SHARED_MEMORY_SIZE_EXT 0x9746
#define GL_MAX_MESH_OUTPUT_MEMORY_SIZE_EXT 0x9747
#define GL_MAX_MESH_PAYLOAD_AND_OUTPUT_MEMORY_SIZE_EXT 0x9748
#define GL_MAX_MESH_OUTPUT_VERTICES_EXT 0x9538
#define GL_MAX_MESH_OUTPUT_PRIMITIVES_EXT 0x9756
#define GL_MAX_MESH_OUTPUT_COMPONENTS_EXT 0x9749
#define GL_MAX_MESH_OUTPUT_LAYERS_EXT 0x974A
#define GL_MAX_MESH_MULTIVIEW_VIEW_COUNT_EXT 0x9557
#define GL_MESH_OUTPUT_PER_VERTEX_GRANULARITY_EXT 0x92DF
#define GL_MESH_OUTPUT_PER_PRIMITIVE_GRANULARITY_EXT 0x9543
#define GL_MAX_PREFERRED_TASK_WORK_GROUP_INVOCATIONS_EXT 0x974B
#define GL_MAX_PREFERRED_MESH_WORK_GROUP_INVOCATIONS_EXT 0x974C
#define GL_MESH_PREFERS_LOCAL_INVOCATION_VERTEX_OUTPUT_EXT 0x974D
#define GL_MESH_PREFERS_LOCAL_INVOCATION_PRIMITIVE_OUTPUT_EXT 0x974E
#define GL_MESH_PREFERS_COMPACT_VERTEX_OUTPUT_EXT 0x974F
#define GL_MESH_PREFERS_COMPACT_PRIMITIVE_OUTPUT_EXT 0x9750
#define GL_MAX_TASK_WORK_GROUP_COUNT_EXT 0x9751
#define GL_MAX_MESH_WORK_GROUP_COUNT_EXT 0x9752
#define GL_MAX_MESH_WORK_GROUP_SIZE_EXT 0x9758
#define GL_MAX_TASK_WORK_GROUP_SIZE_EXT 0x975A
#define GL_MESH_WORK_GROUP_SIZE_EXT 0x953E
#define GL_TASK_WORK_GROUP_SIZE_EXT 0x953F
#define GL_MESH_VERTICES_OUT_EXT 0x9579
#define GL_MESH_PRIMITIVES_OUT_EXT 0x957A
#define GL_MESH_OUTPUT_TYPE_EXT 0x957B
#define GL_UNIFORM_BLOCK_REFERENCED_BY_MESH_SHADER_EXT 0x959C
#define GL_UNIFORM_BLOCK_REFERENCED_BY_TASK_SHADER_EXT 0x959D
#define GL_REFERENCED_BY_MESH_SHADER_EXT 0x95A0
#define GL_REFERENCED_BY_TASK_SHADER_EXT 0x95A1
#define GL_TASK_SHADER_INVOCATIONS_EXT 0x9753
#define GL_MESH_SHADER_INVOCATIONS_EXT 0x9754
#define GL_MESH_PRIMITIVES_GENERATED_EXT 0x9755
#define GL_MESH_SHADER_BIT_EXT 0x00000040
#define GL_TASK_SHADER_BIT_EXT 0x00000080
#define GL_MESH_SUBROUTINE_EXT 0x957C
#define GL_TASK_SUBROUTINE_EXT 0x957D
#define GL_MESH_SUBROUTINE_UNIFORM_EXT 0x957E
#define GL_TASK_SUBROUTINE_UNIFORM_EXT 0x957F
#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_MESH_SHADER_EXT 0x959E
#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TASK_SHADER_EXT 0x959F
typedef void (APIENTRYP PFNGLDRAWMESHTASKSEXTPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
typedef void (APIENTRYP PFNGLDRAWMESHTASKSINDIRECTEXTPROC) (GLintptr indirect);
typedef void (APIENTRYP PFNGLMULTIDRAWMESHTASKSINDIRECTEXTPROC) (GLintptr indirect, GLsizei drawcount, GLsizei stride);
typedef void (APIENTRYP PFNGLMULTIDRAWMESHTASKSINDIRECTCOUNTEXTPROC) (GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glDrawMeshTasksEXT (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
GLAPI void APIENTRY glDrawMeshTasksIndirectEXT (GLintptr indirect);
GLAPI void APIENTRY glMultiDrawMeshTasksIndirectEXT (GLintptr indirect, GLsizei drawcount, GLsizei stride);
GLAPI void APIENTRY glMultiDrawMeshTasksIndirectCountEXT (GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
#endif
#endif /* GL_EXT_mesh_shader */
#ifndef GL_EXT_misc_attribute
#define GL_EXT_misc_attribute 1
#endif /* GL_EXT_misc_attribute */
@ -8882,18 +9013,18 @@ GLAPI void APIENTRY glTextureNormalEXT (GLenum mode);
#define GL_SRGB8_EXT 0x8C41
#define GL_SRGB_ALPHA_EXT 0x8C42
#define GL_SRGB8_ALPHA8_EXT 0x8C43
#define GL_SLUMINANCE_ALPHA_EXT 0x8C44
#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45
#define GL_SLUMINANCE_EXT 0x8C46
#define GL_SLUMINANCE8_EXT 0x8C47
#define GL_COMPRESSED_SRGB_EXT 0x8C48
#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49
#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A
#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B
#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
#define GL_SLUMINANCE_ALPHA_EXT 0x8C44
#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45
#define GL_SLUMINANCE_EXT 0x8C46
#define GL_SLUMINANCE8_EXT 0x8C47
#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A
#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B
#endif /* GL_EXT_texture_sRGB */
#ifndef GL_EXT_texture_sRGB_R8
@ -9687,6 +9818,18 @@ GLAPI void APIENTRY glGetFramebufferParameterivMESA (GLenum target, GLenum pname
#define GL_FRAMEBUFFER_SWAP_XY_MESA 0x8BBD
#endif /* GL_MESA_framebuffer_swap_xy */
#ifndef GL_MESA_map_buffer_client_pointer
#define GL_MESA_map_buffer_client_pointer 1
#define GL_MAP_CLIENT_POINTER_BIT_MESA 0x4000
#define GL_BUFFER_CLIENT_POINTER_SIZE_MESA 0x9790
typedef void (APIENTRYP PFNGLADDCLIENTPOINTERRANGEMESAPROC) (GLvoid *addr, GLsizeiptr size);
typedef void* (APIENTRYP PFNGLRELEASECLIENTPOINTERRANGEMESAPROC) (GLsizeiptr *size);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glAddClientPointerRangeMESA (GLvoid *addr, GLsizeiptr size);
GLAPI void* APIENTRY glReleaseClientPointerRangeMESA (GLsizeiptr *size);
#endif
#endif /* GL_MESA_map_buffer_client_pointer */
#ifndef GL_MESA_pack_invert
#define GL_MESA_pack_invert 1
#define GL_PACK_INVERT_MESA 0x8758
@ -9709,6 +9852,11 @@ GLAPI void APIENTRY glResizeBuffersMESA (void);
#define GL_MESA_shader_integer_functions 1
#endif /* GL_MESA_shader_integer_functions */
#ifndef GL_MESA_texture_const_bandwidth
#define GL_MESA_texture_const_bandwidth 1
#define GL_CONST_BW_TILING_MESA 0x8BBE
#endif /* GL_MESA_texture_const_bandwidth */
#ifndef GL_MESA_tile_raster_order
#define GL_MESA_tile_raster_order 1
#define GL_TILE_RASTER_ORDER_FIXED_MESA 0x8BB8
@ -9807,15 +9955,15 @@ typedef void (APIENTRYP PFNGLUPLOADGPUMASKNVXPROC) (GLbitfield mask);
typedef void (APIENTRYP PFNGLMULTICASTVIEWPORTARRAYVNVXPROC) (GLuint gpu, GLuint first, GLsizei count, const GLfloat *v);
typedef void (APIENTRYP PFNGLMULTICASTVIEWPORTPOSITIONWSCALENVXPROC) (GLuint gpu, GLuint index, GLfloat xcoeff, GLfloat ycoeff);
typedef void (APIENTRYP PFNGLMULTICASTSCISSORARRAYVNVXPROC) (GLuint gpu, GLuint first, GLsizei count, const GLint *v);
typedef GLuint (APIENTRYP PFNGLASYNCCOPYBUFFERSUBDATANVXPROC) (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *fenceValueArray, GLuint readGPU, GLbitfield writeGPUMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray);
typedef GLuint (APIENTRYP PFNGLASYNCCOPYIMAGESUBDATANVXPROC) (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *waitValueArray, GLuint srcGPU, GLbitfield dstGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray);
typedef GLuint (APIENTRYP PFNGLASYNCCOPYBUFFERSUBDATANVXPROC) (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *fenceValueArray, GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray);
typedef GLuint (APIENTRYP PFNGLASYNCCOPYIMAGESUBDATANVXPROC) (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *waitValueArray, GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glUploadGPUMaskNVX (GLbitfield mask);
GLAPI void APIENTRY glUploadGpuMaskNVX (GLbitfield mask);
GLAPI void APIENTRY glMulticastViewportArrayvNVX (GLuint gpu, GLuint first, GLsizei count, const GLfloat *v);
GLAPI void APIENTRY glMulticastViewportPositionWScaleNVX (GLuint gpu, GLuint index, GLfloat xcoeff, GLfloat ycoeff);
GLAPI void APIENTRY glMulticastScissorArrayvNVX (GLuint gpu, GLuint first, GLsizei count, const GLint *v);
GLAPI GLuint APIENTRY glAsyncCopyBufferSubDataNVX (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *fenceValueArray, GLuint readGPU, GLbitfield writeGPUMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray);
GLAPI GLuint APIENTRY glAsyncCopyImageSubDataNVX (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *waitValueArray, GLuint srcGPU, GLbitfield dstGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray);
GLAPI GLuint APIENTRY glAsyncCopyBufferSubDataNVX (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *fenceValueArray, GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray);
GLAPI GLuint APIENTRY glAsyncCopyImageSubDataNVX (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *waitValueArray, GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray);
#endif
#endif /* GL_NVX_gpu_multicast2 */
@ -9824,11 +9972,11 @@ GLAPI GLuint APIENTRY glAsyncCopyImageSubDataNVX (GLsizei waitSemaphoreCount, co
#define GL_LGPU_SEPARATE_STORAGE_BIT_NVX 0x0800
#define GL_MAX_LGPU_GPUS_NVX 0x92BA
typedef void (APIENTRYP PFNGLLGPUNAMEDBUFFERSUBDATANVXPROC) (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data);
typedef void (APIENTRYP PFNGLLGPUCOPYIMAGESUBDATANVXPROC) (GLuint sourceGPU, GLbitfield destinationGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
typedef void (APIENTRYP PFNGLLGPUCOPYIMAGESUBDATANVXPROC) (GLuint sourceGpu, GLbitfield destinationGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
typedef void (APIENTRYP PFNGLLGPUINTERLOCKNVXPROC) (void);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glLGPUNamedBufferSubDataNVX (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data);
GLAPI void APIENTRY glLGPUCopyImageSubDataNVX (GLuint sourceGPU, GLbitfield destinationGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
GLAPI void APIENTRY glLGPUCopyImageSubDataNVX (GLuint sourceGpu, GLbitfield destinationGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
GLAPI void APIENTRY glLGPUInterlockNVX (void);
#endif
#endif /* GL_NVX_linked_gpu_multicast */
@ -9836,13 +9984,13 @@ GLAPI void APIENTRY glLGPUInterlockNVX (void);
#ifndef GL_NVX_progress_fence
#define GL_NVX_progress_fence 1
typedef GLuint (APIENTRYP PFNGLCREATEPROGRESSFENCENVXPROC) (void);
typedef void (APIENTRYP PFNGLSIGNALSEMAPHOREUI64NVXPROC) (GLuint signalGPU, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray);
typedef void (APIENTRYP PFNGLWAITSEMAPHOREUI64NVXPROC) (GLuint waitGPU, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray);
typedef void (APIENTRYP PFNGLSIGNALSEMAPHOREUI64NVXPROC) (GLuint signalGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray);
typedef void (APIENTRYP PFNGLWAITSEMAPHOREUI64NVXPROC) (GLuint waitGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray);
typedef void (APIENTRYP PFNGLCLIENTWAITSEMAPHOREUI64NVXPROC) (GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI GLuint APIENTRY glCreateProgressFenceNVX (void);
GLAPI void APIENTRY glSignalSemaphoreui64NVX (GLuint signalGPU, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray);
GLAPI void APIENTRY glWaitSemaphoreui64NVX (GLuint waitGPU, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray);
GLAPI void APIENTRY glSignalSemaphoreui64NVX (GLuint signalGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray);
GLAPI void APIENTRY glWaitSemaphoreui64NVX (GLuint waitGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray);
GLAPI void APIENTRY glClientWaitSemaphoreui64NVX (GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray);
#endif
#endif /* GL_NVX_progress_fence */
@ -10433,25 +10581,25 @@ GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum target, GLenum attachmen
#define GL_MULTICAST_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9549
typedef void (APIENTRYP PFNGLRENDERGPUMASKNVPROC) (GLbitfield mask);
typedef void (APIENTRYP PFNGLMULTICASTBUFFERSUBDATANVPROC) (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data);
typedef void (APIENTRYP PFNGLMULTICASTCOPYBUFFERSUBDATANVPROC) (GLuint readGPU, GLbitfield writeGPUMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
typedef void (APIENTRYP PFNGLMULTICASTCOPYIMAGESUBDATANVPROC) (GLuint srcGPU, GLbitfield dstGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
typedef void (APIENTRYP PFNGLMULTICASTBLITFRAMEBUFFERNVPROC) (GLuint srcGPU, GLuint dstGPU, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
typedef void (APIENTRYP PFNGLMULTICASTCOPYBUFFERSUBDATANVPROC) (GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
typedef void (APIENTRYP PFNGLMULTICASTCOPYIMAGESUBDATANVPROC) (GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
typedef void (APIENTRYP PFNGLMULTICASTBLITFRAMEBUFFERNVPROC) (GLuint srcGpu, GLuint dstGpu, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
typedef void (APIENTRYP PFNGLMULTICASTFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLuint gpu, GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v);
typedef void (APIENTRYP PFNGLMULTICASTBARRIERNVPROC) (void);
typedef void (APIENTRYP PFNGLMULTICASTWAITSYNCNVPROC) (GLuint signalGPU, GLbitfield waitGPUMask);
typedef void (APIENTRYP PFNGLMULTICASTWAITSYNCNVPROC) (GLuint signalGpu, GLbitfield waitGpuMask);
typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTIVNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTUIVNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLuint *params);
typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTI64VNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLint64 *params);
typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTUI64VNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLuint64 *params);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glRenderGPUMaskNV (GLbitfield mask);
GLAPI void APIENTRY glRenderGpuMaskNV (GLbitfield mask);
GLAPI void APIENTRY glMulticastBufferSubDataNV (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data);
GLAPI void APIENTRY glMulticastCopyBufferSubDataNV (GLuint readGPU, GLbitfield writeGPUMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
GLAPI void APIENTRY glMulticastCopyImageSubDataNV (GLuint srcGPU, GLbitfield dstGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
GLAPI void APIENTRY glMulticastBlitFramebufferNV (GLuint srcGPU, GLuint dstGPU, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
GLAPI void APIENTRY glMulticastCopyBufferSubDataNV (GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
GLAPI void APIENTRY glMulticastCopyImageSubDataNV (GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
GLAPI void APIENTRY glMulticastBlitFramebufferNV (GLuint srcGpu, GLuint dstGpu, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
GLAPI void APIENTRY glMulticastFramebufferSampleLocationsfvNV (GLuint gpu, GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v);
GLAPI void APIENTRY glMulticastBarrierNV (void);
GLAPI void APIENTRY glMulticastWaitSyncNV (GLuint signalGPU, GLbitfield waitGPUMask);
GLAPI void APIENTRY glMulticastWaitSyncNV (GLuint signalGpu, GLbitfield waitGpuMask);
GLAPI void APIENTRY glMulticastGetQueryObjectivNV (GLuint gpu, GLuint id, GLenum pname, GLint *params);
GLAPI void APIENTRY glMulticastGetQueryObjectuivNV (GLuint gpu, GLuint id, GLenum pname, GLuint *params);
GLAPI void APIENTRY glMulticastGetQueryObjecti64vNV (GLuint gpu, GLuint id, GLenum pname, GLint64 *params);
@ -10563,12 +10711,6 @@ typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s,
typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v);
typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog);
typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v);
typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight);
typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight);
typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x);
typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y);
@ -10581,6 +10723,12 @@ typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, c
typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog);
typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v);
typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight);
typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glVertex2hNV (GLhalfNV x, GLhalfNV y);
GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *v);
@ -10610,12 +10758,6 @@ GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum target, GLhalfNV s, GLhalfNV t,
GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum target, const GLhalfNV *v);
GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum target, const GLhalfNV *v);
GLAPI void APIENTRY glFogCoordhNV (GLhalfNV fog);
GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *fog);
GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *v);
GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV weight);
GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *weight);
GLAPI void APIENTRY glVertexAttrib1hNV (GLuint index, GLhalfNV x);
GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint index, const GLhalfNV *v);
GLAPI void APIENTRY glVertexAttrib2hNV (GLuint index, GLhalfNV x, GLhalfNV y);
@ -10628,6 +10770,12 @@ GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint index, GLsizei n, const GLhalfN
GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint index, GLsizei n, const GLhalfNV *v);
GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint index, GLsizei n, const GLhalfNV *v);
GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint index, GLsizei n, const GLhalfNV *v);
GLAPI void APIENTRY glFogCoordhNV (GLhalfNV fog);
GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *fog);
GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *v);
GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV weight);
GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *weight);
#endif
#endif /* GL_NV_half_float */
@ -11764,6 +11912,10 @@ GLAPI void APIENTRY glDrawTransformFeedbackNV (GLenum mode, GLuint id);
#endif
#endif /* GL_NV_transform_feedback2 */
#ifndef GL_NV_uniform_buffer_std430_layout
#define GL_NV_uniform_buffer_std430_layout 1
#endif /* GL_NV_uniform_buffer_std430_layout */
#ifndef GL_NV_uniform_buffer_unified_memory
#define GL_NV_uniform_buffer_unified_memory 1
#define GL_UNIFORM_BUFFER_UNIFIED_NV 0x936E
@ -12279,8 +12431,10 @@ GLAPI void APIENTRY glViewportSwizzleNV (GLuint index, GLenum swizzlex, GLenum s
#define GL_MAX_VIEWS_OVR 0x9631
#define GL_FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR 0x9633
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews);
typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glFramebufferTextureMultiviewOVR (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews);
GLAPI void APIENTRY glNamedFramebufferTextureMultiviewOVR (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews);
#endif
#endif /* GL_OVR_multiview */

View file

@ -6,7 +6,7 @@ extern "C" {
#endif
/*
** Copyright 2013-2020 The Khronos Group Inc.
** Copyright 2013-2026 The Khronos Group Inc.
** SPDX-License-Identifier: MIT
**
** This header is generated from the Khronos OpenGL / OpenGL ES XML
@ -25,7 +25,7 @@ extern "C" {
#define GL_GLES_PROTOTYPES 1
#endif
/* Generated on date 20220530 */
/* Generated on date 20260319 */
/* Generated C header for:
* API: gles2

View file

@ -6,7 +6,7 @@ extern "C" {
#endif
/*
** Copyright 2013-2020 The Khronos Group Inc.
** Copyright 2013-2026 The Khronos Group Inc.
** SPDX-License-Identifier: MIT
**
** This header is generated from the Khronos OpenGL / OpenGL ES XML
@ -19,7 +19,7 @@ extern "C" {
#define GL_APIENTRYP GL_APIENTRY*
#endif
/* Generated on date 20220530 */
#define GL_GLEXT_VERSION 20260319
/* Generated C header for:
* API: gles2
@ -1052,6 +1052,21 @@ GL_APICALL void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei
#define GL_ARM_rgba8 1
#endif /* GL_ARM_rgba8 */
#ifndef GL_ARM_shader_core_properties
#define GL_ARM_shader_core_properties 1
#define GL_SHADER_CORE_COUNT_ARM 0x96F0
#define GL_SHADER_CORE_ACTIVE_COUNT_ARM 0x96F1
#define GL_SHADER_CORE_PRESENT_MASK_ARM 0x96F2
#define GL_SHADER_CORE_MAX_WARP_COUNT_ARM 0x96F3
#define GL_SHADER_CORE_PIXEL_RATE_ARM 0x96F4
#define GL_SHADER_CORE_TEXEL_RATE_ARM 0x96F5
#define GL_SHADER_CORE_FMA_RATE_ARM 0x96F6
typedef void (GL_APIENTRYP PFNGLMAXACTIVESHADERCORESARMPROC) (GLuint count);
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glMaxActiveShaderCoresARM (GLuint count);
#endif
#endif /* GL_ARM_shader_core_properties */
#ifndef GL_ARM_shader_framebuffer_fetch
#define GL_ARM_shader_framebuffer_fetch 1
#define GL_FETCH_PER_SAMPLE_ARM 0x8F65
@ -1459,6 +1474,16 @@ GL_APICALL void GL_APIENTRY glFramebufferShadingRateEXT (GLenum target, GLenum a
#endif
#endif /* GL_EXT_fragment_shading_rate */
#ifndef GL_EXT_framebuffer_blit_layers
#define GL_EXT_framebuffer_blit_layers 1
typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERLAYERSEXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERLAYEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint srcLayer, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLint dstLayer, GLbitfield mask, GLenum filter);
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glBlitFramebufferLayersEXT (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
GL_APICALL void GL_APIENTRY glBlitFramebufferLayerEXT (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint srcLayer, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLint dstLayer, GLbitfield mask, GLenum filter);
#endif
#endif /* GL_EXT_framebuffer_blit_layers */
#ifndef GL_EXT_geometry_point_size
#define GL_EXT_geometry_point_size 1
#endif /* GL_EXT_geometry_point_size */
@ -1612,6 +1637,86 @@ GL_APICALL void GL_APIENTRY glImportMemoryWin32NameEXT (GLuint memory, GLuint64
#endif
#endif /* GL_EXT_memory_object_win32 */
#ifndef GL_EXT_mesh_shader
#define GL_EXT_mesh_shader 1
#define GL_MESH_SHADER_EXT 0x9559
#define GL_TASK_SHADER_EXT 0x955A
#define GL_MAX_MESH_UNIFORM_BLOCKS_EXT 0x8E60
#define GL_MAX_MESH_TEXTURE_IMAGE_UNITS_EXT 0x8E61
#define GL_MAX_MESH_IMAGE_UNIFORMS_EXT 0x8E62
#define GL_MAX_MESH_UNIFORM_COMPONENTS_EXT 0x8E63
#define GL_MAX_MESH_ATOMIC_COUNTER_BUFFERS_EXT 0x8E64
#define GL_MAX_MESH_ATOMIC_COUNTERS_EXT 0x8E65
#define GL_MAX_MESH_SHADER_STORAGE_BLOCKS_EXT 0x8E66
#define GL_MAX_COMBINED_MESH_UNIFORM_COMPONENTS_EXT 0x8E67
#define GL_MAX_TASK_UNIFORM_BLOCKS_EXT 0x8E68
#define GL_MAX_TASK_TEXTURE_IMAGE_UNITS_EXT 0x8E69
#define GL_MAX_TASK_IMAGE_UNIFORMS_EXT 0x8E6A
#define GL_MAX_TASK_UNIFORM_COMPONENTS_EXT 0x8E6B
#define GL_MAX_TASK_ATOMIC_COUNTER_BUFFERS_EXT 0x8E6C
#define GL_MAX_TASK_ATOMIC_COUNTERS_EXT 0x8E6D
#define GL_MAX_TASK_SHADER_STORAGE_BLOCKS_EXT 0x8E6E
#define GL_MAX_COMBINED_TASK_UNIFORM_COMPONENTS_EXT 0x8E6F
#define GL_MAX_TASK_WORK_GROUP_TOTAL_COUNT_EXT 0x9740
#define GL_MAX_MESH_WORK_GROUP_TOTAL_COUNT_EXT 0x9741
#define GL_MAX_MESH_WORK_GROUP_INVOCATIONS_EXT 0x9757
#define GL_MAX_TASK_WORK_GROUP_INVOCATIONS_EXT 0x9759
#define GL_MAX_TASK_PAYLOAD_SIZE_EXT 0x9742
#define GL_MAX_TASK_SHARED_MEMORY_SIZE_EXT 0x9743
#define GL_MAX_MESH_SHARED_MEMORY_SIZE_EXT 0x9744
#define GL_MAX_TASK_PAYLOAD_AND_SHARED_MEMORY_SIZE_EXT 0x9745
#define GL_MAX_MESH_PAYLOAD_AND_SHARED_MEMORY_SIZE_EXT 0x9746
#define GL_MAX_MESH_OUTPUT_MEMORY_SIZE_EXT 0x9747
#define GL_MAX_MESH_PAYLOAD_AND_OUTPUT_MEMORY_SIZE_EXT 0x9748
#define GL_MAX_MESH_OUTPUT_VERTICES_EXT 0x9538
#define GL_MAX_MESH_OUTPUT_PRIMITIVES_EXT 0x9756
#define GL_MAX_MESH_OUTPUT_COMPONENTS_EXT 0x9749
#define GL_MAX_MESH_OUTPUT_LAYERS_EXT 0x974A
#define GL_MAX_MESH_MULTIVIEW_VIEW_COUNT_EXT 0x9557
#define GL_MESH_OUTPUT_PER_VERTEX_GRANULARITY_EXT 0x92DF
#define GL_MESH_OUTPUT_PER_PRIMITIVE_GRANULARITY_EXT 0x9543
#define GL_MAX_PREFERRED_TASK_WORK_GROUP_INVOCATIONS_EXT 0x974B
#define GL_MAX_PREFERRED_MESH_WORK_GROUP_INVOCATIONS_EXT 0x974C
#define GL_MESH_PREFERS_LOCAL_INVOCATION_VERTEX_OUTPUT_EXT 0x974D
#define GL_MESH_PREFERS_LOCAL_INVOCATION_PRIMITIVE_OUTPUT_EXT 0x974E
#define GL_MESH_PREFERS_COMPACT_VERTEX_OUTPUT_EXT 0x974F
#define GL_MESH_PREFERS_COMPACT_PRIMITIVE_OUTPUT_EXT 0x9750
#define GL_MAX_TASK_WORK_GROUP_COUNT_EXT 0x9751
#define GL_MAX_MESH_WORK_GROUP_COUNT_EXT 0x9752
#define GL_MAX_MESH_WORK_GROUP_SIZE_EXT 0x9758
#define GL_MAX_TASK_WORK_GROUP_SIZE_EXT 0x975A
#define GL_MESH_WORK_GROUP_SIZE_EXT 0x953E
#define GL_TASK_WORK_GROUP_SIZE_EXT 0x953F
#define GL_MESH_VERTICES_OUT_EXT 0x9579
#define GL_MESH_PRIMITIVES_OUT_EXT 0x957A
#define GL_MESH_OUTPUT_TYPE_EXT 0x957B
#define GL_UNIFORM_BLOCK_REFERENCED_BY_MESH_SHADER_EXT 0x959C
#define GL_UNIFORM_BLOCK_REFERENCED_BY_TASK_SHADER_EXT 0x959D
#define GL_REFERENCED_BY_MESH_SHADER_EXT 0x95A0
#define GL_REFERENCED_BY_TASK_SHADER_EXT 0x95A1
#define GL_TASK_SHADER_INVOCATIONS_EXT 0x9753
#define GL_MESH_SHADER_INVOCATIONS_EXT 0x9754
#define GL_MESH_PRIMITIVES_GENERATED_EXT 0x9755
#define GL_MESH_SHADER_BIT_EXT 0x00000040
#define GL_TASK_SHADER_BIT_EXT 0x00000080
#define GL_MESH_SUBROUTINE_EXT 0x957C
#define GL_TASK_SUBROUTINE_EXT 0x957D
#define GL_MESH_SUBROUTINE_UNIFORM_EXT 0x957E
#define GL_TASK_SUBROUTINE_UNIFORM_EXT 0x957F
#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_MESH_SHADER_EXT 0x959E
#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TASK_SHADER_EXT 0x959F
typedef void (GL_APIENTRYP PFNGLDRAWMESHTASKSEXTPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
typedef void (GL_APIENTRYP PFNGLDRAWMESHTASKSINDIRECTEXTPROC) (GLintptr indirect);
typedef void (GL_APIENTRYP PFNGLMULTIDRAWMESHTASKSINDIRECTEXTPROC) (GLintptr indirect, GLsizei drawcount, GLsizei stride);
typedef void (GL_APIENTRYP PFNGLMULTIDRAWMESHTASKSINDIRECTCOUNTEXTPROC) (GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glDrawMeshTasksEXT (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
GL_APICALL void GL_APIENTRY glDrawMeshTasksIndirectEXT (GLintptr indirect);
GL_APICALL void GL_APIENTRY glMultiDrawMeshTasksIndirectEXT (GLintptr indirect, GLsizei drawcount, GLsizei stride);
GL_APICALL void GL_APIENTRY glMultiDrawMeshTasksIndirectCountEXT (GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
#endif
#endif /* GL_EXT_mesh_shader */
#ifndef GL_EXT_multi_draw_arrays
#define GL_EXT_multi_draw_arrays 1
typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
@ -1856,7 +1961,7 @@ GL_APICALL void GL_APIENTRY glImportSemaphoreWin32NameEXT (GLuint semaphore, GLe
#define GL_PROGRAM_PIPELINE_BINDING_EXT 0x825A
typedef void (GL_APIENTRYP PFNGLACTIVESHADERPROGRAMEXTPROC) (GLuint pipeline, GLuint program);
typedef void (GL_APIENTRYP PFNGLBINDPROGRAMPIPELINEEXTPROC) (GLuint pipeline);
typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROGRAMVEXTPROC) (GLenum type, GLsizei count, const GLchar **strings);
typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROGRAMVEXTPROC) (GLenum type, GLsizei count, const GLchar *const*strings);
typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPIPELINESEXTPROC) (GLsizei n, const GLuint *pipelines);
typedef void (GL_APIENTRYP PFNGLGENPROGRAMPIPELINESEXTPROC) (GLsizei n, GLuint *pipelines);
typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
@ -1901,7 +2006,7 @@ typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint progra
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glActiveShaderProgramEXT (GLuint pipeline, GLuint program);
GL_APICALL void GL_APIENTRY glBindProgramPipelineEXT (GLuint pipeline);
GL_APICALL GLuint GL_APIENTRY glCreateShaderProgramvEXT (GLenum type, GLsizei count, const GLchar **strings);
GL_APICALL GLuint GL_APIENTRY glCreateShaderProgramvEXT (GLenum type, GLsizei count, const GLchar *const*strings);
GL_APICALL void GL_APIENTRY glDeleteProgramPipelinesEXT (GLsizei n, const GLuint *pipelines);
GL_APICALL void GL_APIENTRY glGenProgramPipelinesEXT (GLsizei n, GLuint *pipelines);
GL_APICALL void GL_APIENTRY glGetProgramPipelineInfoLogEXT (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
@ -2009,6 +2114,10 @@ GL_APICALL void GL_APIENTRY glClearPixelLocalStorageuiEXT (GLsizei offset, GLsiz
#define GL_EXT_shader_texture_lod 1
#endif /* GL_EXT_shader_texture_lod */
#ifndef GL_EXT_shader_texture_samples
#define GL_EXT_shader_texture_samples 1
#endif /* GL_EXT_shader_texture_samples */
#ifndef GL_EXT_shadow_samplers
#define GL_EXT_shadow_samplers 1
#define GL_TEXTURE_COMPARE_MODE_EXT 0x884C
@ -2375,6 +2484,16 @@ GL_APICALL void GL_APIENTRY glWindowRectanglesEXT (GLenum mode, GLsizei count, c
#define GL_GCCSO_SHADER_BINARY_FJ 0x9260
#endif /* GL_FJ_shader_binary_GCCSO */
#ifndef GL_HUAWEI_program_binary
#define GL_HUAWEI_program_binary 1
#define GL_PROGRAM_BINARY_HUAWEI 0x9771
#endif /* GL_HUAWEI_program_binary */
#ifndef GL_HUAWEI_shader_binary
#define GL_HUAWEI_shader_binary 1
#define GL_SHADER_BINARY_HUAWEI 0x9770
#endif /* GL_HUAWEI_shader_binary */
#ifndef GL_IMG_bindless_texture
#define GL_IMG_bindless_texture 1
typedef GLuint64 (GL_APIENTRYP PFNGLGETTEXTUREHANDLEIMGPROC) (GLuint texture);
@ -2553,10 +2672,42 @@ GL_APICALL void GL_APIENTRY glGetFramebufferParameterivMESA (GLenum target, GLen
#define GL_PROGRAM_BINARY_FORMAT_MESA 0x875F
#endif /* GL_MESA_program_binary_formats */
#ifndef GL_MESA_sampler_objects
#define GL_MESA_sampler_objects 1
#define GL_SAMPLER_BINDING 0x8919
typedef void (GL_APIENTRYP PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers);
typedef void (GL_APIENTRYP PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint *samplers);
typedef GLboolean (GL_APIENTRYP PFNGLISSAMPLERPROC) (GLuint sampler);
typedef void (GL_APIENTRYP PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler);
typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param);
typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint *param);
typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param);
typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat *param);
typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint *params);
typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat *params);
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glGenSamplers (GLsizei count, GLuint *samplers);
GL_APICALL void GL_APIENTRY glDeleteSamplers (GLsizei count, const GLuint *samplers);
GL_APICALL GLboolean GL_APIENTRY glIsSampler (GLuint sampler);
GL_APICALL void GL_APIENTRY glBindSampler (GLuint unit, GLuint sampler);
GL_APICALL void GL_APIENTRY glSamplerParameteri (GLuint sampler, GLenum pname, GLint param);
GL_APICALL void GL_APIENTRY glSamplerParameteriv (GLuint sampler, GLenum pname, const GLint *param);
GL_APICALL void GL_APIENTRY glSamplerParameterf (GLuint sampler, GLenum pname, GLfloat param);
GL_APICALL void GL_APIENTRY glSamplerParameterfv (GLuint sampler, GLenum pname, const GLfloat *param);
GL_APICALL void GL_APIENTRY glGetSamplerParameteriv (GLuint sampler, GLenum pname, GLint *params);
GL_APICALL void GL_APIENTRY glGetSamplerParameterfv (GLuint sampler, GLenum pname, GLfloat *params);
#endif
#endif /* GL_MESA_sampler_objects */
#ifndef GL_MESA_shader_integer_functions
#define GL_MESA_shader_integer_functions 1
#endif /* GL_MESA_shader_integer_functions */
#ifndef GL_MESA_texture_const_bandwidth
#define GL_MESA_texture_const_bandwidth 1
#define GL_CONST_BW_TILING_MESA 0x8BBE
#endif /* GL_MESA_texture_const_bandwidth */
#ifndef GL_NVX_blend_equation_advanced_multi_draw_buffers
#define GL_NVX_blend_equation_advanced_multi_draw_buffers 1
#endif /* GL_NVX_blend_equation_advanced_multi_draw_buffers */
@ -3186,6 +3337,13 @@ GL_APICALL void GL_APIENTRY glUniformMatrix4x3fvNV (GLint location, GLsizei coun
#endif
#endif /* GL_NV_non_square_matrices */
#ifndef GL_NV_pack_subimage
#define GL_NV_pack_subimage 1
#define GL_PACK_ROW_LENGTH_NV 0x0D02
#define GL_PACK_SKIP_ROWS_NV 0x0D03
#define GL_PACK_SKIP_PIXELS_NV 0x0D04
#endif /* GL_NV_pack_subimage */
#ifndef GL_NV_path_rendering
#define GL_NV_path_rendering 1
typedef double GLdouble;
@ -3683,6 +3841,14 @@ GL_APICALL void GL_APIENTRY glShadingRateSampleOrderCustomNV (GLenum rate, GLuin
#define GL_NV_stereo_view_rendering 1
#endif /* GL_NV_stereo_view_rendering */
#ifndef GL_NV_texture_barrier
#define GL_NV_texture_barrier 1
typedef void (GL_APIENTRYP PFNGLTEXTUREBARRIERNVPROC) (void);
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glTextureBarrierNV (void);
#endif
#endif /* GL_NV_texture_barrier */
#ifndef GL_NV_texture_border_clamp
#define GL_NV_texture_border_clamp 1
#define GL_TEXTURE_BORDER_COLOR_NV 0x1004
@ -3779,8 +3945,10 @@ GL_APICALL void GL_APIENTRY glViewportSwizzleNV (GLuint index, GLenum swizzlex,
#define GL_MAX_VIEWS_OVR 0x9631
#define GL_FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR 0x9633
typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews);
typedef void (GL_APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews);
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glFramebufferTextureMultiviewOVR (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews);
GL_APICALL void GL_APIENTRY glNamedFramebufferTextureMultiviewOVR (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews);
#endif
#endif /* GL_OVR_multiview */
@ -3917,6 +4085,10 @@ GL_APICALL void GL_APIENTRY glTexEstimateMotionRegionsQCOM (GLuint ref, GLuint t
#define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0
#endif /* GL_QCOM_perfmon_global_mode */
#ifndef GL_QCOM_render_sRGB_R8_RG8
#define GL_QCOM_render_sRGB_R8_RG8 1
#endif /* GL_QCOM_render_sRGB_R8_RG8 */
#ifndef GL_QCOM_render_shared_exponent
#define GL_QCOM_render_shared_exponent 1
#endif /* GL_QCOM_render_shared_exponent */
@ -3974,6 +4146,11 @@ GL_APICALL void GL_APIENTRY glTextureFoveationParametersQCOM (GLuint texture, GL
#define GL_MAX_SHADER_SUBSAMPLED_IMAGE_UNITS_QCOM 0x8FA1
#endif /* GL_QCOM_texture_foveated_subsampled_layout */
#ifndef GL_QCOM_texture_lod_bias
#define GL_QCOM_texture_lod_bias 1
#define GL_TEXTURE_LOD_BIAS_QCOM 0x8C96
#endif /* GL_QCOM_texture_lod_bias */
#ifndef GL_QCOM_tiled_rendering
#define GL_QCOM_tiled_rendering 1
#define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001
@ -4021,6 +4198,12 @@ GL_APICALL void GL_APIENTRY glEndTilingQCOM (GLbitfield preserveMask);
#define GL_WRITEONLY_RENDERING_QCOM 0x8823
#endif /* GL_QCOM_writeonly_rendering */
#ifndef GL_QCOM_ycbcr_degamma
#define GL_QCOM_ycbcr_degamma 1
#define GL_TEXTURE_Y_DEGAMMA_QCOM 0x9710
#define GL_TEXTURE_CBCR_DEGAMMA_QCOM 0x9711
#endif /* GL_QCOM_ycbcr_degamma */
#ifndef GL_VIV_shader_binary
#define GL_VIV_shader_binary 1
#define GL_SHADER_BINARY_VIV 0x8FC4

View file

@ -122,6 +122,8 @@
#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
/* Win32 but not WinCE */
# define KHRONOS_APIENTRY __stdcall
#elif defined(__CYGWIN__) /* __CYGWIN__ added by SDL */
# define KHRONOS_APIENTRY __stdcall
#else
# define KHRONOS_APIENTRY
#endif

View file

@ -19,14 +19,15 @@
3. This notice may not be removed or altered from any source distribution.
*/
/* WIKI CATEGORY: OpenXR */
/**
* # CategoryOpenXR
*
* Functions for creating OpenXR handles for SDL_gpu contexts.
*
* For the most part, OpenXR operates independent of SDL, but
* the graphics initialization depends on direct support from SDL_gpu.
* Functions for creating OpenXR handles for [GPU API](CategoryGPU) contexts.
*
* For the most part, OpenXR operates independent of SDL, but the graphics
* initialization depends on direct support from the GPU API.
*/
#ifndef SDL_openxr_h_
@ -41,6 +42,8 @@
extern "C" {
#endif
#ifndef SDL_WIKI_DOCUMENTATION_SECTION
#if defined(OPENXR_H_)
#define NO_SDL_OPENXR_TYPEDEFS 1
#endif /* OPENXR_H_ */
@ -79,6 +82,9 @@ typedef enum XrResult {
#define PFN_xrGetInstanceProcAddr SDL_FunctionPointer
#endif /* NO_SDL_OPENXR_TYPEDEFS */
#endif /* !SDL_WIKI_DOCUMENTATION_SECTION */
/**
* Creates an OpenXR session.
*

View file

@ -1407,7 +1407,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixelvalue, const SDL_PixelFo
* (e.g., a completely white pixel in 16-bit RGB565 format would return [0xff,
* 0xff, 0xff] not [0xf8, 0xfc, 0xf8]).
*
* If the surface has no alpha component, the alpha will be returned as 0xff
* If the format has no alpha component, the alpha will be returned as 0xff
* (100% opaque).
*
* \param pixelvalue a pixel value.

View file

@ -322,7 +322,7 @@
#define SDL_PLATFORM_CYGWIN 1
#endif
#if (defined(_WIN32) || defined(SDL_PLATFORM_CYGWIN)) && !defined(__NGAGE__)
#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(__NGAGE__)
/**
* A preprocessor macro that is only defined if compiling for Windows.
@ -422,7 +422,7 @@
#define SDL_PLATFORM_WIN32 1
#endif
#endif /* defined(_WIN32) || defined(SDL_PLATFORM_CYGWIN) */
#endif /* (defined(_WIN32) || defined(__CYGWIN__)) && !defined(__NGAGE__) */
/* This is to support generic "any GDK" separate from a platform-specific GDK */
@ -489,6 +489,16 @@
#define SDL_PLATFORM_NGAGE 1
#endif
#ifdef __MSDOS__
/**
* A preprocessor macro that is only defined if compiling for MS-DOS.
*
* \since This macro is available since SDL 3.6.0.
*/
#define SDL_PLATFORM_DOS 1
#endif
#ifdef __GNU__
/**

View file

@ -52,6 +52,8 @@
#include <string.h>
#include <wchar.h>
#include <SDL3/SDL_begin_code.h>
/* Most everything except Visual Studio 2008 and earlier has stdint.h now */
#if defined(_MSC_VER) && (_MSC_VER < 1600)
typedef signed __int8 int8_t;
@ -237,6 +239,8 @@ void *alloca(size_t);
typedef int SDL_compile_time_assert_ ## name[(x) * 2 - 1]
#endif
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
/**
* The number of elements in a static array.
*
@ -249,7 +253,15 @@ void *alloca(size_t);
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0])) /* or `_Countof(array)` on recent gcc and clang */
#else
#if !defined(__cplusplus) && ((defined(__GNUC__) && __GNUC__ >= 16) || SDL_HAS_EXTENSION(c_countof))
#define SDL_arraysize(array) _Countof(array)
#else
#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0]))
#endif
#endif
/**
* Macro useful for building other macros with strings in them.
@ -727,7 +739,7 @@ typedef Sint64 SDL_Time;
* <inttypes.h> should define these but this is not true all platforms.
* (for example win32) */
#ifndef SDL_PRIs64
#if defined(SDL_PLATFORM_WINDOWS)
#if defined(SDL_PLATFORM_WINDOWS) && !defined(SDL_PLATFORM_CYGWIN)
#define SDL_PRIs64 "I64d"
#elif defined(PRId64)
#define SDL_PRIs64 PRId64
@ -738,7 +750,7 @@ typedef Sint64 SDL_Time;
#endif
#endif
#ifndef SDL_PRIu64
#if defined(SDL_PLATFORM_WINDOWS)
#if defined(SDL_PLATFORM_WINDOWS) && !defined(SDL_PLATFORM_CYGWIN)
#define SDL_PRIu64 "I64u"
#elif defined(PRIu64)
#define SDL_PRIu64 PRIu64
@ -749,7 +761,7 @@ typedef Sint64 SDL_Time;
#endif
#endif
#ifndef SDL_PRIx64
#if defined(SDL_PLATFORM_WINDOWS)
#if defined(SDL_PLATFORM_WINDOWS) && !defined(SDL_PLATFORM_CYGWIN)
#define SDL_PRIx64 "I64x"
#elif defined(PRIx64)
#define SDL_PRIx64 PRIx64
@ -760,7 +772,7 @@ typedef Sint64 SDL_Time;
#endif
#endif
#ifndef SDL_PRIX64
#if defined(SDL_PLATFORM_WINDOWS)
#if defined(SDL_PLATFORM_WINDOWS) && !defined(SDL_PLATFORM_CYGWIN)
#define SDL_PRIX64 "I64X"
#elif defined(PRIX64)
#define SDL_PRIX64 PRIX64
@ -799,7 +811,7 @@ typedef Sint64 SDL_Time;
#endif
#endif
/* Specifically for the `long long` -- SDL-specific. */
#ifdef SDL_PLATFORM_WINDOWS
#if defined(SDL_PLATFORM_WINDOWS) && !defined(SDL_PLATFORM_CYGWIN)
#ifndef SDL_NOLONGLONG
SDL_COMPILE_TIME_ASSERT(longlong_size64, sizeof(long long) == 8); /* using I64 for windows - make sure `long long` is 64 bits. */
#endif
@ -1209,7 +1221,6 @@ SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int));
#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
/** \endcond */
#include <SDL3/SDL_begin_code.h>
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
@ -3996,7 +4007,7 @@ extern SDL_DECLSPEC char * SDLCALL SDL_strpbrk(const char *str, const char *brea
* NULL-terminated, as the function will blindly read until it sees the NULL
* char.
*
* if `*pslen` is zero, it assumes the end of string is reached and returns a
* If `*pslen` is zero, it assumes the end of string is reached and returns a
* zero codepoint regardless of the contents of the string buffer.
*
* If the resulting codepoint is zero (a NULL terminator), or `*pslen` is
@ -4418,9 +4429,6 @@ extern SDL_DECLSPEC Sint32 SDLCALL SDL_rand_r(Uint64 *state, Sint32 n);
/**
* Generate a uniform pseudo-random floating point number less than 1.0
*
* If you want reproducible output, be sure to initialize with SDL_srand()
* first.
*
* There are no guarantees as to the quality of the random sequence produced,
* and this should not be used for security (cryptography, passwords) or where
* money is on the line (loot-boxes, casinos). There are many random number

View file

@ -29,10 +29,10 @@
* provides a reasonable toolbox for transforming the data, including copying
* between surfaces, filling rectangles in the image data, etc.
*
* There is also a simple .bmp loader, SDL_LoadBMP(), and a simple .png
* loader, SDL_LoadPNG(). SDL itself does not provide loaders for other file
* formats, but there are several excellent external libraries that do,
* including its own satellite library,
* There is also a simple .bmp loader, SDL_LoadBMP(), a simple .png loader,
* SDL_LoadPNG(), and a simple .jpg loader, SDL_LoadJPG(). SDL itself does not
* provide loaders for other file formats, but there are several excellent
* external libraries that do, including its own satellite library,
* [SDL_image](https://wiki.libsdl.org/SDL3_image)
* .
*
@ -510,7 +510,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_LockSurface(SDL_Surface *surface);
extern SDL_DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface);
/**
* Load a BMP or PNG image from a seekable SDL data stream.
* Load a BMP, PNG or JPEG image from a seekable SDL data stream.
*
* The new surface should be freed with SDL_DestroySurface(). Not doing so
* will result in a memory leak.
@ -531,7 +531,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface);
extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_LoadSurface_IO(SDL_IOStream *src, bool closeio);
/**
* Load a BMP or PNG image from a file.
* Load a BMP, PNG or JPEG image from a file.
*
* The new surface should be freed with SDL_DestroySurface(). Not doing so
* will result in a memory leak.
@ -729,6 +729,54 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SavePNG_IO(SDL_Surface *surface, SDL_IOStre
*/
extern SDL_DECLSPEC bool SDLCALL SDL_SavePNG(SDL_Surface *surface, const char *file);
/**
* Load a JPEG image from a seekable SDL data stream.
*
* This is intended as a convenience function for loading images from trusted
* sources. If you want to load arbitrary images you should use libjpeg or
* another image loading library designed with security in mind.
*
* The new surface should be freed with SDL_DestroySurface(). Not doing so
* will result in a memory leak.
*
* \param src the data stream for the surface.
* \param closeio if true, calls SDL_CloseIO() on `src` before returning, even
* in the case of an error.
* \returns a pointer to a new SDL_Surface structure or NULL on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.6.0.
*
* \sa SDL_DestroySurface
* \sa SDL_LoadJPG
*/
extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_LoadJPG_IO(SDL_IOStream *src, bool closeio);
/**
* Load a JPEG image from a file.
*
* This is intended as a convenience function for loading images from trusted
* sources. If you want to load arbitrary images you should use libjpeg or
* another image loading library designed with security in mind.
*
* The new surface should be freed with SDL_DestroySurface(). Not doing so
* will result in a memory leak.
*
* \param file the JPG file to load.
* \returns a pointer to a new SDL_Surface structure or NULL on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.6.0.
*
* \sa SDL_DestroySurface
* \sa SDL_LoadJPG_IO
*/
extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_LoadJPG(const char *file);
/**
* Set the RLE acceleration hint for a surface.
*

View file

@ -616,6 +616,19 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SendAndroidMessage(Uint32 command, int para
#endif /* SDL_PLATFORM_ANDROID */
/**
* Query if the current device is a phone.
*
* If SDL can't determine this, it will return false.
*
* \returns true if the device is a phone, false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.6.0.
*/
extern SDL_DECLSPEC bool SDLCALL SDL_IsPhone(void);
/**
* Query if the current device is a tablet.
*

View file

@ -48,7 +48,7 @@
/* Thread synchronization primitives */
#include <SDL3/SDL_atomic.h>
#if defined(SDL_PLATFORM_WINDOWS)
#if defined(SDL_PLATFORM_WINDOWS) && !defined(SDL_PLATFORM_CYGWIN)
#include <process.h> /* _beginthreadex() and _endthreadex() */
#endif
@ -296,7 +296,7 @@ extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThreadWithProperties(SDL_Prop
/* The real implementation, hidden from the wiki, so it can show this as real functions that don't have macro magic. */
#ifndef SDL_WIKI_DOCUMENTATION_SECTION
# if defined(SDL_PLATFORM_WINDOWS)
# if defined(SDL_PLATFORM_WINDOWS) && !defined(SDL_PLATFORM_CYGWIN)
# ifndef SDL_BeginThreadFunction
# define SDL_BeginThreadFunction _beginthreadex
# endif

View file

@ -453,10 +453,10 @@ typedef SDL_EGLint *(SDLCALL *SDL_EGLIntArrayCallback)(void *userdata, SDL_EGLDi
/**
* An enumeration of OpenGL configuration attributes.
*
* While you can set most OpenGL attributes normally, the attributes listed
* above must be known before SDL creates the window that will be used with
* the OpenGL context. These attributes are set and read with
* SDL_GL_SetAttribute() and SDL_GL_GetAttribute().
* While you can set most OpenGL attributes normally, they must be known
* before SDL creates the window that will be used with the OpenGL context.
* These attributes are set and read with SDL_GL_SetAttribute() and
* SDL_GL_GetAttribute().
*
* In some cases, these attributes are minimum requests; the GL does not
* promise to give you exactly what you asked for. It's possible to ask for a
@ -1384,6 +1384,10 @@ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_CreatePopupWindow(SDL_Window *paren
* popup windows and have the behaviors and guidelines outlined in
* SDL_CreatePopupWindow().
*
* These are additional supported properties with visionOS:
*
* - `SDL_PROP_WINDOW_CREATE_VISIONOS_SETTINGS_STRING`: the settings of the window in JSON format. If this isn't set, the window will have standard UIKit behavior. If this is set to "" or a valid setting string then the window is created with enhanced features allowing curved display. The curvature in the settings is defined as a radius in millimeters. A common value for a gaming monitor is 1000 and a setting string for that would be "{\"curvatureRadius\":1000}".
*
* If this window is being created to be used with an SDL_Renderer, you should
* not add a graphics API specific property
* (`SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN`, etc), as SDL will handle that
@ -1446,6 +1450,7 @@ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_CreateWindowWithProperties(SDL_Prop
#define SDL_PROP_WINDOW_CREATE_X11_WINDOW_NUMBER "SDL.window.create.x11.window"
#define SDL_PROP_WINDOW_CREATE_EMSCRIPTEN_CANVAS_ID_STRING "SDL.window.create.emscripten.canvas_id"
#define SDL_PROP_WINDOW_CREATE_EMSCRIPTEN_KEYBOARD_ELEMENT_STRING "SDL.window.create.emscripten.keyboard_element"
#define SDL_PROP_WINDOW_CREATE_VISIONOS_SETTINGS_STRING "SDL.window.create.visionos.settings"
/**
* Get the numeric ID of a window.
@ -1624,6 +1629,10 @@ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_GetWindowParent(SDL_Window *window)
* - `SDL_PROP_WINDOW_EMSCRIPTEN_KEYBOARD_ELEMENT_STRING`: the keyboard
* element that associates keyboard events to this window
*
* On visionOS:
*
* - `SDL_PROP_WINDOW_VISIONOS_SETTINGS_STRING`: the current settings of the window in JSON format, or NULL if the window has standard UIKit behavior. SDL_EVENT_WINDOW_SETTINGS_CHANGED is sent when this value changes.
*
* \param window the window to query.
* \returns a valid property ID on success or 0 on failure; call
* SDL_GetError() for more information.
@ -1673,6 +1682,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetWindowProperties(SDL_Window
#define SDL_PROP_WINDOW_X11_WINDOW_NUMBER "SDL.window.x11.window"
#define SDL_PROP_WINDOW_EMSCRIPTEN_CANVAS_ID_STRING "SDL.window.emscripten.canvas_id"
#define SDL_PROP_WINDOW_EMSCRIPTEN_KEYBOARD_ELEMENT_STRING "SDL.window.emscripten.keyboard_element"
#define SDL_PROP_WINDOW_VISIONOS_SETTINGS_STRING "SDL.window.visionos.settings"
/**
* Get the window flags.

View file

@ -106,13 +106,18 @@
#cmakedefine HAVE_STRNSTR 1
#cmakedefine HAVE_STRTOK_R 1
#cmakedefine HAVE_ITOA 1
#cmakedefine HAVE__ITOA_S 1
#cmakedefine HAVE__LTOA 1
#cmakedefine HAVE__LTOA_S 1
#cmakedefine HAVE__UITOA 1
#cmakedefine HAVE__ULTOA 1
#cmakedefine HAVE__ULTOA_S 1
#cmakedefine HAVE_STRTOL 1
#cmakedefine HAVE_STRTOUL 1
#cmakedefine HAVE__I64TOA 1
#cmakedefine HAVE__I64TOA_S 1
#cmakedefine HAVE__UI64TOA 1
#cmakedefine HAVE__UI64TOA_S 1
#cmakedefine HAVE_STRTOLL 1
#cmakedefine HAVE_STRTOULL 1
#cmakedefine HAVE_STRTOD 1
@ -293,7 +298,7 @@
#cmakedefine SDL_AUDIO_DRIVER_N3DS 1
#cmakedefine SDL_AUDIO_DRIVER_NGAGE 1
#cmakedefine SDL_AUDIO_DRIVER_QNX 1
#cmakedefine SDL_AUDIO_DRIVER_DOS_SOUNDBLASTER 1
#cmakedefine SDL_AUDIO_DRIVER_PRIVATE 1
/* Enable various input drivers */
@ -304,6 +309,7 @@
#cmakedefine SDL_HAVE_MACHINE_JOYSTICK_H 1
#cmakedefine SDL_JOYSTICK_ANDROID 1
#cmakedefine SDL_JOYSTICK_DINPUT 1
#cmakedefine SDL_JOYSTICK_DOS 1
#cmakedefine SDL_JOYSTICK_DUMMY 1
#cmakedefine SDL_JOYSTICK_EMSCRIPTEN 1
#cmakedefine SDL_JOYSTICK_GAMEINPUT 1
@ -372,6 +378,7 @@
#cmakedefine SDL_THREAD_PSP 1
#cmakedefine SDL_THREAD_PS2 1
#cmakedefine SDL_THREAD_N3DS 1
#cmakedefine SDL_THREAD_DOS 1
#cmakedefine SDL_THREAD_PRIVATE 1
@ -394,6 +401,7 @@
#cmakedefine SDL_TIMER_PSP 1
#cmakedefine SDL_TIMER_PS2 1
#cmakedefine SDL_TIMER_N3DS 1
#cmakedefine SDL_TIMER_DOS 1
#cmakedefine SDL_TIMER_PRIVATE 1
@ -451,6 +459,7 @@
#cmakedefine SDL_VIDEO_DRIVER_X11_XSYNC 1
#cmakedefine SDL_VIDEO_DRIVER_X11_XTEST 1
#cmakedefine SDL_VIDEO_DRIVER_QNX 1
#cmakedefine SDL_VIDEO_DRIVER_DOSVESA 1
#cmakedefine SDL_VIDEO_DRIVER_PRIVATE 1
@ -525,6 +534,7 @@
#cmakedefine SDL_FILESYSTEM_PSP 1
#cmakedefine SDL_FILESYSTEM_PS2 1
#cmakedefine SDL_FILESYSTEM_N3DS 1
#cmakedefine SDL_FILESYSTEM_DOS 1
#cmakedefine SDL_FILESYSTEM_PRIVATE 1
@ -579,6 +589,8 @@
#cmakedefine SDL_VIDEO_VITA_PVR 1
#cmakedefine SDL_VIDEO_VITA_PVR_OGL 1
#cmakedefine SDL_EMSCRIPTEN_PERSISTENT_PATH_STRING "@SDL_EMSCRIPTEN_PERSISTENT_PATH_STRING@"
/* xkbcommon version info */
#define SDL_XKBCOMMON_VERSION_MAJOR @SDL_XKBCOMMON_VERSION_MAJOR@
#define SDL_XKBCOMMON_VERSION_MINOR @SDL_XKBCOMMON_VERSION_MINOR@
@ -623,6 +635,7 @@ typedef unsigned int uintptr_t;
#cmakedefine SDL_DISABLE_LSX 1
#cmakedefine SDL_DISABLE_LASX 1
#cmakedefine SDL_DISABLE_NEON 1
#cmakedefine SDL_DISABLE_SVE2 1
#ifdef SDL_PLATFORM_PRIVATE
#include "SDL_end_config_private.h"

View file

@ -226,4 +226,7 @@
/* Enable tray subsystem */
#define SDL_TRAY_DUMMY 1
/* Disable ARM SVE2 intrinsics until we confirm they're available on all Apple mobile and TV hardware */
#define SDL_DISABLE_SVE2 1
#endif /* SDL_build_config_ios_h_ */

View file

@ -30,10 +30,6 @@
// this checks for HAVE_DBUS_DBUS_H internally.
#include "core/linux/SDL_dbus.h"
#if defined(SDL_PLATFORM_UNIX) && !defined(SDL_PLATFORM_ANDROID)
#include "core/unix/SDL_gtk.h"
#endif
#ifdef SDL_PLATFORM_EMSCRIPTEN
#include <emscripten.h>
#endif
@ -714,10 +710,6 @@ void SDL_Quit(void)
SDL_DBus_Quit();
#endif
#if defined(SDL_PLATFORM_UNIX) && !defined(SDL_PLATFORM_ANDROID) && !defined(SDL_PLATFORM_EMSCRIPTEN) && !defined(SDL_PLATFORM_OHOS) && !defined(SDL_PLATFORM_PRIVATE)
SDL_Gtk_Quit();
#endif
SDL_QuitTimers();
SDL_QuitAsyncIO();
@ -779,6 +771,8 @@ const char *SDL_GetPlatform(void)
return "Linux";
#elif defined(__MINT__)
return "Atari MiNT";
#elif defined(SDL_PLATFORM_MSDOS)
return "MS-DOS";
#elif defined(SDL_PLATFORM_MACOS)
return "macOS";
#elif defined(SDL_PLATFORM_NETBSD)
@ -799,6 +793,8 @@ const char *SDL_GetPlatform(void)
return "Solaris";
#elif defined(SDL_PLATFORM_WIN32)
return "Windows";
#elif defined(SDL_PLATFORM_CYGWIN)
return "Cygwin";
#elif defined(SDL_PLATFORM_WINGDK)
return "WinGDK";
#elif defined(SDL_PLATFORM_XBOXONE)
@ -823,11 +819,24 @@ const char *SDL_GetPlatform(void)
return "GNU/Hurd";
#elif defined(__managarm__)
return "Managarm";
#elif defined(SDL_PLATFORM_OHOS)
return "OpenHarmony/HarmonyOS"
#else
return "Unknown (see SDL_platform.h)";
#endif
}
bool SDL_IsPhone(void)
{
#if defined(SDL_PLATFORM_ANDROID) || \
(defined(SDL_PLATFORM_IOS) && !defined(SDL_PLATFORM_VISIONOS))
if (!SDL_IsTablet() && !SDL_IsTV()) {
return true;
}
#endif
return false;
}
bool SDL_IsTablet(void)
{
#ifdef SDL_PLATFORM_ANDROID

View file

@ -43,22 +43,28 @@ bool SDL_SetErrorV(SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap)
if (fmt) {
int result;
SDL_error *error = SDL_GetErrBuf(true);
// use the other slot for the new error, so if this does
// SDL_SetError("%s", SDL_GetError()), we don't have a problem.
const int current = error->current ? 0 : 1;
SDL_ErrorInfo *errinfo = &error->info[current];
error->current = current;
errinfo->error = SDL_ErrorCodeGeneric;
va_list ap2;
error->error = SDL_ErrorCodeGeneric;
va_copy(ap2, ap);
result = SDL_vsnprintf(error->str, error->len, fmt, ap2);
result = SDL_vsnprintf(errinfo->str, errinfo->len, fmt, ap2);
va_end(ap2);
if (result >= 0 && (size_t)result >= error->len && error->realloc_func) {
if (result >= 0 && (size_t)result >= errinfo->len && error->realloc_func) {
size_t len = (size_t)result + 1;
char *str = (char *)error->realloc_func(error->str, len);
char *str = (char *)error->realloc_func(errinfo->str, len);
if (str) {
error->str = str;
error->len = len;
errinfo->str = str;
errinfo->len = len;
va_copy(ap2, ap);
(void)SDL_vsnprintf(error->str, error->len, fmt, ap2);
(void)SDL_vsnprintf(errinfo->str, errinfo->len, fmt, ap2);
va_end(ap2);
}
}
@ -67,7 +73,7 @@ bool SDL_SetErrorV(SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap)
// Note that there are many recoverable errors that may happen internally and
// can be safely ignored if the public API doesn't return an error code.
#if 0
SDL_LogError(SDL_LOG_CATEGORY_ERROR, "%s", error->str);
SDL_LogError(SDL_LOG_CATEGORY_ERROR, "%s", errinfo->str);
#endif
}
@ -82,9 +88,10 @@ const char *SDL_GetError(void)
return "";
}
switch (error->error) {
const SDL_ErrorInfo *errinfo = &error->info[error->current];
switch (errinfo->error) {
case SDL_ErrorCodeGeneric:
return error->str;
return errinfo->str;
case SDL_ErrorCodeOutOfMemory:
return "Out of memory";
default:
@ -97,7 +104,8 @@ bool SDL_ClearError(void)
SDL_error *error = SDL_GetErrBuf(false);
if (error) {
error->error = SDL_ErrorCodeNone;
SDL_ErrorInfo *errinfo = &error->info[error->current];
errinfo->error = SDL_ErrorCodeNone;
}
return true;
}
@ -107,7 +115,8 @@ bool SDL_OutOfMemory(void)
SDL_error *error = SDL_GetErrBuf(true);
if (error) {
error->error = SDL_ErrorCodeOutOfMemory;
SDL_ErrorInfo *errinfo = &error->info[error->current];
errinfo->error = SDL_ErrorCodeOutOfMemory;
}
return false;
}

View file

@ -34,11 +34,17 @@ typedef enum
SDL_ErrorCodeOutOfMemory,
} SDL_ErrorCode;
typedef struct SDL_error
typedef struct SDL_ErrorInfo
{
SDL_ErrorCode error;
char *str;
size_t len;
} SDL_ErrorInfo;
typedef struct SDL_error
{
SDL_ErrorInfo info[2]; // there are two, so you can do SDL_SetError("%s", SDL_GetError()) without stomping the buffer.
int current;
SDL_realloc_func realloc_func;
SDL_free_func free_func;
} SDL_error;
@ -46,16 +52,4 @@ typedef struct SDL_error
// Defined in SDL_thread.c
extern SDL_error *SDL_GetErrBuf(bool create);
// Macros to save and restore error values
#define SDL_PushError() \
char *saved_error = SDL_strdup(SDL_GetError())
#define SDL_PopError() \
do { \
if (saved_error) { \
SDL_SetError("%s", saved_error); \
SDL_free(saved_error); \
} \
} while (0)
#endif // SDL_error_c_h_

View file

@ -276,11 +276,16 @@ extern SDL_NORETURN void SDL_ExitProcess(int exitcode);
} while (0)
#endif
#define PUSH_SDL_ERROR() \
{ char *_error = SDL_strdup(SDL_GetError());
// Macros to save and restore error values
#define SDL_PushError() do { \
char *saved_error = SDL_strdup(SDL_GetError())
#define POP_SDL_ERROR() \
SDL_SetError("%s", _error); SDL_free(_error); }
#define SDL_PopError() \
if (saved_error) { \
SDL_SetError("%s", saved_error); \
SDL_free(saved_error); \
} \
} while (0)
#if defined(SDL_DISABLE_INVALID_PARAMS)
#ifdef DEBUG

View file

@ -22,6 +22,82 @@
#include "./SDL_list.h"
// Append
bool SDL_ListAppend(SDL_ListNode **head, void *ent)
{
SDL_ListNode *cursor;
SDL_ListNode *node;
if (!head) {
return false;
}
node = (SDL_ListNode *)SDL_malloc(sizeof(*node));
if (!node) {
return false;
}
node->entry = ent;
node->next = NULL;
if (*head) {
cursor = *head;
while (cursor->next) {
cursor = cursor->next;
}
cursor->next = node;
} else {
*head = node;
}
return true;
}
bool SDL_ListInsertAtPosition(SDL_ListNode **head, int pos, void *ent)
{
SDL_ListNode *cursor;
SDL_ListNode *node;
int i;
if (pos == -1) {
return SDL_ListAppend(head, ent);
}
if (!pos) {
node = (SDL_ListNode *)SDL_malloc(sizeof(*node));
if (!node) {
return false;
}
node->entry = ent;
if (*head) {
node->next = *head;
} else {
node->next = NULL;
}
*head = node;
}
cursor = *head;
for (i = 1; i < pos - 1 && cursor; i++) {
cursor = cursor->next;
}
if (!cursor) {
return SDL_ListAppend(head, ent);
}
node = (SDL_ListNode *)SDL_malloc(sizeof(*node));
if (!node) {
return false;
}
node->entry = ent;
node->next = cursor->next;
cursor->next = node;
return true;
}
// Push
bool SDL_ListAdd(SDL_ListNode **head, void *ent)
{
@ -84,3 +160,14 @@ void SDL_ListClear(SDL_ListNode **head)
SDL_free(tmp);
}
}
int SDL_ListCountEntries(SDL_ListNode **head)
{
SDL_ListNode *node;
int count = 0;
for (node = *head; node; node = node->next) {
++count;
}
return count;
}

View file

@ -28,9 +28,12 @@ typedef struct SDL_ListNode
struct SDL_ListNode *next;
} SDL_ListNode;
bool SDL_ListAppend(SDL_ListNode **head, void *ent);
bool SDL_ListInsertAtPosition(SDL_ListNode **head, int pos, void *ent);
bool SDL_ListAdd(SDL_ListNode **head, void *ent);
void SDL_ListPop(SDL_ListNode **head, void **ent);
void SDL_ListRemove(SDL_ListNode **head, void *ent);
void SDL_ListClear(SDL_ListNode **head);
int SDL_ListCountEntries(SDL_ListNode **head);
#endif // SDL_list_h_

64
src/SDL_menu.h Normal file
View file

@ -0,0 +1,64 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2026 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.
*/
#ifndef SDL_menu_h_
#define SDL_menu_h_
#include "./SDL_list.h"
typedef enum SDL_MenuItemType
{
SDL_MENU_ITEM_TYPE_NORMAL,
SDL_MENU_ITEM_TYPE_SEPERATOR,
SDL_MENU_ITEM_TYPE_CHECKBOX
} SDL_MenuItemType;
typedef enum SDL_MenuItemFlags
{
SDL_MENU_ITEM_FLAGS_NONE = 0,
SDL_MENU_ITEM_FLAGS_DISABLED = 1 << 0,
SDL_MENU_ITEM_FLAGS_CHECKED = 1 << 1,
SDL_MENU_ITEM_FLAGS_BAR_ITEM = 1 << 2
} SDL_MenuItemFlags;
/* Do not create this struct directly, users of this structure like the DBUSMENU layer use extended versions of it which need to be allocated by specfic functions. */
/* This struct is meant to be in an SDL_List just like sub_menu */
typedef struct SDL_MenuItem
{
/* Basic properties */
const char *utf8;
SDL_MenuItemType type;
SDL_MenuItemFlags flags;
/* Callback */
void *cb_data;
void (*cb)(struct SDL_MenuItem *, void *);
/* Submenu, set to NULL if none */
SDL_ListNode *sub_menu;
/* User data slots */
void *udata;
void *udata2;
void *udata3;
} SDL_MenuItem;
#endif // SDL_menu_h_

View file

@ -111,7 +111,8 @@ void SDL_CalculateFraction(float x, int *numerator, int *denominator)
bool SDL_startswith(const char *string, const char *prefix)
{
if (SDL_strncmp(string, prefix, SDL_strlen(prefix)) == 0) {
if (string && prefix &&
SDL_strncmp(string, prefix, SDL_strlen(prefix)) == 0) {
return true;
}
return false;
@ -384,6 +385,39 @@ int SDL_URIToLocal(const char *src, char *dst)
return -1;
}
bool SDL_IsURI(const char *uri)
{
/* A valid URI begins with a letter and is followed by any sequence of
* letters, digits, '+', '.', or '-'.
*/
if (!uri) {
return false;
}
// The first character of the scheme must be a letter.
if (!((*uri >= 'a' && *uri <= 'z') || (*uri >= 'A' && *uri <= 'Z'))) {
return false;
}
/* If the colon is found before encountering the end of the string or
* any invalid characters, the scheme can be considered valid.
*/
while (*uri) {
if (!((*uri >= 'a' && *uri <= 'z') ||
(*uri >= 'A' && *uri <= 'Z') ||
(*uri >= '0' && *uri <= '9') ||
*uri == '+' || *uri == '-' || *uri == '.')) {
return false;
}
if (*++uri == ':') {
return true;
}
}
return false;
}
// This is a set of per-thread persistent strings that we can return from the SDL API.
// This is used for short strings that might persist past the lifetime of the object
// they are related to.
@ -514,6 +548,9 @@ char *SDL_CreateDeviceName(Uint16 vendor, Uint16 product, const char *vendor_nam
case SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO:
name = SDL_strdup("Nintendo Switch Pro Controller");
break;
case SDL_GAMEPAD_TYPE_STEAM:
name = SDL_strdup("Steam Controller");
break;
default:
len = (6 + 1 + 6 + 1);
name = (char *)SDL_malloc(len);

Some files were not shown because too many files have changed in this diff Show more