Compare commits
116 Commits
bb2d6e5d0b
...
2025-08-17
| Author | SHA1 | Date | |
|---|---|---|---|
| 2819b3628e | |||
| 1e9e664012 | |||
| 0c8b39cee7 | |||
| d7b3af5ab8 | |||
| 5e5227305f | |||
| 3fc15a9512 | |||
| e774e0e8ad | |||
| a95776e6c7 | |||
| 0428ff26d5 | |||
| fc3e2deb1f | |||
| 65ca17f938 | |||
| ff2a51a507 | |||
| fe0083abd4 | |||
| 1c058694fd | |||
| cb0c3266d5 | |||
| 8ddc5d94f1 | |||
| b359a73d50 | |||
| 142603db71 | |||
| 1ec272f017 | |||
| 327987447d | |||
| ada5025c65 | |||
| 1ced698093 | |||
| 2a4c47a6ca | |||
| 6102504d32 | |||
| a123b3aa93 | |||
| 81d486f2d3 | |||
| 0c10898bdc | |||
| a3cd404545 | |||
| 5c708fc60a | |||
| 960ee367df | |||
| a7519fc372 | |||
| a983269080 | |||
| 3964503f1c | |||
| 8fcb7d1eb5 | |||
| 3e68afa4be | |||
| ca6edcccc0 | |||
| a388005968 | |||
| ea7628259a | |||
| a13e024934 | |||
| 4cc5102d70 | |||
| b2139d8e06 | |||
| ea3e704d34 | |||
| d5ab5748a7 | |||
| e950eb335d | |||
| e667063767 | |||
| 3534e4cc54 | |||
| 685b04c840 | |||
| 2bc28d47cd | |||
| 214a4045f0 | |||
| 3df13fdfa6 | |||
| 6011365330 | |||
| 03db5b4b0a | |||
| b1d4c8af07 | |||
| 45919eabab | |||
| 98cd87e2f0 | |||
| aabbb964e1 | |||
| 41e3fd1d8d | |||
| 659a4ced44 | |||
| 0fc709f6d5 | |||
| 4695f14de6 | |||
| 6eb35a6194 | |||
| 645862ecb5 | |||
| 72e606f6d3 | |||
| cadd8fd293 | |||
| 8da2db9686 | |||
| d21a474754 | |||
| c727cb6541 | |||
| 0204a8896a | |||
| d90f247bdd | |||
| 983eb7ee6f | |||
| 8eb8e07e0a | |||
| 3f34f80661 | |||
| 2b35ac0187 | |||
| 5a02518de3 | |||
| c7f5fed797 | |||
| 0fc83cf9c1 | |||
| 98f34c0a09 | |||
| 6f120dd4d2 | |||
| 3b07b2e130 | |||
| a191a296f8 | |||
| add9f8df7a | |||
| de5e99c932 | |||
| fdfc976749 | |||
| d8a37c555f | |||
| 8d2c24deb9 | |||
| 100b7265d5 | |||
| 49145905e3 | |||
| 6d36291f51 | |||
| 1224af2a9b | |||
| 8ed2dbcd4f | |||
| bc370c3b7d | |||
| 3bb5e5d604 | |||
| 12e3226f17 | |||
| f2d827daa4 | |||
| 5d760fc97c | |||
| 8301ca0aef | |||
| 4fd78d216a | |||
| adf21086e5 | |||
| cde6ad4b71 | |||
| 64ee4727ce | |||
| 450edbd8b0 | |||
| cd457d0db9 | |||
| 050b6716bf | |||
| 90c080f3e3 | |||
| de9fb5aa4b | |||
| c066cc32d3 | |||
| 6385e413da | |||
| fe818d6a10 | |||
| 89a0638a89 | |||
| 2d9a6e744e | |||
| dbecd9a22b | |||
| 12ec55308e | |||
| 69ee847575 | |||
| 989f081a25 | |||
| 677feb3afe | |||
| dce9213699 |
@@ -6,7 +6,14 @@ BreakBeforeBraces: Attach # Llaves en la misma línea
|
|||||||
AllowShortIfStatementsOnASingleLine: true
|
AllowShortIfStatementsOnASingleLine: true
|
||||||
AllowShortBlocksOnASingleLine: true
|
AllowShortBlocksOnASingleLine: true
|
||||||
AllowShortFunctionsOnASingleLine: All
|
AllowShortFunctionsOnASingleLine: All
|
||||||
AlignOperands: false
|
AlignOperands: DontAlign
|
||||||
AlignAfterOpenBracket: DontAlign
|
AlignAfterOpenBracket: DontAlign
|
||||||
BinPackArguments: false
|
BinPackArguments: false
|
||||||
BinPackParameters: false
|
BinPackParameters: false
|
||||||
|
ContinuationIndentWidth: 4
|
||||||
|
ConstructorInitializerIndentWidth: 4
|
||||||
|
IndentWrappedFunctionNames: false
|
||||||
|
Cpp11BracedListStyle: true
|
||||||
|
BreakConstructorInitializers: BeforeComma
|
||||||
|
AllowAllArgumentsOnNextLine: false
|
||||||
|
AllowAllParametersOfDeclarationOnNextLine: false
|
||||||
|
|||||||
15
.clang-tidy
15
.clang-tidy
@@ -1,8 +1,21 @@
|
|||||||
Checks: >
|
Checks: >
|
||||||
readability-*,
|
readability-*,
|
||||||
modernize-*,
|
modernize-*,
|
||||||
|
performance-*,
|
||||||
|
bugprone-unchecked-optional-access,
|
||||||
|
bugprone-sizeof-expression,
|
||||||
|
bugprone-suspicious-missing-comma,
|
||||||
|
bugprone-suspicious-index,
|
||||||
|
bugprone-undefined-memory-manipulation,
|
||||||
|
bugprone-use-after-move,
|
||||||
|
bugprone-out-of-bound-access,
|
||||||
-readability-identifier-length,
|
-readability-identifier-length,
|
||||||
-readability-magic-numbers
|
-readability-magic-numbers,
|
||||||
|
-bugprone-narrowing-conversions,
|
||||||
|
-performance-enum-size,
|
||||||
|
-performance-inefficient-string-concatenation,
|
||||||
|
-bugprone-integer-division,
|
||||||
|
-bugprone-easily-swappable-parameters,
|
||||||
|
|
||||||
WarningsAsErrors: '*'
|
WarningsAsErrors: '*'
|
||||||
# Solo incluir archivos de tu código fuente
|
# Solo incluir archivos de tu código fuente
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -10,10 +10,10 @@ thumbs.db
|
|||||||
*.tar.gz
|
*.tar.gz
|
||||||
*.zip
|
*.zip
|
||||||
*.app
|
*.app
|
||||||
*.dll
|
|
||||||
*config.bin
|
*config.bin
|
||||||
*score.bin
|
*score.bin
|
||||||
coffee_crisis*
|
coffee_crisis*
|
||||||
debug.txt
|
debug.txt
|
||||||
cppcheck-result*
|
cppcheck-result*
|
||||||
desktop.ini
|
desktop.ini
|
||||||
|
ccae_release/
|
||||||
@@ -33,10 +33,12 @@ set(APP_SOURCES
|
|||||||
source/writer.cpp
|
source/writer.cpp
|
||||||
|
|
||||||
# --- UI (User Interface) ---
|
# --- UI (User Interface) ---
|
||||||
|
source/ui/menu_option.cpp
|
||||||
source/ui/menu_renderer.cpp
|
source/ui/menu_renderer.cpp
|
||||||
source/ui/notifier.cpp
|
source/ui/notifier.cpp
|
||||||
source/ui/service_menu.cpp
|
source/ui/service_menu.cpp
|
||||||
source/ui/ui_message.cpp
|
source/ui/ui_message.cpp
|
||||||
|
source/ui/window_message.cpp
|
||||||
|
|
||||||
# --- Lógica del Juego ---
|
# --- Lógica del Juego ---
|
||||||
source/balloon_formations.cpp
|
source/balloon_formations.cpp
|
||||||
@@ -76,9 +78,12 @@ set(APP_SOURCES
|
|||||||
source/color.cpp
|
source/color.cpp
|
||||||
source/define_buttons.cpp
|
source/define_buttons.cpp
|
||||||
source/difficulty.cpp
|
source/difficulty.cpp
|
||||||
|
source/input_types.cpp
|
||||||
source/mouse.cpp
|
source/mouse.cpp
|
||||||
source/options.cpp
|
source/options.cpp
|
||||||
|
source/shutdown.cpp
|
||||||
source/stage.cpp
|
source/stage.cpp
|
||||||
|
source/system_utils.cpp
|
||||||
source/utils.cpp
|
source/utils.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
290
Makefile
290
Makefile
@@ -11,7 +11,22 @@ APP_NAME := Coffee Crisis Arcade Edition
|
|||||||
RELEASE_FOLDER := ccae_release
|
RELEASE_FOLDER := ccae_release
|
||||||
RELEASE_FILE := $(RELEASE_FOLDER)/$(TARGET_NAME)
|
RELEASE_FILE := $(RELEASE_FOLDER)/$(TARGET_NAME)
|
||||||
RESOURCE_FILE := release/coffee.res
|
RESOURCE_FILE := release/coffee.res
|
||||||
VERSION := 2025-03-25
|
|
||||||
|
# Versión automática basada en la fecha actual (específica por SO)
|
||||||
|
ifeq ($(OS),Windows_NT)
|
||||||
|
VERSION := $(shell powershell -Command "Get-Date -Format 'yyyy-MM-dd'")
|
||||||
|
else
|
||||||
|
VERSION := $(shell date +%Y-%m-%d)
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Variables específicas para Windows (usando APP_NAME)
|
||||||
|
ifeq ($(OS),Windows_NT)
|
||||||
|
WIN_TARGET_FILE := $(DIR_BIN)$(APP_NAME)
|
||||||
|
WIN_RELEASE_FILE := $(RELEASE_FOLDER)/$(APP_NAME)
|
||||||
|
else
|
||||||
|
WIN_TARGET_FILE := $(TARGET_FILE)
|
||||||
|
WIN_RELEASE_FILE := $(RELEASE_FILE)
|
||||||
|
endif
|
||||||
|
|
||||||
# Nombres para los ficheros de lanzamiento
|
# Nombres para los ficheros de lanzamiento
|
||||||
WINDOWS_RELEASE := $(TARGET_NAME)-$(VERSION)-win32-x64.zip
|
WINDOWS_RELEASE := $(TARGET_NAME)-$(VERSION)-win32-x64.zip
|
||||||
@@ -20,55 +35,124 @@ MACOS_APPLE_SILICON_RELEASE := $(TARGET_FILE)-$(VERSION)-macos-apple-silicon.dmg
|
|||||||
LINUX_RELEASE := $(TARGET_FILE)-$(VERSION)-linux.tar.gz
|
LINUX_RELEASE := $(TARGET_FILE)-$(VERSION)-linux.tar.gz
|
||||||
RASPI_RELEASE := $(TARGET_FILE)-$(VERSION)-raspberry.tar.gz
|
RASPI_RELEASE := $(TARGET_FILE)-$(VERSION)-raspberry.tar.gz
|
||||||
|
|
||||||
|
# Lista completa de archivos fuente (basada en CMakeLists.txt)
|
||||||
|
APP_SOURCES := \
|
||||||
|
source/animated_sprite.cpp \
|
||||||
|
source/asset.cpp \
|
||||||
|
source/audio.cpp \
|
||||||
|
source/background.cpp \
|
||||||
|
source/balloon_formations.cpp \
|
||||||
|
source/balloon_manager.cpp \
|
||||||
|
source/balloon.cpp \
|
||||||
|
source/bullet.cpp \
|
||||||
|
source/color.cpp \
|
||||||
|
source/define_buttons.cpp \
|
||||||
|
source/difficulty.cpp \
|
||||||
|
source/director.cpp \
|
||||||
|
source/enter_name.cpp \
|
||||||
|
source/explosions.cpp \
|
||||||
|
source/external/gif.cpp \
|
||||||
|
source/external/jail_audio.cpp \
|
||||||
|
source/external/jail_shader.cpp \
|
||||||
|
source/fade.cpp \
|
||||||
|
source/game_logo.cpp \
|
||||||
|
source/global_events.cpp \
|
||||||
|
source/global_inputs.cpp \
|
||||||
|
source/input_types.cpp \
|
||||||
|
source/input.cpp \
|
||||||
|
source/item.cpp \
|
||||||
|
source/lang.cpp \
|
||||||
|
source/main.cpp \
|
||||||
|
source/manage_hiscore_table.cpp \
|
||||||
|
source/mouse.cpp \
|
||||||
|
source/moving_sprite.cpp \
|
||||||
|
source/options.cpp \
|
||||||
|
source/param.cpp \
|
||||||
|
source/path_sprite.cpp \
|
||||||
|
source/player.cpp \
|
||||||
|
source/resource.cpp \
|
||||||
|
source/scoreboard.cpp \
|
||||||
|
source/screen.cpp \
|
||||||
|
source/sections/credits.cpp \
|
||||||
|
source/sections/game.cpp \
|
||||||
|
source/sections/hiscore_table.cpp \
|
||||||
|
source/sections/instructions.cpp \
|
||||||
|
source/sections/intro.cpp \
|
||||||
|
source/sections/logo.cpp \
|
||||||
|
source/sections/title.cpp \
|
||||||
|
source/shutdown.cpp \
|
||||||
|
source/smart_sprite.cpp \
|
||||||
|
source/sprite.cpp \
|
||||||
|
source/stage.cpp \
|
||||||
|
source/system_utils.cpp \
|
||||||
|
source/tabe.cpp \
|
||||||
|
source/text.cpp \
|
||||||
|
source/texture.cpp \
|
||||||
|
source/tiled_bg.cpp \
|
||||||
|
source/ui/menu_option.cpp \
|
||||||
|
source/ui/menu_renderer.cpp \
|
||||||
|
source/ui/notifier.cpp \
|
||||||
|
source/ui/service_menu.cpp \
|
||||||
|
source/ui/ui_message.cpp \
|
||||||
|
source/ui/window_message.cpp \
|
||||||
|
source/utils.cpp \
|
||||||
|
source/writer.cpp
|
||||||
|
|
||||||
# Includes
|
# Includes
|
||||||
INCLUDES := -I$(DIR_SOURCES)
|
INCLUDES := -Isource -Isource/external
|
||||||
|
|
||||||
# Variables según el sistema operativo
|
# Variables según el sistema operativo
|
||||||
ifeq ($(OS),Windows_NT)
|
ifeq ($(OS),Windows_NT)
|
||||||
FixPath = $(subst /,\\,$1)
|
FixPath = $(subst /,\\,$1)
|
||||||
SOURCES := source/*.cpp
|
CXXFLAGS := -std=c++20 -Wall -Os -ffunction-sections -fdata-sections -Wl,--gc-sections -static-libstdc++ -Wl,-subsystem,windows -DWINDOWS_BUILD
|
||||||
CXXFLAGS := -std=c++20 -Wall -Os -ffunction-sections -fdata-sections -Wl,--gc-sections -static-libstdc++ -Wl,-subsystem,windows
|
CXXFLAGS_DEBUG := -std=c++20 -Wall -g -D_DEBUG -DWINDOWS_BUILD
|
||||||
CXXFLAGS_DEBUG := -std=c++20 -Wall -g
|
|
||||||
LDFLAGS := -lmingw32 -lws2_32 -lSDL3 -lopengl32
|
LDFLAGS := -lmingw32 -lws2_32 -lSDL3 -lopengl32
|
||||||
RM := del /Q
|
RM := del /Q
|
||||||
MKDIR := mkdir
|
MKDIR := mkdir
|
||||||
else
|
else
|
||||||
FixPath = $1
|
FixPath = $1
|
||||||
SOURCES := source/*.cpp
|
|
||||||
CXXFLAGS := -std=c++20 -Wall -Os -ffunction-sections -fdata-sections
|
CXXFLAGS := -std=c++20 -Wall -Os -ffunction-sections -fdata-sections
|
||||||
CXXFLAGS_DEBUG := -std=c++20 -Wall -g
|
CXXFLAGS_DEBUG := -std=c++20 -Wall -g -D_DEBUG
|
||||||
LDFLAGS := -lSDL3
|
LDFLAGS := -lSDL3
|
||||||
RMFILE := rm -f
|
RMFILE := rm -f
|
||||||
RMDIR := rm -rdf
|
RMDIR := rm -rdf
|
||||||
MKDIR := mkdir -p
|
MKDIR := mkdir -p
|
||||||
UNAME_S := $(shell uname -s)
|
UNAME_S := $(shell uname -s)
|
||||||
ifeq ($(UNAME_S),Linux)
|
ifeq ($(UNAME_S),Linux)
|
||||||
|
CXXFLAGS += -DLINUX_BUILD
|
||||||
LDFLAGS += -lGL
|
LDFLAGS += -lGL
|
||||||
endif
|
endif
|
||||||
ifeq ($(UNAME_S),Darwin)
|
ifeq ($(UNAME_S),Darwin)
|
||||||
CXXFLAGS += -Wno-deprecated
|
CXXFLAGS += -Wno-deprecated -DMACOS_BUILD
|
||||||
CXXFLAGS_DEBUG += -Wno-deprecated
|
CXXFLAGS_DEBUG += -Wno-deprecated -DMACOS_BUILD
|
||||||
LDFLAGS += -framework OpenGL
|
LDFLAGS += -framework OpenGL
|
||||||
|
# Configurar arquitectura (por defecto arm64, como en CMake)
|
||||||
|
CXXFLAGS += -arch arm64
|
||||||
|
CXXFLAGS_DEBUG += -arch arm64
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Reglas para compilación
|
# Reglas para compilación
|
||||||
windows:
|
windows:
|
||||||
@echo off
|
@echo off
|
||||||
|
@echo Compilando para Windows con nombre: "$(APP_NAME).exe"
|
||||||
windres release/coffee.rc -O coff -o $(RESOURCE_FILE)
|
windres release/coffee.rc -O coff -o $(RESOURCE_FILE)
|
||||||
$(CXX) $(SOURCES) $(RESOURCE_FILE) $(CXXFLAGS) $(LDFLAGS) -o "$(TARGET_FILE).exe"
|
$(CXX) $(APP_SOURCES) $(RESOURCE_FILE) $(INCLUDES) $(CXXFLAGS) $(LDFLAGS) -o "$(WIN_TARGET_FILE).exe"
|
||||||
strip -s -R .comment -R .gnu.version "$(TARGET_FILE).exe" --strip-unneeded
|
strip -s -R .comment -R .gnu.version "$(WIN_TARGET_FILE).exe" --strip-unneeded
|
||||||
|
|
||||||
windows_rec:
|
windows_rec:
|
||||||
@echo off
|
@echo off
|
||||||
$(CXX) $(SOURCES) -D RECORDING $(CXXFLAGS) $(LDFLAGS) -o "$(TARGET_FILE)_rec.exe"
|
@echo Compilando version de grabacion para Windows: "$(APP_NAME)_rec.exe"
|
||||||
|
$(CXX) $(APP_SOURCES) $(INCLUDES) -DRECORDING $(CXXFLAGS) $(LDFLAGS) -o "$(WIN_TARGET_FILE)_rec.exe"
|
||||||
|
|
||||||
windows_debug:
|
windows_debug:
|
||||||
@echo off
|
@echo off
|
||||||
$(CXX) $(SOURCES) -D DEBUG -D VERBOSE $(CXXFLAGS_DEBUG) $(LDFLAGS) -o "$(TARGET_FILE)_debug.exe"
|
@echo Compilando version debug para Windows: "$(APP_NAME)_debug.exe"
|
||||||
|
$(CXX) $(APP_SOURCES) $(INCLUDES) -DDEBUG -DVERBOSE $(CXXFLAGS_DEBUG) $(LDFLAGS) -o "$(WIN_TARGET_FILE)_debug.exe"
|
||||||
|
|
||||||
windows_release:
|
windows_release:
|
||||||
@echo off
|
@echo off
|
||||||
|
@echo Creando release para Windows - Version: $(VERSION)
|
||||||
|
|
||||||
# Crea carpeta temporal 'RELEASE_FOLDER'
|
# Crea carpeta temporal 'RELEASE_FOLDER'
|
||||||
powershell if (Test-Path "$(RELEASE_FOLDER)") {Remove-Item "$(RELEASE_FOLDER)" -Recurse -Force}
|
powershell if (Test-Path "$(RELEASE_FOLDER)") {Remove-Item "$(RELEASE_FOLDER)" -Recurse -Force}
|
||||||
@@ -84,23 +168,27 @@ windows_release:
|
|||||||
|
|
||||||
# Compila
|
# Compila
|
||||||
windres release/coffee.rc -O coff -o $(RESOURCE_FILE)
|
windres release/coffee.rc -O coff -o $(RESOURCE_FILE)
|
||||||
$(CXX) $(SOURCES) $(RESOURCE_FILE) $(CXXFLAGS) $(LDFLAGS) -o "$(RELEASE_FILE).exe"
|
$(CXX) $(APP_SOURCES) $(RESOURCE_FILE) $(INCLUDES) $(CXXFLAGS) $(LDFLAGS) -o "$(WIN_RELEASE_FILE).exe"
|
||||||
strip -s -R .comment -R .gnu.version "$(RELEASE_FILE).exe" --strip-unneeded
|
strip -s -R .comment -R .gnu.version "$(WIN_RELEASE_FILE).exe" --strip-unneeded
|
||||||
|
|
||||||
# Crea el fichero .zip
|
# Crea el fichero .zip
|
||||||
powershell if (Test-Path "$(WINDOWS_RELEASE)") {Remove-Item "$(WINDOWS_RELEASE)"}
|
powershell if (Test-Path "$(WINDOWS_RELEASE)") {Remove-Item "$(WINDOWS_RELEASE)"}
|
||||||
powershell Compress-Archive -Path "$(RELEASE_FOLDER)"/* -DestinationPath "$(WINDOWS_RELEASE)"
|
powershell Compress-Archive -Path "$(RELEASE_FOLDER)"/* -DestinationPath "$(WINDOWS_RELEASE)"
|
||||||
|
@echo Release creado: $(WINDOWS_RELEASE)
|
||||||
|
|
||||||
# Elimina la carpeta temporal 'RELEASE_FOLDER'
|
# Elimina la carpeta temporal 'RELEASE_FOLDER'
|
||||||
powershell if (Test-Path "$(RELEASE_FOLDER)") {Remove-Item "$(RELEASE_FOLDER)" -Recurse -Force}
|
powershell if (Test-Path "$(RELEASE_FOLDER)") {Remove-Item "$(RELEASE_FOLDER)" -Recurse -Force}
|
||||||
|
|
||||||
macos:
|
macos:
|
||||||
$(CXX) $(SOURCES) $(CXXFLAGS) $(LDFLAGS) -o "$(TARGET_FILE)"
|
@echo "Compilando para macOS: $(TARGET_NAME)"
|
||||||
|
$(CXX) $(APP_SOURCES) $(INCLUDES) $(CXXFLAGS) $(LDFLAGS) -o "$(TARGET_FILE)"
|
||||||
|
|
||||||
macos_debug:
|
macos_debug:
|
||||||
$(CXX) $(SOURCES) -D DEBUG -D VERBOSE $(CXXFLAGS_DEBUG) $(LDFLAGS) -o "$(TARGET_FILE)_debug"
|
@echo "Compilando version debug para macOS: $(TARGET_NAME)_debug"
|
||||||
|
$(CXX) $(APP_SOURCES) $(INCLUDES) -DDEBUG -DVERBOSE $(CXXFLAGS_DEBUG) $(LDFLAGS) -o "$(TARGET_FILE)_debug"
|
||||||
|
|
||||||
macos_release:
|
macos_release:
|
||||||
|
@echo "Creando release para macOS - Version: $(VERSION)"
|
||||||
# Elimina datos de compilaciones anteriores
|
# Elimina datos de compilaciones anteriores
|
||||||
$(RMDIR) "$(RELEASE_FOLDER)"
|
$(RMDIR) "$(RELEASE_FOLDER)"
|
||||||
$(RMDIR) Frameworks
|
$(RMDIR) Frameworks
|
||||||
@@ -116,8 +204,8 @@ macos_release:
|
|||||||
|
|
||||||
# Copia carpetas y ficheros
|
# Copia carpetas y ficheros
|
||||||
cp -R data "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/Resources"
|
cp -R data "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/Resources"
|
||||||
cp -R release/SDL2.framework "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/Frameworks"
|
cp -R release/frameworks/SDL3.xcframework "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/Frameworks"
|
||||||
cp -R release/SDL2.framework Frameworks
|
cp -R release/frameworks/SDL3.xcframework Frameworks
|
||||||
cp release/*.icns "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/Resources"
|
cp release/*.icns "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/Resources"
|
||||||
cp release/Info.plist "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents"
|
cp release/Info.plist "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents"
|
||||||
cp LICENSE "$(RELEASE_FOLDER)"
|
cp LICENSE "$(RELEASE_FOLDER)"
|
||||||
@@ -128,7 +216,7 @@ macos_release:
|
|||||||
|
|
||||||
# Compila la versión para procesadores Intel
|
# Compila la versión para procesadores Intel
|
||||||
ifdef ENABLE_MACOS_X86_64
|
ifdef ENABLE_MACOS_X86_64
|
||||||
$(CXX) $(SOURCES) -D MACOS_BUNDLE $(CXXFLAGS) $(LDFLAGS) -o "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/MacOS/$(TARGET_NAME)" -rpath @executable_path/../Frameworks/ -target x86_64-apple-macos10.15
|
$(CXX) $(APP_SOURCES) $(INCLUDES) -DMACOS_BUNDLE $(CXXFLAGS) $(LDFLAGS) -o "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/MacOS/$(TARGET_NAME)" -rpath @executable_path/../Frameworks/ -target x86_64-apple-macos10.15
|
||||||
|
|
||||||
# Firma la aplicación
|
# Firma la aplicación
|
||||||
codesign --deep --force --sign - --timestamp=none "$(RELEASE_FOLDER)/$(APP_NAME).app"
|
codesign --deep --force --sign - --timestamp=none "$(RELEASE_FOLDER)/$(APP_NAME).app"
|
||||||
@@ -137,10 +225,11 @@ ifdef ENABLE_MACOS_X86_64
|
|||||||
hdiutil create tmp.dmg -ov -volname "$(APP_NAME)" -fs HFS+ -srcfolder "$(RELEASE_FOLDER)"
|
hdiutil create tmp.dmg -ov -volname "$(APP_NAME)" -fs HFS+ -srcfolder "$(RELEASE_FOLDER)"
|
||||||
hdiutil convert tmp.dmg -format UDZO -o "$(MACOS_INTEL_RELEASE)"
|
hdiutil convert tmp.dmg -format UDZO -o "$(MACOS_INTEL_RELEASE)"
|
||||||
$(RMFILE) tmp.dmg
|
$(RMFILE) tmp.dmg
|
||||||
|
@echo "Release Intel creado: $(MACOS_INTEL_RELEASE)"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Compila la versión para procesadores Apple Silicon
|
# Compila la versión para procesadores Apple Silicon
|
||||||
$(CXX) $(SOURCES) -D MACOS_BUNDLE -D SDL_DISABLE_IMMINTRIN_H $(CXXFLAGS) $(LDFLAGS) -o "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/MacOS/$(TARGET_NAME)" -rpath @executable_path/../Frameworks/ -target arm64-apple-macos11
|
$(CXX) $(APP_SOURCES) $(INCLUDES) -DMACOS_BUNDLE -DSDL_DISABLE_IMMINTRIN_H $(CXXFLAGS) $(LDFLAGS) -o "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/MacOS/$(TARGET_NAME)" -rpath @executable_path/../Frameworks/ -target arm64-apple-macos11
|
||||||
|
|
||||||
# Firma la aplicación
|
# Firma la aplicación
|
||||||
codesign --deep --force --sign - --timestamp=none "$(RELEASE_FOLDER)/$(APP_NAME).app"
|
codesign --deep --force --sign - --timestamp=none "$(RELEASE_FOLDER)/$(APP_NAME).app"
|
||||||
@@ -149,19 +238,23 @@ endif
|
|||||||
hdiutil create tmp.dmg -ov -volname "$(APP_NAME)" -fs HFS+ -srcfolder "$(RELEASE_FOLDER)"
|
hdiutil create tmp.dmg -ov -volname "$(APP_NAME)" -fs HFS+ -srcfolder "$(RELEASE_FOLDER)"
|
||||||
hdiutil convert tmp.dmg -format UDZO -o "$(MACOS_APPLE_SILICON_RELEASE)"
|
hdiutil convert tmp.dmg -format UDZO -o "$(MACOS_APPLE_SILICON_RELEASE)"
|
||||||
$(RMFILE) tmp.dmg
|
$(RMFILE) tmp.dmg
|
||||||
|
@echo "Release Apple Silicon creado: $(MACOS_APPLE_SILICON_RELEASE)"
|
||||||
|
|
||||||
# Elimina las carpetas temporales
|
# Elimina las carpetas temporales
|
||||||
$(RMDIR) Frameworks
|
$(RMDIR) Frameworks
|
||||||
$(RMDIR) "$(RELEASE_FOLDER)"
|
$(RMDIR) "$(RELEASE_FOLDER)"
|
||||||
|
|
||||||
linux:
|
linux:
|
||||||
$(CXX) $(SOURCES) $(CXXFLAGS) $(LDFLAGS) -o "$(TARGET_FILE)"
|
@echo "Compilando para Linux: $(TARGET_NAME)"
|
||||||
|
$(CXX) $(APP_SOURCES) $(INCLUDES) $(CXXFLAGS) $(LDFLAGS) -o "$(TARGET_FILE)"
|
||||||
strip -s -R .comment -R .gnu.version "$(TARGET_FILE)" --strip-unneeded
|
strip -s -R .comment -R .gnu.version "$(TARGET_FILE)" --strip-unneeded
|
||||||
|
|
||||||
linux_debug:
|
linux_debug:
|
||||||
$(CXX) $(SOURCES) -D DEBUG -D VERBOSE $(CXXFLAGS_DEBUG) $(LDFLAGS) -o "$(TARGET_FILE)_debug"
|
@echo "Compilando version debug para Linux: $(TARGET_NAME)_debug"
|
||||||
|
$(CXX) $(APP_SOURCES) $(INCLUDES) -DDEBUG -DVERBOSE $(CXXFLAGS_DEBUG) $(LDFLAGS) -o "$(TARGET_FILE)_debug"
|
||||||
|
|
||||||
linux_release:
|
linux_release:
|
||||||
|
@echo "Creando release para Linux - Version: $(VERSION)"
|
||||||
# Elimina carpetas previas
|
# Elimina carpetas previas
|
||||||
$(RMDIR) "$(RELEASE_FOLDER)"
|
$(RMDIR) "$(RELEASE_FOLDER)"
|
||||||
|
|
||||||
@@ -174,24 +267,123 @@ linux_release:
|
|||||||
cp README.md "$(RELEASE_FOLDER)"
|
cp README.md "$(RELEASE_FOLDER)"
|
||||||
|
|
||||||
# Compila
|
# Compila
|
||||||
$(CXX) $(SOURCES) $(CXXFLAGS) $(LDFLAGS) -o "$(RELEASE_FILE)"
|
$(CXX) $(APP_SOURCES) $(INCLUDES) $(CXXFLAGS) $(LDFLAGS) -o "$(RELEASE_FILE)"
|
||||||
strip -s -R .comment -R .gnu.version "$(RELEASE_FILE)" --strip-unneeded
|
strip -s -R .comment -R .gnu.version "$(RELEASE_FILE)" --strip-unneeded
|
||||||
|
|
||||||
# Empaqueta ficheros
|
# Empaqueta ficheros
|
||||||
$(RMFILE) "$(LINUX_RELEASE)"
|
$(RMFILE) "$(LINUX_RELEASE)"
|
||||||
cd "$(RELEASE_FOLDER)" && tar -czvf "$(LINUX_RELEASE)" *
|
tar -czvf "$(LINUX_RELEASE)" -C "$(RELEASE_FOLDER)" .
|
||||||
|
@echo "Release creado: $(LINUX_RELEASE)"
|
||||||
|
|
||||||
|
# Elimina la carpeta temporal
|
||||||
|
$(RMDIR) "$(RELEASE_FOLDER)"
|
||||||
|
|
||||||
|
linux_release_desktop:
|
||||||
|
@echo "Creando release con integracion desktop para Linux - Version: $(VERSION)"
|
||||||
|
# Elimina carpetas previas
|
||||||
|
$(RMDIR) "$(RELEASE_FOLDER)"
|
||||||
|
|
||||||
|
# Crea la estructura de directorios estándar para Linux
|
||||||
|
$(MKDIR) "$(RELEASE_FOLDER)/$(TARGET_NAME)"
|
||||||
|
$(MKDIR) "$(RELEASE_FOLDER)/$(TARGET_NAME)/bin"
|
||||||
|
$(MKDIR) "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/applications"
|
||||||
|
$(MKDIR) "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/icons/hicolor/256x256/apps"
|
||||||
|
$(MKDIR) "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/$(TARGET_NAME)"
|
||||||
|
|
||||||
|
# Copia ficheros del juego
|
||||||
|
cp -R data "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/$(TARGET_NAME)/"
|
||||||
|
cp LICENSE "$(RELEASE_FOLDER)/$(TARGET_NAME)/"
|
||||||
|
cp README.md "$(RELEASE_FOLDER)/$(TARGET_NAME)/"
|
||||||
|
|
||||||
|
# Compila el ejecutable
|
||||||
|
$(CXX) $(APP_SOURCES) $(INCLUDES) $(CXXFLAGS) $(LDFLAGS) -o "$(RELEASE_FOLDER)/$(TARGET_NAME)/bin/$(TARGET_NAME)"
|
||||||
|
strip -s -R .comment -R .gnu.version "$(RELEASE_FOLDER)/$(TARGET_NAME)/bin/$(TARGET_NAME)" --strip-unneeded
|
||||||
|
|
||||||
|
# Crea el archivo .desktop
|
||||||
|
@echo '[Desktop Entry]' > "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/applications/$(TARGET_NAME).desktop"
|
||||||
|
@echo 'Version=1.0' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/applications/$(TARGET_NAME).desktop"
|
||||||
|
@echo 'Type=Application' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/applications/$(TARGET_NAME).desktop"
|
||||||
|
@echo 'Name=$(APP_NAME)' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/applications/$(TARGET_NAME).desktop"
|
||||||
|
@echo 'Comment=Arcade action game - defend Earth from alien invasion!' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/applications/$(TARGET_NAME).desktop"
|
||||||
|
@echo 'Exec=/opt/$(TARGET_NAME)/bin/$(TARGET_NAME)' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/applications/$(TARGET_NAME).desktop"
|
||||||
|
@echo 'Icon=$(TARGET_NAME)' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/applications/$(TARGET_NAME).desktop"
|
||||||
|
@echo 'Path=/opt/$(TARGET_NAME)/share/$(TARGET_NAME)' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/applications/$(TARGET_NAME).desktop"
|
||||||
|
@echo 'Terminal=false' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/applications/$(TARGET_NAME).desktop"
|
||||||
|
@echo 'StartupNotify=true' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/applications/$(TARGET_NAME).desktop"
|
||||||
|
@echo 'Categories=Game;ArcadeGame;' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/applications/$(TARGET_NAME).desktop"
|
||||||
|
@echo 'Keywords=arcade;action;shooter;retro;' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/applications/$(TARGET_NAME).desktop"
|
||||||
|
|
||||||
|
# Copia el icono (si existe) y lo redimensiona si es necesario
|
||||||
|
@if [ -f "release/icon.png" ]; then \
|
||||||
|
if command -v magick >/dev/null 2>&1; then \
|
||||||
|
magick "release/icon.png" -resize 256x256 "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/icons/hicolor/256x256/apps/$(TARGET_NAME).png"; \
|
||||||
|
echo "Icono redimensionado de release/icon.png (usando ImageMagick)"; \
|
||||||
|
elif command -v convert >/dev/null 2>&1; then \
|
||||||
|
convert "release/icon.png" -resize 256x256 "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/icons/hicolor/256x256/apps/$(TARGET_NAME).png"; \
|
||||||
|
echo "Icono redimensionado de release/icon.png (usando ImageMagick legacy)"; \
|
||||||
|
elif command -v ffmpeg >/dev/null 2>&1; then \
|
||||||
|
ffmpeg -i "release/icon.png" -vf scale=256:256 "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/icons/hicolor/256x256/apps/$(TARGET_NAME).png" -y -loglevel quiet; \
|
||||||
|
echo "Icono redimensionado de release/icon.png (usando ffmpeg)"; \
|
||||||
|
else \
|
||||||
|
cp "release/icon.png" "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/icons/hicolor/256x256/apps/$(TARGET_NAME).png"; \
|
||||||
|
echo "Icono copiado sin redimensionar (instalar ImageMagick o ffmpeg para redimensionado automatico)"; \
|
||||||
|
fi; \
|
||||||
|
elif [ -f "release/coffee.png" ]; then \
|
||||||
|
cp "release/coffee.png" "$(RELEASE_FOLDER)/$(TARGET_NAME)/share/icons/hicolor/256x256/apps/$(TARGET_NAME).png"; \
|
||||||
|
echo "Icono copiado desde release/coffee.png"; \
|
||||||
|
else \
|
||||||
|
echo "Advertencia: No se encontró release/icon.png ni release/coffee.png - crear icono manualmente"; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Crea script de instalación
|
||||||
|
@echo '#!/bin/bash' > "$(RELEASE_FOLDER)/$(TARGET_NAME)/install.sh"
|
||||||
|
@echo 'echo "Instalando $(APP_NAME)..."' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/install.sh"
|
||||||
|
@echo 'sudo mkdir -p /opt/$(TARGET_NAME)' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/install.sh"
|
||||||
|
@echo 'sudo cp -R bin /opt/$(TARGET_NAME)/' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/install.sh"
|
||||||
|
@echo 'sudo cp -R share /opt/$(TARGET_NAME)/' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/install.sh"
|
||||||
|
@echo 'sudo cp LICENSE /opt/$(TARGET_NAME)/' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/install.sh"
|
||||||
|
@echo 'sudo cp README.md /opt/$(TARGET_NAME)/' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/install.sh"
|
||||||
|
@echo 'sudo mkdir -p /usr/share/applications' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/install.sh"
|
||||||
|
@echo 'sudo mkdir -p /usr/share/icons/hicolor/256x256/apps' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/install.sh"
|
||||||
|
@echo 'sudo cp /opt/$(TARGET_NAME)/share/applications/$(TARGET_NAME).desktop /usr/share/applications/' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/install.sh"
|
||||||
|
@echo 'sudo cp /opt/$(TARGET_NAME)/share/icons/hicolor/256x256/apps/$(TARGET_NAME).png /usr/share/icons/hicolor/256x256/apps/' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/install.sh"
|
||||||
|
@echo 'sudo update-desktop-database /usr/share/applications 2>/dev/null || true' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/install.sh"
|
||||||
|
@echo 'sudo gtk-update-icon-cache /usr/share/icons/hicolor 2>/dev/null || true' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/install.sh"
|
||||||
|
@echo 'echo "$(APP_NAME) instalado correctamente!"' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/install.sh"
|
||||||
|
@echo 'echo "Ya puedes encontrarlo en el menu de aplicaciones en la categoria Juegos."' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/install.sh"
|
||||||
|
chmod +x "$(RELEASE_FOLDER)/$(TARGET_NAME)/install.sh"
|
||||||
|
|
||||||
|
# Crea script de desinstalación
|
||||||
|
@echo '#!/bin/bash' > "$(RELEASE_FOLDER)/$(TARGET_NAME)/uninstall.sh"
|
||||||
|
@echo 'echo "Desinstalando $(APP_NAME)..."' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/uninstall.sh"
|
||||||
|
@echo 'sudo rm -rf /opt/$(TARGET_NAME)' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/uninstall.sh"
|
||||||
|
@echo 'sudo rm -f /usr/share/applications/$(TARGET_NAME).desktop' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/uninstall.sh"
|
||||||
|
@echo 'sudo rm -f /usr/share/icons/hicolor/256x256/apps/$(TARGET_NAME).png' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/uninstall.sh"
|
||||||
|
@echo 'sudo update-desktop-database /usr/share/applications 2>/dev/null || true' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/uninstall.sh"
|
||||||
|
@echo 'sudo gtk-update-icon-cache /usr/share/icons/hicolor 2>/dev/null || true' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/uninstall.sh"
|
||||||
|
@echo 'echo "$(APP_NAME) desinstalado correctamente."' >> "$(RELEASE_FOLDER)/$(TARGET_NAME)/uninstall.sh"
|
||||||
|
chmod +x "$(RELEASE_FOLDER)/$(TARGET_NAME)/uninstall.sh"
|
||||||
|
|
||||||
|
# Empaqueta ficheros
|
||||||
|
$(RMFILE) "$(TARGET_NAME)-$(VERSION)-linux-desktop.tar.gz"
|
||||||
|
tar -czvf "$(TARGET_NAME)-$(VERSION)-linux-desktop.tar.gz" -C "$(RELEASE_FOLDER)" .
|
||||||
|
@echo "Release con integracion desktop creado: $(TARGET_NAME)-$(VERSION)-linux-desktop.tar.gz"
|
||||||
|
@echo "Para instalar: extraer y ejecutar ./$(TARGET_NAME)/install.sh"
|
||||||
|
|
||||||
# Elimina la carpeta temporal
|
# Elimina la carpeta temporal
|
||||||
$(RMDIR) "$(RELEASE_FOLDER)"
|
$(RMDIR) "$(RELEASE_FOLDER)"
|
||||||
|
|
||||||
raspi:
|
raspi:
|
||||||
$(CXX) $(SOURCES) -D VERBOSE $(CXXFLAGS) $(LDFLAGS) -o $(TARGET_FILE)
|
@echo "Compilando para Raspberry Pi: $(TARGET_NAME)"
|
||||||
|
$(CXX) $(APP_SOURCES) $(INCLUDES) -DVERBOSE $(CXXFLAGS) $(LDFLAGS) -o $(TARGET_FILE)
|
||||||
strip -s -R .comment -R .gnu.version $(TARGET_FILE) --strip-unneeded
|
strip -s -R .comment -R .gnu.version $(TARGET_FILE) --strip-unneeded
|
||||||
|
|
||||||
raspi_debug:
|
raspi_debug:
|
||||||
$(CXX) $(SOURCES) -D VERBOSE -D DEBUG $(CXXFLAGS_DEBUG) $(LDFLAGS) -o "$(TARGET_FILE)_debug"
|
@echo "Compilando version debug para Raspberry Pi: $(TARGET_NAME)_debug"
|
||||||
|
$(CXX) $(APP_SOURCES) $(INCLUDES) -DVERBOSE -DDEBUG $(CXXFLAGS_DEBUG) $(LDFLAGS) -o "$(TARGET_FILE)_debug"
|
||||||
|
|
||||||
raspi_release:
|
raspi_release:
|
||||||
|
@echo "Creando release para Raspberry Pi - Version: $(VERSION)"
|
||||||
# Elimina carpetas previas
|
# Elimina carpetas previas
|
||||||
$(RMDIR) "$(RELEASE_FOLDER)"
|
$(RMDIR) "$(RELEASE_FOLDER)"
|
||||||
|
|
||||||
@@ -204,17 +396,19 @@ raspi_release:
|
|||||||
cp README.md "$(RELEASE_FOLDER)"
|
cp README.md "$(RELEASE_FOLDER)"
|
||||||
|
|
||||||
# Compila
|
# Compila
|
||||||
$(CXX) $(SOURCES) -D VERBOSE $(CXXFLAGS) $(LDFLAGS) -o "$(RELEASE_FILE)"
|
$(CXX) $(APP_SOURCES) $(INCLUDES) -DVERBOSE $(CXXFLAGS) $(LDFLAGS) -o "$(RELEASE_FILE)"
|
||||||
strip -s -R .comment -R .gnu.version "$(RELEASE_FILE)" --strip-unneeded
|
strip -s -R .comment -R .gnu.version "$(RELEASE_FILE)" --strip-unneeded
|
||||||
|
|
||||||
# Empaqueta ficheros
|
# Empaqueta ficheros
|
||||||
$(RMFILE) "$(LINUX_RELEASE)"
|
$(RMFILE) "$(RASPI_RELEASE)"
|
||||||
cd "$(RELEASE_FOLDER)" && tar -czvf "$(RASPI_RELEASE)" *
|
tar -czvf "$(RASPI_RELEASE)" -C "$(RELEASE_FOLDER)" .
|
||||||
|
@echo "Release creado: $(RASPI_RELEASE)"
|
||||||
|
|
||||||
# Elimina la carpeta temporal
|
# Elimina la carpeta temporal
|
||||||
$(RMDIR) "$(RELEASE_FOLDER)"
|
$(RMDIR) "$(RELEASE_FOLDER)"
|
||||||
|
|
||||||
anbernic:
|
anbernic:
|
||||||
|
@echo "Compilando para Anbernic: $(TARGET_NAME)"
|
||||||
# Elimina carpetas previas
|
# Elimina carpetas previas
|
||||||
$(RMDIR) "$(RELEASE_FOLDER)"_anbernic
|
$(RMDIR) "$(RELEASE_FOLDER)"_anbernic
|
||||||
|
|
||||||
@@ -225,4 +419,36 @@ anbernic:
|
|||||||
cp -R data "$(RELEASE_FOLDER)"_anbernic
|
cp -R data "$(RELEASE_FOLDER)"_anbernic
|
||||||
|
|
||||||
# Compila
|
# Compila
|
||||||
$(CXX) $(SOURCES) -D ANBERNIC -D NO_SHADERS -D ARCADE -D VERBOSE $(CXXFLAGS) $(LDFLAGS) -o $(RELEASE_FOLDER)_anbernic/$(TARGET_NAME)
|
$(CXX) $(APP_SOURCES) $(INCLUDES) -DANBERNIC -DNO_SHADERS -DARCADE -DVERBOSE $(CXXFLAGS) $(LDFLAGS) -o $(RELEASE_FOLDER)_anbernic/$(TARGET_NAME)
|
||||||
|
|
||||||
|
# Opción para deshabilitar audio (equivalente a la opción DISABLE_AUDIO de CMake)
|
||||||
|
no_audio:
|
||||||
|
@echo "Compilando sin audio: $(TARGET_NAME)_no_audio"
|
||||||
|
$(CXX) $(filter-out source/external/jail_audio.cpp,$(APP_SOURCES)) $(INCLUDES) -DNO_AUDIO $(CXXFLAGS) $(LDFLAGS) -o "$(TARGET_FILE)_no_audio"
|
||||||
|
|
||||||
|
# Regla para mostrar la versión actual
|
||||||
|
show_version:
|
||||||
|
@echo "Version actual: $(VERSION)"
|
||||||
|
|
||||||
|
# Regla de ayuda
|
||||||
|
help:
|
||||||
|
@echo "Makefile para Coffee Crisis Arcade Edition"
|
||||||
|
@echo "Comandos disponibles:"
|
||||||
|
@echo " windows - Compilar para Windows"
|
||||||
|
@echo " windows_debug - Compilar debug para Windows"
|
||||||
|
@echo " windows_release - Crear release completo para Windows"
|
||||||
|
@echo " linux - Compilar para Linux"
|
||||||
|
@echo " linux_debug - Compilar debug para Linux"
|
||||||
|
@echo " linux_release - Crear release basico para Linux"
|
||||||
|
@echo " linux_release_desktop - Crear release con integracion desktop para Linux"
|
||||||
|
@echo " macos - Compilar para macOS"
|
||||||
|
@echo " macos_debug - Compilar debug para macOS"
|
||||||
|
@echo " macos_release - Crear release completo para macOS"
|
||||||
|
@echo " raspi - Compilar para Raspberry Pi"
|
||||||
|
@echo " raspi_release - Crear release completo para Raspberry Pi"
|
||||||
|
@echo " anbernic - Compilar para Anbernic"
|
||||||
|
@echo " no_audio - Compilar sin sistema de audio"
|
||||||
|
@echo " show_version - Mostrar version actual ($(VERSION))"
|
||||||
|
@echo " help - Mostrar esta ayuda"
|
||||||
|
|
||||||
|
.PHONY: windows windows_rec windows_debug windows_release macos macos_debug macos_release linux linux_debug linux_release linux_release_desktop raspi raspi_debug raspi_release anbernic no_audio show_version help
|
||||||
10
README.md
10
README.md
@@ -24,6 +24,15 @@ El joc està optimitzat per a ser jugat amb un mando de jocs, encara que un dels
|
|||||||
- **Fletxes**: Mou al personatge.
|
- **Fletxes**: Mou al personatge.
|
||||||
- **Q, W, E**: Disparar a l'esquerra, al centre i a la dreta, respectivament.
|
- **Q, W, E**: Disparar a l'esquerra, al centre i a la dreta, respectivament.
|
||||||
|
|
||||||
|
### Menú de servei:
|
||||||
|
|
||||||
|
| Teclat | Mando | Acció |
|
||||||
|
|:------------|:----------------------------------|:---------------------------------|
|
||||||
|
| **F12** | Botó de servei | Obrir o tancar el menú de servei |
|
||||||
|
| **Fletxes** | Mando direccional | Moure's pel menú |
|
||||||
|
| **Enter** | Botó de disparar cap a l'esquerra | Acceptar opció |
|
||||||
|
| **Borrar** | Botó de disparar cap al centre | Tornar arrere |
|
||||||
|
|
||||||
> Nota: El joc suporta nomes un jugador amb teclat.
|
> Nota: El joc suporta nomes un jugador amb teclat.
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
@@ -36,6 +45,7 @@ El joc està optimitzat per a ser jugat amb un mando de jocs, encara que un dels
|
|||||||
| Tecla | Funció |
|
| Tecla | Funció |
|
||||||
|:-----------:|----------------------------------------------------|
|
|:-----------:|----------------------------------------------------|
|
||||||
| **ESC** | Tancar el joc |
|
| **ESC** | Tancar el joc |
|
||||||
|
| **F12** | Menu de servei |
|
||||||
| **P** | Pausar el joc |
|
| **P** | Pausar el joc |
|
||||||
| **F1** | Fa la finestra més xicoteta |
|
| **F1** | Fa la finestra més xicoteta |
|
||||||
| **F2** | Fa la finestra més gran |
|
| **F2** | Fa la finestra més gran |
|
||||||
|
|||||||
196
data/config/assets.txt
Normal file
196
data/config/assets.txt
Normal file
@@ -0,0 +1,196 @@
|
|||||||
|
# Coffee Crisis Arcade Edition - Asset Configuration
|
||||||
|
# Formato: TIPO|RUTA [|OPCIONES]
|
||||||
|
# Opciones: optional, absolute (separadas por comas)
|
||||||
|
# Variables: ${PREFIX}, ${SYSTEM_FOLDER}
|
||||||
|
|
||||||
|
# Archivos de configuración del sistema (absolutos y opcionales)
|
||||||
|
DATA|${SYSTEM_FOLDER}/config.txt|optional,absolute
|
||||||
|
DATA|${SYSTEM_FOLDER}/controllers.json|optional,absolute
|
||||||
|
DATA|${SYSTEM_FOLDER}/score.bin|optional,absolute
|
||||||
|
|
||||||
|
# Archivos de configuración del juego
|
||||||
|
DATA|${PREFIX}/data/config/formations.txt
|
||||||
|
DATA|${PREFIX}/data/config/gamecontrollerdb.txt
|
||||||
|
DATA|${PREFIX}/data/config/param_320x240.txt
|
||||||
|
DATA|${PREFIX}/data/config/param_320x256.txt
|
||||||
|
DATA|${PREFIX}/data/config/param_red.txt
|
||||||
|
DATA|${PREFIX}/data/config/pools.txt
|
||||||
|
DATA|${PREFIX}/data/config/stages.txt
|
||||||
|
DEMODATA|${PREFIX}/data/config/demo1.bin
|
||||||
|
DEMODATA|${PREFIX}/data/config/demo2.bin
|
||||||
|
|
||||||
|
# Música
|
||||||
|
MUSIC|${PREFIX}/data/music/credits.ogg
|
||||||
|
MUSIC|${PREFIX}/data/music/intro.ogg
|
||||||
|
MUSIC|${PREFIX}/data/music/playing.ogg
|
||||||
|
MUSIC|${PREFIX}/data/music/title.ogg
|
||||||
|
|
||||||
|
# Sonidos
|
||||||
|
SOUND|${PREFIX}/data/sound/balloon_bounce0.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/balloon_bounce1.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/balloon_bounce2.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/balloon_bounce3.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/balloon_pop0.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/balloon_pop1.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/balloon_pop2.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/balloon_pop3.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/bullet.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/clock.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/coffee_out.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/continue_clock.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/credit.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/debian_drop.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/debian_pickup.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/hi_score_achieved.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/item_drop.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/item_pickup.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/jump.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/logo.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/notify.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/player_collision.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/power_ball_explosion.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/service_menu_adjust.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/service_menu_move.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/service_menu_select.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/stage_change.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/tabe_hit.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/tabe.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/title.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/voice_aw_aw_aw.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/voice_coffee.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/voice_credit_thankyou.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/voice_get_ready.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/voice_no.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/voice_power_up.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/voice_recover.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/voice_thankyou.wav
|
||||||
|
SOUND|${PREFIX}/data/sound/walk.wav
|
||||||
|
|
||||||
|
# Shaders
|
||||||
|
DATA|${PREFIX}/data/shaders/crtpi_240.glsl
|
||||||
|
DATA|${PREFIX}/data/shaders/crtpi_256.glsl
|
||||||
|
|
||||||
|
# Texturas - Balloons
|
||||||
|
ANIMATION|${PREFIX}/data/gfx/balloon/balloon0.ani
|
||||||
|
ANIMATION|${PREFIX}/data/gfx/balloon/balloon1.ani
|
||||||
|
ANIMATION|${PREFIX}/data/gfx/balloon/balloon2.ani
|
||||||
|
ANIMATION|${PREFIX}/data/gfx/balloon/balloon3.ani
|
||||||
|
BITMAP|${PREFIX}/data/gfx/balloon/balloon0.png
|
||||||
|
BITMAP|${PREFIX}/data/gfx/balloon/balloon1.png
|
||||||
|
BITMAP|${PREFIX}/data/gfx/balloon/balloon2.png
|
||||||
|
BITMAP|${PREFIX}/data/gfx/balloon/balloon3.png
|
||||||
|
|
||||||
|
# Texturas - Explosiones
|
||||||
|
ANIMATION|${PREFIX}/data/gfx/balloon/explosion0.ani
|
||||||
|
ANIMATION|${PREFIX}/data/gfx/balloon/explosion1.ani
|
||||||
|
ANIMATION|${PREFIX}/data/gfx/balloon/explosion2.ani
|
||||||
|
ANIMATION|${PREFIX}/data/gfx/balloon/explosion3.ani
|
||||||
|
BITMAP|${PREFIX}/data/gfx/balloon/explosion0.png
|
||||||
|
BITMAP|${PREFIX}/data/gfx/balloon/explosion1.png
|
||||||
|
BITMAP|${PREFIX}/data/gfx/balloon/explosion2.png
|
||||||
|
BITMAP|${PREFIX}/data/gfx/balloon/explosion3.png
|
||||||
|
|
||||||
|
# Texturas - Power Ball
|
||||||
|
ANIMATION|${PREFIX}/data/gfx/balloon/powerball.ani
|
||||||
|
BITMAP|${PREFIX}/data/gfx/balloon/powerball.png
|
||||||
|
|
||||||
|
# Texturas - Bala
|
||||||
|
ANIMATION|${PREFIX}/data/gfx/bullet/bullet.ani
|
||||||
|
BITMAP|${PREFIX}/data/gfx/bullet/bullet.png
|
||||||
|
|
||||||
|
# Texturas - Tabe
|
||||||
|
ANIMATION|${PREFIX}/data/gfx/tabe/tabe.ani
|
||||||
|
BITMAP|${PREFIX}/data/gfx/tabe/tabe.png
|
||||||
|
|
||||||
|
# Texturas - Juego
|
||||||
|
BITMAP|${PREFIX}/data/gfx/game/game_buildings.png
|
||||||
|
BITMAP|${PREFIX}/data/gfx/game/game_clouds1.png
|
||||||
|
BITMAP|${PREFIX}/data/gfx/game/game_clouds2.png
|
||||||
|
BITMAP|${PREFIX}/data/gfx/game/game_grass.png
|
||||||
|
BITMAP|${PREFIX}/data/gfx/game/game_moon.png
|
||||||
|
BITMAP|${PREFIX}/data/gfx/game/game_power_meter.png
|
||||||
|
BITMAP|${PREFIX}/data/gfx/game/game_sky_colors.png
|
||||||
|
BITMAP|${PREFIX}/data/gfx/game/game_sun.png
|
||||||
|
|
||||||
|
# Texturas - Intro
|
||||||
|
BITMAP|${PREFIX}/data/gfx/intro/intro1.png
|
||||||
|
BITMAP|${PREFIX}/data/gfx/intro/intro2.png
|
||||||
|
BITMAP|${PREFIX}/data/gfx/intro/intro3.png
|
||||||
|
BITMAP|${PREFIX}/data/gfx/intro/intro4.png
|
||||||
|
BITMAP|${PREFIX}/data/gfx/intro/intro5.png
|
||||||
|
BITMAP|${PREFIX}/data/gfx/intro/intro6.png
|
||||||
|
|
||||||
|
# Texturas - Logo
|
||||||
|
BITMAP|${PREFIX}/data/gfx/logo/logo_jailgames_mini.png
|
||||||
|
BITMAP|${PREFIX}/data/gfx/logo/logo_jailgames.png
|
||||||
|
BITMAP|${PREFIX}/data/gfx/logo/logo_since_1998.png
|
||||||
|
|
||||||
|
# Texturas - Items
|
||||||
|
ANIMATION|${PREFIX}/data/gfx/item/item_clock.ani
|
||||||
|
ANIMATION|${PREFIX}/data/gfx/item/item_coffee_machine.ani
|
||||||
|
ANIMATION|${PREFIX}/data/gfx/item/item_coffee.ani
|
||||||
|
ANIMATION|${PREFIX}/data/gfx/item/item_debian.ani
|
||||||
|
ANIMATION|${PREFIX}/data/gfx/item/item_points1_disk.ani
|
||||||
|
ANIMATION|${PREFIX}/data/gfx/item/item_points2_gavina.ani
|
||||||
|
ANIMATION|${PREFIX}/data/gfx/item/item_points3_pacmar.ani
|
||||||
|
BITMAP|${PREFIX}/data/gfx/item/item_clock.png
|
||||||
|
BITMAP|${PREFIX}/data/gfx/item/item_coffee_machine.png
|
||||||
|
BITMAP|${PREFIX}/data/gfx/item/item_coffee.png
|
||||||
|
BITMAP|${PREFIX}/data/gfx/item/item_debian.png
|
||||||
|
BITMAP|${PREFIX}/data/gfx/item/item_points1_disk.png
|
||||||
|
BITMAP|${PREFIX}/data/gfx/item/item_points2_gavina.png
|
||||||
|
BITMAP|${PREFIX}/data/gfx/item/item_points3_pacmar.png
|
||||||
|
|
||||||
|
# Texturas - Titulo
|
||||||
|
ANIMATION|${PREFIX}/data/gfx/title/title_dust.ani
|
||||||
|
BITMAP|${PREFIX}/data/gfx/title/title_arcade_edition.png
|
||||||
|
BITMAP|${PREFIX}/data/gfx/title/title_bg_tile.png
|
||||||
|
BITMAP|${PREFIX}/data/gfx/title/title_coffee.png
|
||||||
|
BITMAP|${PREFIX}/data/gfx/title/title_crisis.png
|
||||||
|
BITMAP|${PREFIX}/data/gfx/title/title_dust.png
|
||||||
|
|
||||||
|
# Texturas - Jugador 1
|
||||||
|
BITMAP|${PREFIX}/data/gfx/player/player1_power.png
|
||||||
|
BITMAP|${PREFIX}/data/gfx/player/player1.gif
|
||||||
|
PALETTE|${PREFIX}/data/gfx/player/player1_coffee1.pal
|
||||||
|
PALETTE|${PREFIX}/data/gfx/player/player1_coffee2.pal
|
||||||
|
PALETTE|${PREFIX}/data/gfx/player/player1_invencible.pal
|
||||||
|
|
||||||
|
# Texturas - Jugador 2
|
||||||
|
BITMAP|${PREFIX}/data/gfx/player/player2_power.png
|
||||||
|
BITMAP|${PREFIX}/data/gfx/player/player2.gif
|
||||||
|
PALETTE|${PREFIX}/data/gfx/player/player2_coffee1.pal
|
||||||
|
PALETTE|${PREFIX}/data/gfx/player/player2_coffee2.pal
|
||||||
|
PALETTE|${PREFIX}/data/gfx/player/player2_invencible.pal
|
||||||
|
|
||||||
|
# Animaciones del jugador
|
||||||
|
ANIMATION|${PREFIX}/data/gfx/player/player_power.ani
|
||||||
|
ANIMATION|${PREFIX}/data/gfx/player/player.ani
|
||||||
|
|
||||||
|
# Texturas - Golpe del jugador
|
||||||
|
BITMAP|${PREFIX}/data/gfx/player/hit.png
|
||||||
|
|
||||||
|
# Fuentes de texto
|
||||||
|
BITMAP|${PREFIX}/data/font/04b_25_2x.png
|
||||||
|
BITMAP|${PREFIX}/data/font/04b_25_flat_2x.png
|
||||||
|
BITMAP|${PREFIX}/data/font/04b_25_flat.png
|
||||||
|
BITMAP|${PREFIX}/data/font/04b_25_grey.png
|
||||||
|
BITMAP|${PREFIX}/data/font/04b_25_metal.png
|
||||||
|
BITMAP|${PREFIX}/data/font/04b_25_reversed_2x.png
|
||||||
|
BITMAP|${PREFIX}/data/font/04b_25_reversed.png
|
||||||
|
BITMAP|${PREFIX}/data/font/04b_25_white.png
|
||||||
|
BITMAP|${PREFIX}/data/font/04b_25.png
|
||||||
|
BITMAP|${PREFIX}/data/font/8bithud.png
|
||||||
|
BITMAP|${PREFIX}/data/font/aseprite.png
|
||||||
|
BITMAP|${PREFIX}/data/font/smb2_grad.png
|
||||||
|
BITMAP|${PREFIX}/data/font/smb2.png
|
||||||
|
FONT|${PREFIX}/data/font/04b_25_2x.txt
|
||||||
|
FONT|${PREFIX}/data/font/04b_25.txt
|
||||||
|
FONT|${PREFIX}/data/font/8bithud.txt
|
||||||
|
FONT|${PREFIX}/data/font/aseprite.txt
|
||||||
|
FONT|${PREFIX}/data/font/smb2.txt
|
||||||
|
|
||||||
|
# Idiomas
|
||||||
|
LANG|${PREFIX}/data/lang/ba_BA.json
|
||||||
|
LANG|${PREFIX}/data/lang/en_UK.json
|
||||||
|
LANG|${PREFIX}/data/lang/es_ES.json
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# Archivo de configuración de formaciones de globos
|
# Coffee Crisis Arcade Edition - Archivo de configuración de formaciones de globos
|
||||||
# Formato por línea: x, desp, y, vel_x, tipo, tamaño, retraso_tiempo_creacion
|
# Formato por línea: x, desp, y, vel_x, tipo, tamaño, retraso_tiempo_creacion
|
||||||
# Variables disponibles:
|
# Variables disponibles:
|
||||||
# X0_0, X0_50, X0_100, X1_0, X1_100, X2_0, X2_100, X3_0, X3_100
|
# X0_0, X0_50, X0_100, X1_0, X1_100, X2_0, X2_100, X3_0, X3_100
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
03000000801000000900000000000000,8BitDo F30 Arcade Stick,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Windows,
|
03000000801000000900000000000000,8BitDo F30 Arcade Stick,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Windows,
|
||||||
03000000c82d00001038000000000000,8BitDo F30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,
|
03000000c82d00001038000000000000,8BitDo F30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,
|
||||||
03000000c82d00000090000000000000,8BitDo FC30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows,
|
03000000c82d00000090000000000000,8BitDo FC30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows,
|
||||||
05000000c82d00006a28000000000000,8BitDo GameCube,a:b0,b:b3,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,paddle1:b9,paddle2:b8,rightshoulder:b10,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b1,y:b4,platform:Windows,
|
03000000c82d00006a28000000000000,8BitDo GameCube,a:b0,b:b3,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,paddle1:b9,paddle2:b8,rightshoulder:b10,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b1,y:b4,platform:Windows,
|
||||||
03000000c82d00001251000000000000,8BitDo Lite 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows,
|
03000000c82d00001251000000000000,8BitDo Lite 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows,
|
||||||
03000000c82d00001151000000000000,8BitDo Lite SE,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows,
|
03000000c82d00001151000000000000,8BitDo Lite SE,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows,
|
||||||
03000000c82d00000150000000000000,8BitDo M30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,rightx:a3,righty:a5,start:b11,x:b4,y:b3,platform:Windows,
|
03000000c82d00000150000000000000,8BitDo M30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,rightx:a3,righty:a5,start:b11,x:b4,y:b3,platform:Windows,
|
||||||
@@ -126,6 +126,7 @@
|
|||||||
03000000020500000913000000000000,Anbernic RG P01,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a5,start:b11,x:b3,y:b4,platform:Windows,
|
03000000020500000913000000000000,Anbernic RG P01,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a5,start:b11,x:b3,y:b4,platform:Windows,
|
||||||
03000000373500000710000000000000,Anbernic RG P01,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
|
03000000373500000710000000000000,Anbernic RG P01,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
|
||||||
03000000373500004610000000000000,Anbernic RG P01,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,misc1:b15,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
|
03000000373500004610000000000000,Anbernic RG P01,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,misc1:b15,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
|
||||||
|
03000000190e00000110000000000000,Aquaplus Piece,a:b1,b:b0,back:b3,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,start:b2,platform:Windows,
|
||||||
03000000830500000160000000000000,Arcade,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b3,x:b4,y:b4,platform:Windows,
|
03000000830500000160000000000000,Arcade,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b3,x:b4,y:b4,platform:Windows,
|
||||||
03000000120c0000100e000000000000,Armor 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
|
03000000120c0000100e000000000000,Armor 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
|
||||||
03000000490b00004406000000000000,ASCII Seamic Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b2,start:b9,x:b3,y:b4,platform:Windows,
|
03000000490b00004406000000000000,ASCII Seamic Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b2,start:b9,x:b3,y:b4,platform:Windows,
|
||||||
@@ -151,13 +152,13 @@
|
|||||||
030000000d0500000208000000000000,Belkin Nostromo N40,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,rightx:a5,righty:a2,start:b9,x:b2,y:b3,platform:Windows,
|
030000000d0500000208000000000000,Belkin Nostromo N40,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,rightx:a5,righty:a2,start:b9,x:b2,y:b3,platform:Windows,
|
||||||
03000000bc2000006012000000000000,Betop 2126F,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
|
03000000bc2000006012000000000000,Betop 2126F,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
|
||||||
03000000bc2000000055000000000000,Betop BFM,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
|
03000000bc2000000055000000000000,Betop BFM,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
|
||||||
|
03000000790000000700000000000000,Betop Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b3,y:b0,platform:Windows,
|
||||||
|
03000000808300000300000000000000,Betop Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b3,y:b0,platform:Windows,
|
||||||
03000000bc2000006312000000000000,Betop Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
|
03000000bc2000006312000000000000,Betop Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
|
||||||
03000000bc2000006321000000000000,Betop Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
|
03000000bc2000006321000000000000,Betop Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
|
||||||
03000000bc2000006412000000000000,Betop Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
|
03000000bc2000006412000000000000,Betop Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
|
||||||
03000000c01100000555000000000000,Betop Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
|
03000000c01100000555000000000000,Betop Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
|
||||||
03000000c01100000655000000000000,Betop Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
|
03000000c01100000655000000000000,Betop Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
|
||||||
03000000790000000700000000000000,Betop Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b3,y:b0,platform:Windows,
|
|
||||||
03000000808300000300000000000000,Betop Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b3,y:b0,platform:Windows,
|
|
||||||
030000006f0e00006401000000000000,BF One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,rightx:a2,righty:a5,start:b7,x:b2,y:b3,platform:Windows,
|
030000006f0e00006401000000000000,BF One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,rightx:a2,righty:a5,start:b7,x:b2,y:b3,platform:Windows,
|
||||||
03000000300f00000202000000000000,Bigben,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a5,righty:a2,start:b7,x:b2,y:b3,platform:Windows,
|
03000000300f00000202000000000000,Bigben,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a5,righty:a2,start:b7,x:b2,y:b3,platform:Windows,
|
||||||
030000006b1400000209000000000000,Bigben,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
|
030000006b1400000209000000000000,Bigben,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
|
||||||
@@ -168,6 +169,7 @@
|
|||||||
03000000120c0000f10e000000000000,Brook PS2 Adapter,a:b1,b:b2,back:b13,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
|
03000000120c0000f10e000000000000,Brook PS2 Adapter,a:b1,b:b2,back:b13,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
|
||||||
03000000120c0000310c000000000000,Brook Super Converter,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Windows,
|
03000000120c0000310c000000000000,Brook Super Converter,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Windows,
|
||||||
03000000d81d00000b00000000000000,Buffalo BSGP1601 Series,a:b5,b:b3,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b9,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b13,x:b4,y:b2,platform:Windows,
|
03000000d81d00000b00000000000000,Buffalo BSGP1601 Series,a:b5,b:b3,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b9,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b13,x:b4,y:b2,platform:Windows,
|
||||||
|
030000005a1c00002400000000000000,Capcom Home Arcade Controller,a:b3,b:b4,back:b7,leftshoulder:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b6,x:b0,y:b1,platform:Windows,
|
||||||
030000005b1c00002400000000000000,Capcom Home Arcade Controller,a:b3,b:b4,back:b7,leftshoulder:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b6,x:b0,y:b1,platform:Windows,
|
030000005b1c00002400000000000000,Capcom Home Arcade Controller,a:b3,b:b4,back:b7,leftshoulder:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b6,x:b0,y:b1,platform:Windows,
|
||||||
030000005b1c00002500000000000000,Capcom Home Arcade Controller,a:b3,b:b4,back:b7,leftshoulder:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b6,x:b0,y:b1,platform:Windows,
|
030000005b1c00002500000000000000,Capcom Home Arcade Controller,a:b3,b:b4,back:b7,leftshoulder:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b6,x:b0,y:b1,platform:Windows,
|
||||||
030000006d04000042c2000000000000,ChillStream,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
|
030000006d04000042c2000000000000,ChillStream,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
|
||||||
@@ -196,6 +198,9 @@
|
|||||||
030000006e0500000a20000000000000,Elecom DUX60 MMO,a:b2,b:b3,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,leftstick:b14,lefttrigger:b12,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b15,righttrigger:b13,rightx:a3,righty:a4,start:b20,x:b0,y:b1,platform:Windows,
|
030000006e0500000a20000000000000,Elecom DUX60 MMO,a:b2,b:b3,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,leftstick:b14,lefttrigger:b12,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b15,righttrigger:b13,rightx:a3,righty:a4,start:b20,x:b0,y:b1,platform:Windows,
|
||||||
03000000b80500000410000000000000,Elecom Gamepad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b1,platform:Windows,
|
03000000b80500000410000000000000,Elecom Gamepad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b1,platform:Windows,
|
||||||
03000000b80500000610000000000000,Elecom Gamepad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b1,platform:Windows,
|
03000000b80500000610000000000000,Elecom Gamepad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b1,platform:Windows,
|
||||||
|
03000095090000010000000000000000,Elecom JC-U609,a:b0,b:b1,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,start:b8,x:b3,y:b4,platform:Windows,
|
||||||
|
0300004112000000e500000000000000,Elecom JC-U909Z,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b7,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,start:b8,x:b3,y:b4,platform:Windows,
|
||||||
|
03000041120000001050000000000000,Elecom JC-U911,a:b1,b:b2,back:b3,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,start:b0,x:b4,y:b5,platform:Windows,
|
||||||
030000006e0500000520000000000000,Elecom P301U PlayStation Controller Adapter,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b0,y:b1,platform:Windows,
|
030000006e0500000520000000000000,Elecom P301U PlayStation Controller Adapter,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b0,y:b1,platform:Windows,
|
||||||
03000000411200004450000000000000,Elecom U1012,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b0,y:b1,platform:Windows,
|
03000000411200004450000000000000,Elecom U1012,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b0,y:b1,platform:Windows,
|
||||||
030000006e0500000320000000000000,Elecom U3613M,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b0,y:b1,platform:Windows,
|
030000006e0500000320000000000000,Elecom U3613M,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b0,y:b1,platform:Windows,
|
||||||
@@ -207,6 +212,7 @@
|
|||||||
030000007d0400000640000000000000,Eliminator AfterShock,a:b1,b:b2,back:b9,dpdown:+a3,dpleft:-a5,dpright:+a5,dpup:-a3,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a4,righty:a2,start:b8,x:b0,y:b3,platform:Windows,
|
030000007d0400000640000000000000,Eliminator AfterShock,a:b1,b:b2,back:b9,dpdown:+a3,dpleft:-a5,dpright:+a5,dpup:-a3,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a4,righty:a2,start:b8,x:b0,y:b3,platform:Windows,
|
||||||
03000000120c0000f61c000000000000,Elite,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
|
03000000120c0000f61c000000000000,Elite,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
|
||||||
03000000430b00000300000000000000,EMS Production PS2 Adapter,a:b2,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows,
|
03000000430b00000300000000000000,EMS Production PS2 Adapter,a:b2,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows,
|
||||||
|
03000000062000001801000000000000,EMS TrioLinker Plus II,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b2,y:b3,platform:Windows,
|
||||||
03000000242f000000b7000000000000,ESM 9110,a:b0,b:b1,back:b7,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Windows,
|
03000000242f000000b7000000000000,ESM 9110,a:b0,b:b1,back:b7,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Windows,
|
||||||
03000000101c0000181c000000000000,Essential,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b4,leftx:a1,lefty:a0,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows,
|
03000000101c0000181c000000000000,Essential,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b4,leftx:a1,lefty:a0,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows,
|
||||||
030000008f0e00000f31000000000000,EXEQ,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Windows,
|
030000008f0e00000f31000000000000,EXEQ,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Windows,
|
||||||
@@ -240,7 +246,8 @@
|
|||||||
03000000ac0500005b05000000000000,GameSir G3w,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
|
03000000ac0500005b05000000000000,GameSir G3w,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
|
||||||
03000000ac0500002d02000000000000,GameSir G4,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Windows,
|
03000000ac0500002d02000000000000,GameSir G4,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Windows,
|
||||||
03000000ac0500004d04000000000000,GameSir G4,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
|
03000000ac0500004d04000000000000,GameSir G4,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
|
||||||
03000000ac0500001a06000000000000,GameSir-T3 2.02,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
|
03000000ac0500001a06000000000000,GameSir T3 2.02,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
|
||||||
|
03000000373500009410000000000000,GameSir Tegenaria Lite,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
|
||||||
030000004c0e00001035000000000000,Gamester,a:b0,b:b1,back:b7,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b11,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:Windows,
|
030000004c0e00001035000000000000,Gamester,a:b0,b:b1,back:b7,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b11,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:Windows,
|
||||||
030000000d0f00001110000000000000,GameStick Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Windows,
|
030000000d0f00001110000000000000,GameStick Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Windows,
|
||||||
0300000047530000616d000000000000,GameStop,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,
|
0300000047530000616d000000000000,GameStop,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,
|
||||||
@@ -269,6 +276,8 @@
|
|||||||
030000008f0e00000610000000000000,GreenAsia,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a5,righty:a2,start:b11,x:b3,y:b0,platform:Windows,
|
030000008f0e00000610000000000000,GreenAsia,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a5,righty:a2,start:b11,x:b3,y:b0,platform:Windows,
|
||||||
03000000ac0500006b05000000000000,GT2a,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Windows,
|
03000000ac0500006b05000000000000,GT2a,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Windows,
|
||||||
03000000341a00000302000000000000,Hama Scorpad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
|
03000000341a00000302000000000000,Hama Scorpad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
|
||||||
|
030000008a2e0000dd10000000000000,Hand Held Legend GC Ultimate,a:b0,b:b2,back:b17,dpdown:b5,dpleft:b6,dpright:b7,dpup:b4,guide:b18,leftshoulder:b10,leftstick:b8,lefttrigger:a3,leftx:a0,lefty:a1,misc1:b19,misc2:b24,paddle1:b13,paddle2:b12,rightshoulder:b11,rightstick:b9,righttrigger:a4,rightx:a2,righty:a5,start:b16,x:b1,y:b3,platform:Windows,
|
||||||
|
030000008a2e0000df10000000000000,Hand Held Legend ProGCC,a:b1,b:b0,back:b17,dpdown:b5,dpleft:b6,dpright:b7,dpup:b4,guide:b18,leftshoulder:b10,leftstick:b8,lefttrigger:a3,leftx:a0,lefty:a1,misc1:b19,paddle1:b13,paddle2:b12,rightshoulder:b11,rightstick:b9,righttrigger:a4,rightx:a2,righty:a5,start:b16,x:b3,y:b2,platform:Windows,
|
||||||
030000000d0f00004900000000000000,Hatsune Miku Sho PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
|
030000000d0f00004900000000000000,Hatsune Miku Sho PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
|
||||||
030000001008000001e1000000000000,Havit HV G60,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b3,y:b0,platform:Windows,
|
030000001008000001e1000000000000,Havit HV G60,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b3,y:b0,platform:Windows,
|
||||||
030000000d0f00000c00000000000000,HEXT,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b11,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
|
030000000d0f00000c00000000000000,HEXT,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b11,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
|
||||||
@@ -338,6 +347,7 @@
|
|||||||
030000000d0f0000ee00000000000000,Horipad Mini 4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
|
030000000d0f0000ee00000000000000,Horipad Mini 4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
|
||||||
030000000d0f0000c100000000000000,Horipad Nintendo Switch Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
|
030000000d0f0000c100000000000000,Horipad Nintendo Switch Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
|
||||||
030000000d0f0000f600000000000000,Horipad Nintendo Switch Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,
|
030000000d0f0000f600000000000000,Horipad Nintendo Switch Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,
|
||||||
|
030000000d0f00000202000000000000,Horipad O Nintendo Switch 2 Controller,a:b1,b:b0,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,misc1:b13,misc2:b14,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Windows,
|
||||||
030000000d0f00006700000000000000,Horipad One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
|
030000000d0f00006700000000000000,Horipad One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
|
||||||
030000000d0f00009601000000000000,Horipad Steam,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,misc2:b2,paddle1:b5,paddle2:b15,paddle3:b18,paddle4:b19,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
|
030000000d0f00009601000000000000,Horipad Steam,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,misc2:b2,paddle1:b5,paddle2:b15,paddle3:b18,paddle4:b19,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
|
||||||
030000000d0f0000dc00000000000000,Horipad Switch,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
|
030000000d0f0000dc00000000000000,Horipad Switch,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
|
||||||
@@ -346,7 +356,9 @@
|
|||||||
03000000790000004e95000000000000,Hyperkin N64 Controller Adapter,a:b1,b:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b7,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b5,rightx:a5,righty:a2,start:b9,platform:Windows,
|
03000000790000004e95000000000000,Hyperkin N64 Controller Adapter,a:b1,b:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b7,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b5,rightx:a5,righty:a2,start:b9,platform:Windows,
|
||||||
03000000242e00006a48000000000000,Hyperkin RetroN Sq,a:b3,b:b7,back:b5,dpdown:+a4,dpleft:-a0,dpright:+a0,dpup:-a4,leftshoulder:b0,rightshoulder:b1,start:b4,x:b2,y:b6,platform:Windows,
|
03000000242e00006a48000000000000,Hyperkin RetroN Sq,a:b3,b:b7,back:b5,dpdown:+a4,dpleft:-a0,dpright:+a0,dpup:-a4,leftshoulder:b0,rightshoulder:b1,start:b4,x:b2,y:b6,platform:Windows,
|
||||||
03000000242f00000a20000000000000,Hyperkin Scout,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Windows,
|
03000000242f00000a20000000000000,Hyperkin Scout,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Windows,
|
||||||
|
03000000242e00000a20000000000000,Hyperkin Scout Premium SNES Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Windows,
|
||||||
03000000242e00006a38000000000000,Hyperkin Trooper 2,a:b0,b:b1,back:b4,leftshoulder:b2,leftx:a0,lefty:a1,rightshoulder:b3,start:b5,platform:Windows,
|
03000000242e00006a38000000000000,Hyperkin Trooper 2,a:b0,b:b1,back:b4,leftshoulder:b2,leftx:a0,lefty:a1,rightshoulder:b3,start:b5,platform:Windows,
|
||||||
|
03000000f00300008d04000000000000,HyperX Clutch,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:-a2,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:+a5,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
|
||||||
03000000d81d00000e00000000000000,iBuffalo AC02 Arcade Joystick,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b11,righttrigger:b3,rightx:a2,righty:a5,start:b8,x:b4,y:b5,platform:Windows,
|
03000000d81d00000e00000000000000,iBuffalo AC02 Arcade Joystick,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b11,righttrigger:b3,rightx:a2,righty:a5,start:b8,x:b4,y:b5,platform:Windows,
|
||||||
03000000d81d00000f00000000000000,iBuffalo BSGP1204 Series,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
|
03000000d81d00000f00000000000000,iBuffalo BSGP1204 Series,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
|
||||||
03000000d81d00001000000000000000,iBuffalo BSGP1204P Series,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
|
03000000d81d00001000000000000000,iBuffalo BSGP1204P Series,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
|
||||||
@@ -428,7 +440,7 @@
|
|||||||
03000000242f00007300000000000000,Mayflash Magic NS,a:b1,b:b4,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b0,y:b3,platform:Windows,
|
03000000242f00007300000000000000,Mayflash Magic NS,a:b1,b:b4,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b0,y:b3,platform:Windows,
|
||||||
0300000079000000d218000000000000,Mayflash Magic NS,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
|
0300000079000000d218000000000000,Mayflash Magic NS,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
|
||||||
03000000d620000010a7000000000000,Mayflash Magic NS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
|
03000000d620000010a7000000000000,Mayflash Magic NS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
|
||||||
03000000242e0000f500000000000000,Mayflash N64 Adapter,a:b2,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightx:a2,righty:a5,start:b9,platform:Windows,
|
03000000242f0000f500000000000000,Mayflash N64 Adapter,a:b2,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightx:a2,righty:a5,start:b9,platform:Windows,
|
||||||
03000000242f0000f400000000000000,Mayflash N64 Controller Adapter,a:b1,b:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightx:a2,righty:a5,start:b9,platform:Windows,
|
03000000242f0000f400000000000000,Mayflash N64 Controller Adapter,a:b1,b:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightx:a2,righty:a5,start:b9,platform:Windows,
|
||||||
03000000790000007918000000000000,Mayflash N64 Controller Adapter,a:b1,b:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b9,leftx:a0,lefty:a1,righttrigger:b7,rightx:a3,righty:a2,start:b8,platform:Windows,
|
03000000790000007918000000000000,Mayflash N64 Controller Adapter,a:b1,b:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b9,leftx:a0,lefty:a1,righttrigger:b7,rightx:a3,righty:a2,start:b8,platform:Windows,
|
||||||
030000008f0e00001030000000000000,Mayflash Saturn Adapter,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,lefttrigger:b7,rightshoulder:b6,righttrigger:b2,start:b9,x:b3,y:b4,platform:Windows,
|
030000008f0e00001030000000000000,Mayflash Saturn Adapter,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,lefttrigger:b7,rightshoulder:b6,righttrigger:b2,start:b9,x:b3,y:b4,platform:Windows,
|
||||||
@@ -477,8 +489,10 @@
|
|||||||
030000001008000001e5000000000000,NEXT SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,righttrigger:b6,start:b9,x:b3,y:b0,platform:Windows,
|
030000001008000001e5000000000000,NEXT SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,righttrigger:b6,start:b9,x:b3,y:b0,platform:Windows,
|
||||||
03000000050b00000045000000000000,Nexus,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b10,x:b2,y:b3,platform:Windows,
|
03000000050b00000045000000000000,Nexus,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b10,x:b2,y:b3,platform:Windows,
|
||||||
03000000152000000182000000000000,NGDS,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b3,y:b0,platform:Windows,
|
03000000152000000182000000000000,NGDS,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b3,y:b0,platform:Windows,
|
||||||
|
030000007e0500006920000000000000,Nintendo Switch 2 Pro Controller,a:b0,b:b1,back:b14,dpdown:b8,dpleft:b10,dpright:b9,dpup:b11,guide:b16,leftshoulder:b12,leftstick:b15,lefttrigger:b13,leftx:a0,lefty:a1~,misc1:b17,misc2:b20,paddle1:b18,paddle2:b19,rightshoulder:b4,rightstick:b7,righttrigger:b5,rightx:a2,righty:a3~,start:b6,x:b2,y:b3,platform:Windows,
|
||||||
030000007e0500000920000000000000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,
|
030000007e0500000920000000000000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,
|
||||||
030000000d0500000308000000000000,Nostromo N45,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b12,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b10,x:b2,y:b3,platform:Windows,
|
030000000d0500000308000000000000,Nostromo N45,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b12,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b10,x:b2,y:b3,platform:Windows,
|
||||||
|
030000007e0500007320000000000000,NSO GameCube Controller,a:b1,b:b3,dpdown:b8,dpleft:b10,dpright:b9,dpup:b11,guide:b16,leftshoulder:b13,lefttrigger:b12,leftx:a0,lefty:a1~,rightshoulder:b5,righttrigger:b4,rightx:a2,righty:a3~,start:b6,x:b0,y:b2,platform:Windows,
|
||||||
030000007e0500001920000000000000,NSO N64 Controller,+rightx:b8,+righty:b2,-rightx:b3,-righty:b7,a:b1,b:b0,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,righttrigger:b10,start:b9,platform:Windows,
|
030000007e0500001920000000000000,NSO N64 Controller,+rightx:b8,+righty:b2,-rightx:b3,-righty:b7,a:b1,b:b0,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,righttrigger:b10,start:b9,platform:Windows,
|
||||||
030000007e0500001720000000000000,NSO SNES Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b15,start:b9,x:b2,y:b3,platform:Windows,
|
030000007e0500001720000000000000,NSO SNES Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b15,start:b9,x:b2,y:b3,platform:Windows,
|
||||||
03000000550900001472000000000000,NVIDIA Controller,a:b11,b:b10,back:b13,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b7,leftstick:b5,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b4,righttrigger:a5,rightx:a3,righty:a6,start:b3,x:b9,y:b8,platform:Windows,
|
03000000550900001472000000000000,NVIDIA Controller,a:b11,b:b10,back:b13,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b7,leftstick:b5,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b4,righttrigger:a5,rightx:a3,righty:a6,start:b3,x:b9,y:b8,platform:Windows,
|
||||||
@@ -494,7 +508,7 @@
|
|||||||
030000008916000000fd000000000000,Onza TE,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
|
030000008916000000fd000000000000,Onza TE,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
|
||||||
03000000d62000006d57000000000000,OPP PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
|
03000000d62000006d57000000000000,OPP PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
|
||||||
030000006b14000001a1000000000000,Orange Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b2,y:b3,platform:Windows,
|
030000006b14000001a1000000000000,Orange Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b2,y:b3,platform:Windows,
|
||||||
0300000009120000072f000000000000,OrangeFox86 DreamPicoPort,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:-a2,leftx:a0,lefty:a1,righttrigger:-a5,start:b11,x:b3,y:b4,platform:Windows,
|
0300000009120000072f000000000000,OrangeFox86 DreamPicoPort,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:-a2,leftx:a0,lefty:a1,righttrigger:-a5,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
|
||||||
03000000362800000100000000000000,OUYA Controller,a:b0,b:b3,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b14,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,x:b1,y:b2,platform:Windows,
|
03000000362800000100000000000000,OUYA Controller,a:b0,b:b3,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b14,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,x:b1,y:b2,platform:Windows,
|
||||||
03000000120c0000f60e000000000000,P4 Gamepad,a:b1,b:b2,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b5,lefttrigger:b7,rightshoulder:b4,righttrigger:b6,start:b9,x:b0,y:b3,platform:Windows,
|
03000000120c0000f60e000000000000,P4 Gamepad,a:b1,b:b2,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b5,lefttrigger:b7,rightshoulder:b4,righttrigger:b6,start:b9,x:b0,y:b3,platform:Windows,
|
||||||
03000000790000002201000000000000,PC Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
|
03000000790000002201000000000000,PC Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
|
||||||
@@ -590,8 +604,10 @@
|
|||||||
030000009b2800003200000000000000,Raphnet GC and N64 Adapter,a:b0,b:b7,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,lefttrigger:+a5,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:+a2,rightx:a3,righty:a4,start:b3,x:b1,y:b8,platform:Windows,
|
030000009b2800003200000000000000,Raphnet GC and N64 Adapter,a:b0,b:b7,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,lefttrigger:+a5,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:+a2,rightx:a3,righty:a4,start:b3,x:b1,y:b8,platform:Windows,
|
||||||
030000009b2800006000000000000000,Raphnet GC and N64 Adapter,a:b0,b:b7,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,lefttrigger:+a5,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:+a2,rightx:a3,righty:a4,start:b3,x:b1,y:b8,platform:Windows,
|
030000009b2800006000000000000000,Raphnet GC and N64 Adapter,a:b0,b:b7,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,lefttrigger:+a5,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:+a2,rightx:a3,righty:a4,start:b3,x:b1,y:b8,platform:Windows,
|
||||||
030000009b2800001800000000000000,Raphnet Jaguar Adapter,a:b2,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b0,righttrigger:b10,start:b3,x:b11,y:b12,platform:Windows,
|
030000009b2800001800000000000000,Raphnet Jaguar Adapter,a:b2,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b0,righttrigger:b10,start:b3,x:b11,y:b12,platform:Windows,
|
||||||
|
030000009b2800003c00000000000000,Raphnet N64 Adapter,+rightx:b9,+righty:b7,-rightx:b8,-righty:b6,a:b0,b:b1,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,leftshoulder:b4,lefttrigger:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b3,platform:Windows,
|
||||||
030000009b2800006100000000000000,Raphnet N64 Adapter,+rightx:b9,+righty:b7,-rightx:b8,-righty:b6,a:b0,b:b1,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,leftshoulder:b4,lefttrigger:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b3,platform:Windows,
|
030000009b2800006100000000000000,Raphnet N64 Adapter,+rightx:b9,+righty:b7,-rightx:b8,-righty:b6,a:b0,b:b1,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,leftshoulder:b4,lefttrigger:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b3,platform:Windows,
|
||||||
030000009b2800006300000000000000,Raphnet N64 Adapter,+rightx:b9,+righty:b7,-rightx:b8,-righty:b6,a:b0,b:b1,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,leftshoulder:b4,lefttrigger:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b3,platform:Windows,
|
030000009b2800006300000000000000,Raphnet N64 Adapter,+rightx:b9,+righty:b7,-rightx:b8,-righty:b6,a:b0,b:b1,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,leftshoulder:b4,lefttrigger:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b3,platform:Windows,
|
||||||
|
030000009b2800006400000000000000,Raphnet N64 Adapter,+rightx:b9,+righty:b7,-rightx:b8,-righty:b6,a:b0,b:b1,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,leftshoulder:b4,lefttrigger:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b3,platform:Windows,
|
||||||
030000009b2800000200000000000000,Raphnet NES Adapter,a:b7,b:b6,back:b5,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftx:a0,lefty:a1,start:b4,platform:Windows,
|
030000009b2800000200000000000000,Raphnet NES Adapter,a:b7,b:b6,back:b5,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftx:a0,lefty:a1,start:b4,platform:Windows,
|
||||||
030000009b2800004400000000000000,Raphnet PS1 and PS2 Adapter,a:b1,b:b2,back:b5,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,leftshoulder:b6,leftstick:b10,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b9,rightx:a3,righty:a4,start:b4,x:b0,y:b3,platform:Windows,
|
030000009b2800004400000000000000,Raphnet PS1 and PS2 Adapter,a:b1,b:b2,back:b5,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,leftshoulder:b6,leftstick:b10,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b9,rightx:a3,righty:a4,start:b4,x:b0,y:b3,platform:Windows,
|
||||||
030000009b2800004300000000000000,Raphnet Saturn,a:b0,b:b1,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b2,start:b8,x:b3,y:b4,platform:Windows,
|
030000009b2800004300000000000000,Raphnet Saturn,a:b0,b:b1,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b2,start:b8,x:b3,y:b4,platform:Windows,
|
||||||
@@ -624,6 +640,7 @@
|
|||||||
03000000921200004547000000000000,Retro Bit Sega Genesis Controller Adapter,a:b0,b:b1,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,lefttrigger:b7,rightshoulder:b5,righttrigger:b2,start:b6,x:b3,y:b4,platform:Windows,
|
03000000921200004547000000000000,Retro Bit Sega Genesis Controller Adapter,a:b0,b:b1,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,lefttrigger:b7,rightshoulder:b5,righttrigger:b2,start:b6,x:b3,y:b4,platform:Windows,
|
||||||
03000000790000001100000000000000,Retro Controller,a:b1,b:b2,back:b8,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-a4,leftshoulder:b6,lefttrigger:b7,rightshoulder:b4,righttrigger:b5,start:b9,x:b0,y:b3,platform:Windows,
|
03000000790000001100000000000000,Retro Controller,a:b1,b:b2,back:b8,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-a4,leftshoulder:b6,lefttrigger:b7,rightshoulder:b4,righttrigger:b5,start:b9,x:b0,y:b3,platform:Windows,
|
||||||
03000000830500006020000000000000,Retro Controller,a:b0,b:b1,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,lefttrigger:b5,rightshoulder:b8,righttrigger:b9,start:b7,x:b2,y:b3,platform:Windows,
|
03000000830500006020000000000000,Retro Controller,a:b0,b:b1,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,lefttrigger:b5,rightshoulder:b8,righttrigger:b9,start:b7,x:b2,y:b3,platform:Windows,
|
||||||
|
03000000632500007805000000000000,Retro Fighters Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
|
||||||
0300000003040000c197000000000000,Retrode Adapter,a:b0,b:b4,back:b2,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b3,x:b1,y:b5,platform:Windows,
|
0300000003040000c197000000000000,Retrode Adapter,a:b0,b:b4,back:b2,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b3,x:b1,y:b5,platform:Windows,
|
||||||
03000000bd12000013d0000000000000,Retrolink Sega Saturn Classic Controller,a:b0,b:b1,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b5,lefttrigger:b6,rightshoulder:b2,righttrigger:b7,start:b8,x:b3,y:b4,platform:Windows,
|
03000000bd12000013d0000000000000,Retrolink Sega Saturn Classic Controller,a:b0,b:b1,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b5,lefttrigger:b6,rightshoulder:b2,righttrigger:b7,start:b8,x:b3,y:b4,platform:Windows,
|
||||||
03000000bd12000015d0000000000000,Retrolink SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Windows,
|
03000000bd12000015d0000000000000,Retrolink SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Windows,
|
||||||
@@ -641,6 +658,7 @@
|
|||||||
030000006f0e00001e01000000000000,Rock Candy PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
|
030000006f0e00001e01000000000000,Rock Candy PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
|
||||||
030000006f0e00002801000000000000,Rock Candy PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
|
030000006f0e00002801000000000000,Rock Candy PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
|
||||||
030000006f0e00002f01000000000000,Rock Candy PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
|
030000006f0e00002f01000000000000,Rock Candy PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
|
||||||
|
03000000830500007030000000000000,Rockfire Space Ranger,a:b0,b:b1,back:b5,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,lefttrigger:b7,rightshoulder:b9,righttrigger:b8,start:b2,x:b3,y:b4,platform:Windows,
|
||||||
03000000050b0000e318000000000000,ROG Chakram,a:b1,b:b0,leftx:a0,lefty:a1,x:b2,y:b3,platform:Windows,
|
03000000050b0000e318000000000000,ROG Chakram,a:b1,b:b0,leftx:a0,lefty:a1,x:b2,y:b3,platform:Windows,
|
||||||
03000000050b0000e518000000000000,ROG Chakram,a:b1,b:b0,leftx:a0,lefty:a1,x:b2,y:b3,platform:Windows,
|
03000000050b0000e518000000000000,ROG Chakram,a:b1,b:b0,leftx:a0,lefty:a1,x:b2,y:b3,platform:Windows,
|
||||||
03000000050b00005819000000000000,ROG Chakram Core,a:b1,b:b0,leftx:a0,lefty:a1,x:b2,y:b3,platform:Windows,
|
03000000050b00005819000000000000,ROG Chakram Core,a:b1,b:b0,leftx:a0,lefty:a1,x:b2,y:b3,platform:Windows,
|
||||||
@@ -697,6 +715,7 @@
|
|||||||
03000000317300000100000000000000,Sony DualShock 3,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Windows,
|
03000000317300000100000000000000,Sony DualShock 3,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Windows,
|
||||||
03000000666600006706000000000000,Sony PlayStation Adapter,a:b2,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a2,righty:a3,start:b11,x:b3,y:b0,platform:Windows,
|
03000000666600006706000000000000,Sony PlayStation Adapter,a:b2,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a2,righty:a3,start:b11,x:b3,y:b0,platform:Windows,
|
||||||
03000000e30500009605000000000000,Sony PlayStation Adapter,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Windows,
|
03000000e30500009605000000000000,Sony PlayStation Adapter,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Windows,
|
||||||
|
03000000fe1400002a23000000000000,Sony PlayStation Adapter,a:b0,b:b1,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,x:b2,y:b3,platform:Windows,
|
||||||
030000004c050000da0c000000000000,Sony PlayStation Classic Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,lefttrigger:b4,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Windows,
|
030000004c050000da0c000000000000,Sony PlayStation Classic Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,lefttrigger:b4,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Windows,
|
||||||
03000000632500002306000000000000,Sony PlayStation Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Windows,
|
03000000632500002306000000000000,Sony PlayStation Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Windows,
|
||||||
03000000f0250000c183000000000000,Sony PlayStation Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
|
03000000f0250000c183000000000000,Sony PlayStation Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
|
||||||
@@ -771,8 +790,8 @@
|
|||||||
03000000ff1100004133000000000000,USB Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a4,righty:a2,start:b9,x:b3,y:b0,platform:Windows,
|
03000000ff1100004133000000000000,USB Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a4,righty:a2,start:b9,x:b3,y:b0,platform:Windows,
|
||||||
03000000632500002305000000000000,USB Vibration Joystick,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
|
03000000632500002305000000000000,USB Vibration Joystick,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
|
||||||
03000000882800000305000000000000,V5 Game Pad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,x:b2,y:b3,platform:Windows,
|
03000000882800000305000000000000,V5 Game Pad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,x:b2,y:b3,platform:Windows,
|
||||||
03000000790000001a18000000000000,Venom,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
|
03000000790000001a18000000000000,Venom PS4 Arcade Joystick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
|
||||||
03000000790000001b18000000000000,Venom Arcade Joystick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,
|
03000000790000001b18000000000000,Venom PS4 Arcade Joystick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
|
||||||
030000006f0e00000302000000000000,Victrix PS4 Pro Fightstick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,touchpad:b13,x:b0,y:b3,platform:Windows,
|
030000006f0e00000302000000000000,Victrix PS4 Pro Fightstick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,touchpad:b13,x:b0,y:b3,platform:Windows,
|
||||||
030000006f0e00000702000000000000,Victrix PS4 Pro Fightstick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,touchpad:b13,x:b0,y:b3,platform:Windows,
|
030000006f0e00000702000000000000,Victrix PS4 Pro Fightstick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,touchpad:b13,x:b0,y:b3,platform:Windows,
|
||||||
0300000034120000adbe000000000000,vJoy Device,a:b0,b:b1,back:b15,dpdown:b6,dpleft:b7,dpright:b8,dpup:b5,guide:b16,leftshoulder:b9,leftstick:b13,lefttrigger:b11,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b14,righttrigger:b12,rightx:a3,righty:a4,start:b4,x:b2,y:b3,platform:Windows,
|
0300000034120000adbe000000000000,vJoy Device,a:b0,b:b1,back:b15,dpdown:b6,dpleft:b7,dpright:b8,dpup:b5,guide:b16,leftshoulder:b9,leftstick:b13,lefttrigger:b11,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b14,righttrigger:b12,rightx:a3,righty:a4,start:b4,x:b2,y:b3,platform:Windows,
|
||||||
@@ -817,7 +836,7 @@
|
|||||||
030000005e040000e302000000000000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
|
030000005e040000e302000000000000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
|
||||||
030000005e040000ea02000000000000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
|
030000005e040000ea02000000000000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
|
||||||
030000005e040000fd02000000000000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
|
030000005e040000fd02000000000000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
|
||||||
030000005e040000ff02000000000000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
|
030000005e040000ff02000000000000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
|
||||||
030000006f0e0000a802000000000000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
|
030000006f0e0000a802000000000000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
|
||||||
030000006f0e0000c802000000000000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
|
030000006f0e0000c802000000000000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
|
||||||
03000000c62400003a54000000000000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
|
03000000c62400003a54000000000000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
|
||||||
@@ -891,8 +910,8 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
03000000c82d00001630000001000000,8BitDo Ultimate C,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
|
03000000c82d00001630000001000000,8BitDo Ultimate C,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
|
||||||
03000000c82d00001730000001000000,8BitDo Ultimate C,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
|
03000000c82d00001730000001000000,8BitDo Ultimate C,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
|
||||||
03000000c82d00001130000000020000,8BitDo Ultimate Wired,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b26,paddle1:b24,paddle2:b25,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
|
03000000c82d00001130000000020000,8BitDo Ultimate Wired,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b26,paddle1:b24,paddle2:b25,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
|
||||||
|
03000000c82d00001330000000020000,8BitDo Ultimate Wireless,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b26,paddle1:b23,paddle2:b19,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
|
||||||
03000000c82d00001330000001000000,8BitDo Ultimate Wireless,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b26,paddle1:b23,paddle2:b19,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
|
03000000c82d00001330000001000000,8BitDo Ultimate Wireless,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b26,paddle1:b23,paddle2:b19,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
|
||||||
03000000c82d00001330000000020000,8BitDo Ultimate Wireless Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b26,paddle1:b23,paddle2:b19,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
|
|
||||||
03000000a00500003232000008010000,8BitDo Zero,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Mac OS X,
|
03000000a00500003232000008010000,8BitDo Zero,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Mac OS X,
|
||||||
03000000a00500003232000009010000,8BitDo Zero,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Mac OS X,
|
03000000a00500003232000009010000,8BitDo Zero,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Mac OS X,
|
||||||
03000000c82d00001890000001000000,8BitDo Zero 2,a:b1,b:b0,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Mac OS X,
|
03000000c82d00001890000001000000,8BitDo Zero 2,a:b1,b:b0,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Mac OS X,
|
||||||
@@ -930,7 +949,8 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
03000000b40400001124000001040000,Flydigi Vader 2,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b12,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b14,paddle1:b2,paddle2:b5,paddle3:b16,paddle4:b17,rightshoulder:b7,rightstick:b13,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
|
03000000b40400001124000001040000,Flydigi Vader 2,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b12,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b14,paddle1:b2,paddle2:b5,paddle3:b16,paddle4:b17,rightshoulder:b7,rightstick:b13,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
|
||||||
03000000b40400001224000003030000,Flydigi Vader 2,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b12,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b2,paddle1:b16,paddle2:b17,paddle3:b14,paddle4:b15,rightshoulder:b7,rightstick:b13,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
|
03000000b40400001224000003030000,Flydigi Vader 2,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b12,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b2,paddle1:b16,paddle2:b17,paddle3:b14,paddle4:b15,rightshoulder:b7,rightstick:b13,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
|
||||||
03000000790000004618000000010000,GameCube Controller Adapter,a:b4,b:b0,dpdown:b56,dpleft:b60,dpright:b52,dpup:b48,lefttrigger:a12,leftx:a0,lefty:a4,rightshoulder:b28,righttrigger:a16,rightx:a20,righty:a8,start:b36,x:b8,y:b12,platform:Mac OS X,
|
03000000790000004618000000010000,GameCube Controller Adapter,a:b4,b:b0,dpdown:b56,dpleft:b60,dpright:b52,dpup:b48,lefttrigger:a12,leftx:a0,lefty:a4,rightshoulder:b28,righttrigger:a16,rightx:a20,righty:a8,start:b36,x:b8,y:b12,platform:Mac OS X,
|
||||||
03000000ac0500001a06000002020000,GameSir-T3 2.02,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
|
03000000ac0500001a06000002020000,GameSir T3 2.02,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
|
||||||
|
03000000373500000411000023000000,GameSir X4A Xbox Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
|
||||||
03000000ad1b000001f9000000000000,Gamestop BB070 X360 Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
|
03000000ad1b000001f9000000000000,Gamestop BB070 X360 Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
|
||||||
0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X,
|
0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X,
|
||||||
03000000c01100000140000000010000,GameStop PS4 Fun Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,touchpad:b13,x:b0,y:b3,platform:Mac OS X,
|
03000000c01100000140000000010000,GameStop PS4 Fun Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,touchpad:b13,x:b0,y:b3,platform:Mac OS X,
|
||||||
@@ -1003,17 +1023,21 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
03000000d62000007162000001000000,Moga Pro 2,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Mac OS X,
|
03000000d62000007162000001000000,Moga Pro 2,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Mac OS X,
|
||||||
03000000c62400002a89000000010000,MOGA XP5A Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b21,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
|
03000000c62400002a89000000010000,MOGA XP5A Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b21,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
|
||||||
03000000c62400002b89000000010000,MOGA XP5A Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
|
03000000c62400002b89000000010000,MOGA XP5A Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
|
||||||
|
03000000853200008906000000010000,Nacon Revolution X Unlimited,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
|
||||||
03000000632500007505000000020000,NeoGeo mini PAD Controller,a:b1,b:b0,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,start:b9,x:b2,y:b3,platform:Mac OS X,
|
03000000632500007505000000020000,NeoGeo mini PAD Controller,a:b1,b:b0,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,start:b9,x:b2,y:b3,platform:Mac OS X,
|
||||||
03000000921200004b46000003020000,NES 2-port Adapter,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,start:b11,platform:Mac OS X,
|
03000000921200004b46000003020000,NES 2-port Adapter,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,start:b11,platform:Mac OS X,
|
||||||
030000001008000001e5000006010000,NEXT SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,righttrigger:b6,start:b9,x:b3,y:b0,platform:Mac OS X,
|
030000001008000001e5000006010000,NEXT SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,righttrigger:b6,start:b9,x:b3,y:b0,platform:Mac OS X,
|
||||||
|
030000007e0500006920000001010000,Nintendo Switch 2 Pro Controller,a:b0,b:b1,back:b14,dpdown:b8,dpleft:b10,dpright:b9,dpup:b11,guide:b16,leftshoulder:b12,leftstick:b15,lefttrigger:b13,leftx:a0,lefty:a1~,misc1:b17,misc2:b20,paddle1:b18,paddle2:b19,rightshoulder:b4,rightstick:b7,righttrigger:b5,rightx:a2,righty:a3~,start:b6,x:b2,y:b3,platform:Mac OS X,
|
||||||
030000007e0500000920000000000000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X,
|
030000007e0500000920000000000000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X,
|
||||||
030000007e0500000920000001000000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X,
|
030000007e0500000920000001000000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X,
|
||||||
030000007e0500000920000010020000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,platform:Mac OS X,
|
030000007e0500000920000010020000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,platform:Mac OS X,
|
||||||
050000007e05000009200000ff070000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,platform:Mac OS X,
|
050000007e05000009200000ff070000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,platform:Mac OS X,
|
||||||
|
030000007e0500007320000001010000,NSO GameCube Controller,a:b1,b:b3,dpdown:b8,dpleft:b10,dpright:b9,dpup:b11,guide:b16,leftshoulder:b13,lefttrigger:b12,leftx:a0,lefty:a1~,rightshoulder:b5,righttrigger:b4,rightx:a2,righty:a3~,start:b6,x:b0,y:b2,platform:Mac OS X,
|
||||||
030000007e0500001920000001000000,NSO N64 Controller,+rightx:b8,+righty:b7,-rightx:b3,-righty:b2,a:b1,b:b0,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,righttrigger:b10,start:b9,platform:Mac OS X,
|
030000007e0500001920000001000000,NSO N64 Controller,+rightx:b8,+righty:b7,-rightx:b3,-righty:b2,a:b1,b:b0,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,righttrigger:b10,start:b9,platform:Mac OS X,
|
||||||
030000007e0500001720000001000000,NSO SNES Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b15,start:b9,x:b2,y:b3,platform:Mac OS X,
|
030000007e0500001720000001000000,NSO SNES Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b15,start:b9,x:b2,y:b3,platform:Mac OS X,
|
||||||
03000000550900001472000025050000,NVIDIA Controller,a:b0,b:b1,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b4,leftstick:b7,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a5,start:b6,x:b2,y:b3,platform:Mac OS X,
|
03000000550900001472000025050000,NVIDIA Controller,a:b0,b:b1,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b4,leftstick:b7,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a5,start:b6,x:b2,y:b3,platform:Mac OS X,
|
||||||
030000004b120000014d000000010000,Nyko Airflo EX,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Mac OS X,
|
030000004b120000014d000000010000,Nyko Airflo EX,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Mac OS X,
|
||||||
|
0300000009120000072f000000010000,OrangeFox86 DreamPicoPort,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a2,leftx:a0,lefty:a1,righttrigger:a5,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Mac OS X,
|
||||||
030000006f0e00000901000002010000,PDP PS3 Versus Fighting,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X,
|
030000006f0e00000901000002010000,PDP PS3 Versus Fighting,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X,
|
||||||
030000008f0e00000300000000000000,Piranha Xtreme PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Mac OS X,
|
030000008f0e00000300000000000000,Piranha Xtreme PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Mac OS X,
|
||||||
03000000d620000011a7000000020000,PowerA Core Plus Gamecube Controller,a:b1,b:b0,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X,
|
03000000d620000011a7000000020000,PowerA Core Plus Gamecube Controller,a:b1,b:b0,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X,
|
||||||
@@ -1047,6 +1071,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
030000003215000000090000163a0000,Razer Serval,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Mac OS X,
|
030000003215000000090000163a0000,Razer Serval,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Mac OS X,
|
||||||
0300000032150000030a000000000000,Razer Wildcat,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
|
0300000032150000030a000000000000,Razer Wildcat,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
|
||||||
03000000632500008005000000010000,Redgear,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Mac OS X,
|
03000000632500008005000000010000,Redgear,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Mac OS X,
|
||||||
|
03000000632500002305000000010000,Redragon Saturn,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Mac OS X,
|
||||||
03000000921200004547000000020000,Retro Bit Sega Genesis Controller Adapter,a:b0,b:b2,dpdown:+a2,dpleft:-a0,dpright:+a0,dpup:-a2,lefttrigger:b14,rightshoulder:b10,righttrigger:b4,start:b12,x:b6,y:b8,platform:Mac OS X,
|
03000000921200004547000000020000,Retro Bit Sega Genesis Controller Adapter,a:b0,b:b2,dpdown:+a2,dpleft:-a0,dpright:+a0,dpup:-a2,lefttrigger:b14,rightshoulder:b10,righttrigger:b4,start:b12,x:b6,y:b8,platform:Mac OS X,
|
||||||
03000000790000001100000000000000,Retro Controller,a:b1,b:b2,back:b8,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-a4,leftshoulder:b6,lefttrigger:b7,rightshoulder:b4,righttrigger:b5,start:b9,x:b0,y:b3,platform:Mac OS X,
|
03000000790000001100000000000000,Retro Controller,a:b1,b:b2,back:b8,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-a4,leftshoulder:b6,lefttrigger:b7,rightshoulder:b4,righttrigger:b5,start:b9,x:b0,y:b3,platform:Mac OS X,
|
||||||
03000000790000001100000005010000,Retro Controller,a:b1,b:b2,back:b8,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-a4,leftshoulder:b6,lefttrigger:b7,rightshoulder:b5,righttrigger:b4,start:b9,x:b0,y:b3,platform:Mac OS X,
|
03000000790000001100000005010000,Retro Controller,a:b1,b:b2,back:b8,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-a4,leftshoulder:b6,lefttrigger:b7,rightshoulder:b5,righttrigger:b4,start:b9,x:b0,y:b3,platform:Mac OS X,
|
||||||
@@ -1105,6 +1130,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
050000005769696d6f74652028303000,Wii Remote,a:b4,b:b5,back:b7,dpdown:b3,dpleft:b0,dpright:b1,dpup:b2,guide:b8,leftshoulder:b11,lefttrigger:b12,leftx:a0,lefty:a1,start:b6,x:b10,y:b9,platform:Mac OS X,
|
050000005769696d6f74652028303000,Wii Remote,a:b4,b:b5,back:b7,dpdown:b3,dpleft:b0,dpright:b1,dpup:b2,guide:b8,leftshoulder:b11,lefttrigger:b12,leftx:a0,lefty:a1,start:b6,x:b10,y:b9,platform:Mac OS X,
|
||||||
050000005769696d6f74652028313800,Wii U Pro Controller,a:b16,b:b15,back:b7,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b8,leftshoulder:b19,leftstick:b23,lefttrigger:b21,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b24,righttrigger:b22,rightx:a2,righty:a3,start:b6,x:b18,y:b17,platform:Mac OS X,
|
050000005769696d6f74652028313800,Wii U Pro Controller,a:b16,b:b15,back:b7,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b8,leftshoulder:b19,leftstick:b23,lefttrigger:b21,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b24,righttrigger:b22,rightx:a2,righty:a3,start:b6,x:b18,y:b17,platform:Mac OS X,
|
||||||
030000005e0400008e02000000000000,Xbox 360 Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
|
030000005e0400008e02000000000000,Xbox 360 Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
|
||||||
|
030000005e0400008e02000010010000,Xbox 360 Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1~,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4~,start:b8,x:b2,y:b3,platform:Mac OS X,
|
||||||
030000006f0e00000104000000000000,Xbox 360 Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
|
030000006f0e00000104000000000000,Xbox 360 Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
|
||||||
03000000c6240000045d000000000000,Xbox 360 Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
|
03000000c6240000045d000000000000,Xbox 360 Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
|
||||||
030000005e0400000a0b000000000000,Xbox Adaptive Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
|
030000005e0400000a0b000000000000,Xbox Adaptive Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
|
||||||
@@ -1120,6 +1146,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
030000005e040000e302000000000000,Xbox One Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
|
030000005e040000e302000000000000,Xbox One Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
|
||||||
030000005e040000ea02000000000000,Xbox One Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
|
030000005e040000ea02000000000000,Xbox One Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
|
||||||
030000005e040000fd02000003090000,Xbox One Controller,a:b0,b:b1,back:b16,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
|
030000005e040000fd02000003090000,Xbox One Controller,a:b0,b:b1,back:b16,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
|
||||||
|
030000005e040000220b000013050000,Xbox One Elite 2 Controller,a:b0,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,paddle1:b11,paddle2:b13,paddle3:b12,paddle4:b14,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Mac OS X,
|
||||||
03000000c62400003a54000000000000,Xbox One PowerA Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
|
03000000c62400003a54000000000000,Xbox One PowerA Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
|
||||||
030000005e040000130b000001050000,Xbox Series Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
|
030000005e040000130b000001050000,Xbox Series Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
|
||||||
030000005e040000130b000005050000,Xbox Series Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
|
030000005e040000130b000005050000,Xbox Series Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
|
||||||
@@ -1204,10 +1231,10 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
03000000c82d00001730000011010000,8BitDo Ultimate C,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
03000000c82d00001730000011010000,8BitDo Ultimate C,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
03000000c82d00001130000011010000,8BitDo Ultimate Wired,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b26,paddle1:b24,paddle2:b25,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
03000000c82d00001130000011010000,8BitDo Ultimate Wired,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b26,paddle1:b24,paddle2:b25,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
03000000c82d00000631000010010000,8BitDo Ultimate Wireless,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
03000000c82d00000631000010010000,8BitDo Ultimate Wireless,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
|
03000000c82d00000631000014010000,8BitDo Ultimate Wireless,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
03000000c82d00000760000011010000,8BitDo Ultimate Wireless,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,
|
03000000c82d00000760000011010000,8BitDo Ultimate Wireless,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,
|
||||||
03000000c82d00001230000011010000,8BitDo Ultimate Wireless,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,paddle1:b2,paddle2:b5,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
03000000c82d00001230000011010000,8BitDo Ultimate Wireless,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,paddle1:b2,paddle2:b5,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
03000000c82d00001330000011010000,8BitDo Ultimate Wireless,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b26,paddle1:b23,paddle2:b19,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
03000000c82d00001330000011010000,8BitDo Ultimate Wireless,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b26,paddle1:b23,paddle2:b19,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
03000000c82d00000631000014010000,8BitDo Ultimate Wireless Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
|
||||||
03000000c82d00000121000011010000,8BitDo Xbox One SN30 Pro,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
03000000c82d00000121000011010000,8BitDo Xbox One SN30 Pro,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
05000000c82d00000121000000010000,8BitDo Xbox One SN30 Pro,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
05000000c82d00000121000000010000,8BitDo Xbox One SN30 Pro,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
05000000a00500003232000001000000,8BitDo Zero,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Linux,
|
05000000a00500003232000001000000,8BitDo Zero,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
@@ -1229,6 +1256,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
03000000020500000913000010010000,Anbernic RG P01,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
03000000020500000913000010010000,Anbernic RG P01,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
03000000373500000710000010010000,Anbernic RG P01,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
03000000373500000710000010010000,Anbernic RG P01,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
05000000373500004610000001000000,Anbernic RG P01,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b15,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
05000000373500004610000001000000,Anbernic RG P01,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b15,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
|
03000000190e00000110000010010000,Aquaplus Piece,a:b1,b:b0,back:b3,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,start:b2,platform:Linux,
|
||||||
03000000790000003018000011010000,Arcade Fightstick F300,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux,
|
03000000790000003018000011010000,Arcade Fightstick F300,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux,
|
||||||
03000000a30c00002700000011010000,Astro City Mini,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,rightshoulder:b4,righttrigger:b5,start:b9,x:b3,y:b0,platform:Linux,
|
03000000a30c00002700000011010000,Astro City Mini,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,rightshoulder:b4,righttrigger:b5,start:b9,x:b3,y:b0,platform:Linux,
|
||||||
03000000a30c00002800000011010000,Astro City Mini,a:b2,b:b1,back:b8,leftx:a0,lefty:a1,rightshoulder:b4,righttrigger:b5,start:b9,x:b3,y:b0,platform:Linux,
|
03000000a30c00002800000011010000,Astro City Mini,a:b2,b:b1,back:b8,leftx:a0,lefty:a1,rightshoulder:b4,righttrigger:b5,start:b9,x:b3,y:b0,platform:Linux,
|
||||||
@@ -1265,6 +1293,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
03000000120c0000200e000011010000,Brook Mars PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,touchpad:b13,x:b0,y:b3,platform:Linux,
|
03000000120c0000200e000011010000,Brook Mars PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,touchpad:b13,x:b0,y:b3,platform:Linux,
|
||||||
03000000120c0000210e000011010000,Brook Mars PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,touchpad:b13,x:b0,y:b3,platform:Linux,
|
03000000120c0000210e000011010000,Brook Mars PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,touchpad:b13,x:b0,y:b3,platform:Linux,
|
||||||
03000000120c0000f70e000011010000,Brook Universal Fighting Board,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,rightstick:b11,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux,
|
03000000120c0000f70e000011010000,Brook Universal Fighting Board,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,rightstick:b11,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux,
|
||||||
|
03000000d81d00000b00000010010000,Buffalo BSGP1601,a:b5,b:b3,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b8,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,misc1:b14,rightshoulder:b9,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b13,x:b4,y:b2,platform:Linux,
|
||||||
03000000e82000006058000001010000,Cideko AK08b,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
|
03000000e82000006058000001010000,Cideko AK08b,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
|
||||||
03000000af1e00002400000010010000,Clockwork Pi DevTerm,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,start:b9,x:b3,y:b0,platform:Linux,
|
03000000af1e00002400000010010000,Clockwork Pi DevTerm,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,start:b9,x:b3,y:b0,platform:Linux,
|
||||||
030000000b0400003365000000010000,Competition Pro,a:b0,b:b1,back:b2,leftx:a0,lefty:a1,start:b3,platform:Linux,
|
030000000b0400003365000000010000,Competition Pro,a:b0,b:b1,back:b2,leftx:a0,lefty:a1,start:b3,platform:Linux,
|
||||||
@@ -1282,7 +1311,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
030000006f0e00008401000011010000,Faceoff Deluxe Nintendo Switch Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
|
030000006f0e00008401000011010000,Faceoff Deluxe Nintendo Switch Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
|
||||||
030000006f0e00008101000011010000,Faceoff Deluxe Pro Nintendo Switch Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
|
030000006f0e00008101000011010000,Faceoff Deluxe Pro Nintendo Switch Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
|
||||||
030000006f0e00008001000011010000,Faceoff Pro Nintendo Switch Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
|
030000006f0e00008001000011010000,Faceoff Pro Nintendo Switch Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
|
||||||
03005036852100000201000010010000,Final Fantasy XIV Online Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
|
03000000852100000201000010010000,FF GP1,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
|
||||||
05000000b40400001224000001010000,Flydigi APEX 4,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b14,leftshoulder:b4,leftstick:b10,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b20,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
|
05000000b40400001224000001010000,Flydigi APEX 4,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b14,leftshoulder:b4,leftstick:b10,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b20,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
|
||||||
03000000b40400001124000011010000,Flydigi Vader 2,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b12,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b14,paddle1:b2,paddle2:b5,paddle3:b16,paddle4:b17,rightshoulder:b7,rightstick:b13,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
03000000b40400001124000011010000,Flydigi Vader 2,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b12,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b14,paddle1:b2,paddle2:b5,paddle3:b16,paddle4:b17,rightshoulder:b7,rightstick:b13,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
03000000b40400001224000011010000,Flydigi Vader 2,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b12,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b2,paddle1:b16,paddle2:b17,paddle3:b14,paddle4:b15,rightshoulder:b7,rightstick:b13,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
03000000b40400001224000011010000,Flydigi Vader 2,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b12,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b2,paddle1:b16,paddle2:b17,paddle3:b14,paddle4:b15,rightshoulder:b7,rightstick:b13,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
@@ -1294,15 +1323,18 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
03000000558500001b06000010010000,GameSir G4 Pro,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
03000000558500001b06000010010000,GameSir G4 Pro,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
05000000ac0500002d0200001b010000,GameSir G4s,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b33,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
05000000ac0500002d0200001b010000,GameSir G4s,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b33,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
03000000ac0500007a05000011010000,GameSir G5,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b16,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
03000000ac0500007a05000011010000,GameSir G5,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b16,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
|
03000000373500009710000001020000,GameSir Kaleid Flux,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b15,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
|
03000000ac0500001a06000011010000,GameSir T3 2.02,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
03000000bc2000005656000011010000,GameSir T4w,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
|
03000000bc2000005656000011010000,GameSir T4w,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
|
||||||
03000000ac0500001a06000011010000,GameSir-T3 2.02,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
03000000373500009410000010010000,GameSir Tegenaria Lite,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
|
0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
|
||||||
030000006f0e00000104000000010000,Gamestop Logic3 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
030000006f0e00000104000000010000,Gamestop Logic3 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
030000008f0e00000800000010010000,Gasia PlayStation Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
|
030000008f0e00000800000010010000,Gasia PlayStation Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
|
||||||
03000000451300000010000010010000,Genius Maxfire Grandias 12,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
|
03000000451300000010000010010000,Genius Maxfire Grandias 12,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
|
||||||
|
03000000f0250000c283000010010000,Gioteck VX2 PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
|
||||||
190000004b4800000010000000010000,GO-Advance Controller,a:b1,b:b0,back:b10,dpdown:b7,dpleft:b8,dpright:b9,dpup:b6,leftshoulder:b4,lefttrigger:b12,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b13,start:b15,x:b2,y:b3,platform:Linux,
|
190000004b4800000010000000010000,GO-Advance Controller,a:b1,b:b0,back:b10,dpdown:b7,dpleft:b8,dpright:b9,dpup:b6,leftshoulder:b4,lefttrigger:b12,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b13,start:b15,x:b2,y:b3,platform:Linux,
|
||||||
190000004b4800000010000001010000,GO-Advance Controller,a:b1,b:b0,back:b12,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,leftshoulder:b4,leftstick:b13,lefttrigger:b14,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b16,righttrigger:b15,start:b17,x:b2,y:b3,platform:Linux,
|
190000004b4800000010000001010000,GO-Advance Controller,a:b1,b:b0,back:b12,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,leftshoulder:b4,leftstick:b13,lefttrigger:b14,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b16,righttrigger:b15,start:b17,x:b2,y:b3,platform:Linux,
|
||||||
190000004b4800000011000000010000,GO-Super Controller,a:b1,b:b0,back:b12,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b16,leftshoulder:b4,leftstick:b14,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b15,righttrigger:b7,rightx:a2,righty:a3,start:b13,x:b2,y:b3,platform:Linux,
|
190000004b4800000011000000010000,GO-Super Gamepad,a:b0,b:b1,back:b12,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b16,leftshoulder:b4,leftstick:b14,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b15,righttrigger:b7,rightx:a2,righty:a3,start:b13,x:b3,y:b2,platform:Linux,
|
||||||
03000000f0250000c183000010010000,Goodbetterbest Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
|
03000000f0250000c183000010010000,Goodbetterbest Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
|
||||||
03000000d11800000094000011010000,Google Stadia Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Linux,
|
03000000d11800000094000011010000,Google Stadia Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
05000000d11800000094000000010000,Google Stadia Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Linux,
|
05000000d11800000094000000010000,Google Stadia Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
@@ -1314,6 +1346,8 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
030000008f0e00001200000010010000,GreenAsia Joystick,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Linux,
|
030000008f0e00001200000010010000,GreenAsia Joystick,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Linux,
|
||||||
0500000047532067616d657061640000,GS gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
|
0500000047532067616d657061640000,GS gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
|
||||||
03000000f0250000c383000010010000,GT VX2,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
|
03000000f0250000c383000010010000,GT VX2,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
|
||||||
|
030000008a2e0000dd10000011010000,Hand Held Legend GC Ultimate,a:b0,b:b2,back:b17,dpdown:b5,dpleft:b6,dpright:b7,dpup:b4,guide:b18,leftshoulder:b10,leftstick:b8,lefttrigger:a3,leftx:a0,lefty:a1,misc1:b19,misc2:b24,paddle1:b13,paddle2:b12,rightshoulder:b11,rightstick:b9,righttrigger:a4,rightx:a2,righty:a5,start:b16,x:b1,y:b3,platform:Linux,
|
||||||
|
030000008a2e0000df10000011010000,Hand Held Legend ProGCC,a:b1,b:b0,back:b17,dpdown:b5,dpleft:b6,dpright:b7,dpup:b4,guide:b18,leftshoulder:b10,leftstick:b8,lefttrigger:a3,leftx:a0,lefty:a1,misc1:b19,paddle1:b13,paddle2:b12,rightshoulder:b11,rightstick:b9,righttrigger:a4,rightx:a2,righty:a5,start:b16,x:b3,y:b2,platform:Linux,
|
||||||
06000000adde0000efbe000002010000,Hidromancer Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
06000000adde0000efbe000002010000,Hidromancer Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
03000000d81400000862000011010000,HitBox PS3 PC Analog Mode,a:b1,b:b2,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,guide:b9,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b12,x:b0,y:b3,platform:Linux,
|
03000000d81400000862000011010000,HitBox PS3 PC Analog Mode,a:b1,b:b2,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,guide:b9,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b12,x:b0,y:b3,platform:Linux,
|
||||||
03000000c9110000f055000011010000,HJC Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
|
03000000c9110000f055000011010000,HJC Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
|
||||||
@@ -1439,6 +1473,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
030000005e040000d102000003020000,Microsoft Xbox One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
030000005e040000d102000003020000,Microsoft Xbox One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
030000005e040000dd02000003020000,Microsoft Xbox One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
030000005e040000dd02000003020000,Microsoft Xbox One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
030000005e040000ea02000008040000,Microsoft Xbox One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
030000005e040000ea02000008040000,Microsoft Xbox One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
|
030000005e040000ea0200000f050000,Microsoft Xbox One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
060000005e040000120b000009050000,Microsoft Xbox One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,misc1:b11,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
060000005e040000120b000009050000,Microsoft Xbox One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,misc1:b11,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
030000005e040000e302000003020000,Microsoft Xbox One Elite,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
030000005e040000e302000003020000,Microsoft Xbox One Elite,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
030000005e040000000b000007040000,Microsoft Xbox One Elite 2,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,paddle1:b12,paddle2:b14,paddle3:b13,paddle4:b15,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
030000005e040000000b000007040000,Microsoft Xbox One Elite 2,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,paddle1:b12,paddle2:b14,paddle3:b13,paddle4:b15,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
@@ -1446,7 +1481,9 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
050000005e040000050b000003090000,Microsoft Xbox One Elite 2,a:b0,b:b1,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a6,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
050000005e040000050b000003090000,Microsoft Xbox One Elite 2,a:b0,b:b1,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a6,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
050000005e0400008e02000030110000,Microsoft Xbox One Elite 2,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,paddle1:b11,paddle2:b13,paddle3:b12,paddle4:b14,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
050000005e0400008e02000030110000,Microsoft Xbox One Elite 2,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,paddle1:b11,paddle2:b13,paddle3:b12,paddle4:b14,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
030000005e040000120b00000b050000,Microsoft Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
030000005e040000120b00000b050000,Microsoft Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
060000005e040000120b000001050000,Microsoft Xbox Series X Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
030000005e040000120b000016050000,Microsoft Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
|
030000005e040000120b000017050000,Microsoft Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
|
060000005e040000120b000001050000,Microsoft Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
03000000030000000300000002000000,Miroof,a:b1,b:b0,back:b6,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b3,y:b2,platform:Linux,
|
03000000030000000300000002000000,Miroof,a:b1,b:b0,back:b6,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b3,y:b2,platform:Linux,
|
||||||
03000000790000001c18000010010000,Mobapad Chitu HD,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
03000000790000001c18000010010000,Mobapad Chitu HD,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
050000004d4f435554452d3035335800,Mocute 053X,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
|
050000004d4f435554452d3035335800,Mocute 053X,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
|
||||||
@@ -1464,6 +1501,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
030000006b1400000906000014010000,Nacon Asymmetric Wireless PS4 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
030000006b1400000906000014010000,Nacon Asymmetric Wireless PS4 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
030000006b140000010c000010010000,Nacon GC 400ES,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
|
030000006b140000010c000010010000,Nacon GC 400ES,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
|
||||||
03000000853200000706000012010000,Nacon GC-100,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
03000000853200000706000012010000,Nacon GC-100,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
|
05000000853200000503000000010000,Nacon MG-X Pro,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
0300000085320000170d000011010000,Nacon Revolution 5 Pro,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,touchpad:b13,x:b0,y:b3,platform:Linux,
|
0300000085320000170d000011010000,Nacon Revolution 5 Pro,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,touchpad:b13,x:b0,y:b3,platform:Linux,
|
||||||
0300000085320000190d000011010000,Nacon Revolution 5 Pro,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,touchpad:b13,x:b0,y:b3,platform:Linux,
|
0300000085320000190d000011010000,Nacon Revolution 5 Pro,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,touchpad:b13,x:b0,y:b3,platform:Linux,
|
||||||
030000000d0f00000900000010010000,Natec Genesis P44,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
|
030000000d0f00000900000010010000,Natec Genesis P44,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
|
||||||
@@ -1474,6 +1512,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
060000007e0500003713000000000000,Nintendo 3DS,a:b0,b:b1,back:b8,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Linux,
|
060000007e0500003713000000000000,Nintendo 3DS,a:b0,b:b1,back:b8,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Linux,
|
||||||
030000007e0500003703000000016800,Nintendo GameCube Controller,a:b0,b:b2,dpdown:b6,dpleft:b4,dpright:b5,dpup:b7,lefttrigger:a4,leftx:a0,lefty:a1~,rightshoulder:b9,righttrigger:a5,rightx:a2,righty:a3~,start:b8,x:b1,y:b3,platform:Linux,
|
030000007e0500003703000000016800,Nintendo GameCube Controller,a:b0,b:b2,dpdown:b6,dpleft:b4,dpright:b5,dpup:b7,lefttrigger:a4,leftx:a0,lefty:a1~,rightshoulder:b9,righttrigger:a5,rightx:a2,righty:a3~,start:b8,x:b1,y:b3,platform:Linux,
|
||||||
03000000790000004618000010010000,Nintendo GameCube Controller Adapter,a:b1,b:b0,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,rightx:a5~,righty:a2~,start:b9,x:b2,y:b3,platform:Linux,
|
03000000790000004618000010010000,Nintendo GameCube Controller Adapter,a:b1,b:b0,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,rightx:a5~,righty:a2~,start:b9,x:b2,y:b3,platform:Linux,
|
||||||
|
030000007e0500006920000011010000,Nintendo Switch 2 Pro Controller,a:b0,b:b1,back:b14,dpdown:b8,dpleft:b10,dpright:b9,dpup:b11,guide:b16,leftshoulder:b12,leftstick:b15,lefttrigger:b13,leftx:a0,lefty:a1~,misc1:b17,misc2:b20,paddle1:b18,paddle2:b19,rightshoulder:b4,rightstick:b7,righttrigger:b5,rightx:a2,righty:a3~,start:b6,x:b2,y:b3,platform:Linux,
|
||||||
060000004e696e74656e646f20537700,Nintendo Switch Combined Joy-Cons,a:b0,b:b1,back:b9,dpdown:b15,dpleft:b16,dpright:b17,dpup:b14,guide:b11,leftshoulder:b5,leftstick:b12,lefttrigger:b7,leftx:a0,lefty:a1,misc1:b4,rightshoulder:b6,rightstick:b13,righttrigger:b8,rightx:a2,righty:a3,start:b10,x:b3,y:b2,platform:Linux,
|
060000004e696e74656e646f20537700,Nintendo Switch Combined Joy-Cons,a:b0,b:b1,back:b9,dpdown:b15,dpleft:b16,dpright:b17,dpup:b14,guide:b11,leftshoulder:b5,leftstick:b12,lefttrigger:b7,leftx:a0,lefty:a1,misc1:b4,rightshoulder:b6,rightstick:b13,righttrigger:b8,rightx:a2,righty:a3,start:b10,x:b3,y:b2,platform:Linux,
|
||||||
060000007e0500000620000000000000,Nintendo Switch Combined Joy-Cons,a:b0,b:b1,back:b9,dpdown:b15,dpleft:b16,dpright:b17,dpup:b14,guide:b11,leftshoulder:b5,leftstick:b12,lefttrigger:b7,leftx:a0,lefty:a1,misc1:b4,rightshoulder:b6,rightstick:b13,righttrigger:b8,rightx:a2,righty:a3,start:b10,x:b3,y:b2,platform:Linux,
|
060000007e0500000620000000000000,Nintendo Switch Combined Joy-Cons,a:b0,b:b1,back:b9,dpdown:b15,dpleft:b16,dpright:b17,dpup:b14,guide:b11,leftshoulder:b5,leftstick:b12,lefttrigger:b7,leftx:a0,lefty:a1,misc1:b4,rightshoulder:b6,rightstick:b13,righttrigger:b8,rightx:a2,righty:a3,start:b10,x:b3,y:b2,platform:Linux,
|
||||||
060000007e0500000820000000000000,Nintendo Switch Combined Joy-Cons,a:b0,b:b1,back:b9,dpdown:b15,dpleft:b16,dpright:b17,dpup:b14,guide:b11,leftshoulder:b5,leftstick:b12,lefttrigger:b7,leftx:a0,lefty:a1,misc1:b4,rightshoulder:b6,rightstick:b13,righttrigger:b8,rightx:a2,righty:a3,start:b10,x:b3,y:b2,platform:Linux,
|
060000007e0500000820000000000000,Nintendo Switch Combined Joy-Cons,a:b0,b:b1,back:b9,dpdown:b15,dpleft:b16,dpright:b17,dpup:b14,guide:b11,leftshoulder:b5,leftstick:b12,lefttrigger:b7,leftx:a0,lefty:a1,misc1:b4,rightshoulder:b6,rightstick:b13,righttrigger:b8,rightx:a2,righty:a3,start:b10,x:b3,y:b2,platform:Linux,
|
||||||
@@ -1486,13 +1525,16 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
050000007e0500000720000001800000,Nintendo Switch Right Joy-Con,a:b1,b:b2,back:b9,leftshoulder:b4,leftstick:b10,leftx:a1~,lefty:a0,rightshoulder:b6,start:b8,x:b0,y:b3,platform:Linux,
|
050000007e0500000720000001800000,Nintendo Switch Right Joy-Con,a:b1,b:b2,back:b9,leftshoulder:b4,leftstick:b10,leftx:a1~,lefty:a0,rightshoulder:b6,start:b8,x:b0,y:b3,platform:Linux,
|
||||||
05000000010000000100000003000000,Nintendo Wii Remote,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
|
05000000010000000100000003000000,Nintendo Wii Remote,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
|
||||||
050000007e0500003003000001000000,Nintendo Wii U Pro Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Linux,
|
050000007e0500003003000001000000,Nintendo Wii U Pro Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Linux,
|
||||||
|
050000005a1d00000218000003000000,Nokia GC 5000,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
030000000d0500000308000010010000,Nostromo n45 Dual Analog,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b12,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b10,x:b2,y:b3,platform:Linux,
|
030000000d0500000308000010010000,Nostromo n45 Dual Analog,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b12,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b10,x:b2,y:b3,platform:Linux,
|
||||||
030000007e0500001920000011810000,NSO N64 Controller,+rightx:b10,+righty:b8,-rightx:b9,-righty:b7,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b11,leftshoulder:b3,lefttrigger:b2,leftx:a0,lefty:a1,misc1:b12,rightshoulder:b4,righttrigger:b5,start:b6,platform:Linux,
|
030000007e0500007320000011010000,NSO GameCube Controller,a:b1,b:b3,dpdown:b8,dpleft:b10,dpright:b9,dpup:b11,guide:b16,leftshoulder:b13,lefttrigger:b12,leftx:a0,lefty:a1~,rightshoulder:b5,righttrigger:b4,rightx:a2,righty:a3~,start:b6,x:b0,y:b2,platform:Linux,
|
||||||
|
030000007e0500001920000011810000,NSO N64 Controller,+rightx:b2,+righty:b3,-rightx:b4,-righty:b10,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,misc1:b5,rightshoulder:b7,righttrigger:b9,start:b11,platform:Linux,
|
||||||
050000007e0500001920000001000000,NSO N64 Controller,+rightx:b8,+righty:b7,-rightx:b3,-righty:b2,a:b1,b:b0,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,righttrigger:b10,start:b9,platform:Linux,
|
050000007e0500001920000001000000,NSO N64 Controller,+rightx:b8,+righty:b7,-rightx:b3,-righty:b2,a:b1,b:b0,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,righttrigger:b10,start:b9,platform:Linux,
|
||||||
050000007e0500001920000001800000,NSO N64 Controller,+rightx:b10,+righty:b8,-rightx:b9,-righty:b7,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b11,leftshoulder:b3,lefttrigger:b2,leftx:a0,lefty:a1,misc1:b12,rightshoulder:b4,righttrigger:b5,start:b6,platform:Linux,
|
050000007e0500001920000001800000,NSO N64 Controller,+rightx:b2,+righty:b3,-rightx:b4,-righty:b10,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,misc1:b5,rightshoulder:b7,righttrigger:b9,start:b11,platform:Linux,
|
||||||
030000007e0500001720000011810000,NSO SNES Controller,a:b1,b:b0,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b3,y:b2,platform:Linux,
|
030000007e0500001e20000011810000,NSO Sega Genesis Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,misc1:b3,rightshoulder:b2,righttrigger:b4,start:b5,platform:Linux,
|
||||||
|
030000007e0500001720000011810000,NSO SNES Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b3,y:b2,platform:Linux,
|
||||||
050000007e0500001720000001000000,NSO SNES Controller,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,lefttrigger:b7,rightshoulder:b6,righttrigger:b8,start:b10,x:b3,y:b2,platform:Linux,
|
050000007e0500001720000001000000,NSO SNES Controller,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,lefttrigger:b7,rightshoulder:b6,righttrigger:b8,start:b10,x:b3,y:b2,platform:Linux,
|
||||||
050000007e0500001720000001800000,NSO SNES Controller,a:b1,b:b0,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b3,y:b2,platform:Linux,
|
050000007e0500001720000001800000,NSO SNES Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b3,y:b2,platform:Linux,
|
||||||
03000000550900001072000011010000,NVIDIA Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b13,leftshoulder:b4,leftstick:b8,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Linux,
|
03000000550900001072000011010000,NVIDIA Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b13,leftshoulder:b4,leftstick:b8,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
03000000550900001472000011010000,NVIDIA Controller,a:b0,b:b1,back:b14,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b16,leftshoulder:b4,leftstick:b7,lefttrigger:a3,leftx:a0,lefty:a1,misc1:b8,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a5,start:b6,x:b2,y:b3,platform:Linux,
|
03000000550900001472000011010000,NVIDIA Controller,a:b0,b:b1,back:b14,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b16,leftshoulder:b4,leftstick:b7,lefttrigger:a3,leftx:a0,lefty:a1,misc1:b8,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a5,start:b6,x:b2,y:b3,platform:Linux,
|
||||||
05000000550900001472000001000000,NVIDIA Controller,a:b0,b:b1,back:b14,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b16,leftshoulder:b4,leftstick:b7,lefttrigger:a3,leftx:a0,lefty:a1,misc1:b8,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a5,start:b6,x:b2,y:b3,platform:Linux,
|
05000000550900001472000001000000,NVIDIA Controller,a:b0,b:b1,back:b14,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b16,leftshoulder:b4,leftstick:b7,lefttrigger:a3,leftx:a0,lefty:a1,misc1:b8,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a5,start:b6,x:b2,y:b3,platform:Linux,
|
||||||
@@ -1508,7 +1550,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
030000006f0e0000b802000001010000,PDP Afterglow Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
030000006f0e0000b802000001010000,PDP Afterglow Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
030000006f0e0000b802000013020000,PDP Afterglow Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
030000006f0e0000b802000013020000,PDP Afterglow Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
030000006f0e00006401000001010000,PDP Battlefield One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
030000006f0e00006401000001010000,PDP Battlefield One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
030000006f0e0000d702000006640000,PDP Black Camo Wired Xbox Series X Controller,a:b0,b:b1,back:b6,dpdown:b13,dpleft:b14,dpright:b13,dpup:b14,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
030000006f0e0000d702000006640000,PDP Black Camo Wired Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:b13,dpleft:b14,dpright:b13,dpup:b14,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
030000006f0e00003101000000010000,PDP EA Sports Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
030000006f0e00003101000000010000,PDP EA Sports Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
030000006f0e00008501000011010000,PDP Fightpad Pro Gamecube Controller,a:b1,b:b0,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
|
030000006f0e00008501000011010000,PDP Fightpad Pro Gamecube Controller,a:b1,b:b0,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
|
||||||
030000006f0e0000c802000012010000,PDP Kingdom Hearts Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
030000006f0e0000c802000012010000,PDP Kingdom Hearts Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
@@ -1523,7 +1565,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
030000006f0e0000ef02000007640000,PDP Xbox Series Kinetic Wired Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
030000006f0e0000ef02000007640000,PDP Xbox Series Kinetic Wired Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
03000000c62400000053000000010000,PowerA,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
03000000c62400000053000000010000,PowerA,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
03000000c62400003a54000001010000,PowerA 1428124-01,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
03000000c62400003a54000001010000,PowerA 1428124-01,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
03000000d62000000540000001010000,PowerA Advantage Xbox Series X Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
03000000d62000000540000001010000,PowerA Advantage Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
03000000d620000011a7000011010000,PowerA Core Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
|
03000000d620000011a7000011010000,PowerA Core Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
|
||||||
03000000dd62000015a7000011010000,PowerA Fusion Nintendo Switch Arcade Stick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
|
03000000dd62000015a7000011010000,PowerA Fusion Nintendo Switch Arcade Stick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
|
||||||
03000000d620000012a7000011010000,PowerA Fusion Nintendo Switch Fight Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
|
03000000d620000012a7000011010000,PowerA Fusion Nintendo Switch Fight Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
|
||||||
@@ -1538,9 +1580,9 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
03000000d62000000228000001010000,PowerA Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
03000000d62000000228000001010000,PowerA Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
03000000c62400001a54000001010000,PowerA Xbox One Mini Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
03000000c62400001a54000001010000,PowerA Xbox One Mini Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
03000000d62000000240000001010000,PowerA Xbox One Spectra Infinity,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
03000000d62000000240000001010000,PowerA Xbox One Spectra Infinity,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
|
03000000d62000000520000050010000,PowerA Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
|
03000000d62000000b20000001010000,PowerA Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
03000000d62000000f20000001010000,PowerA Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b7,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
03000000d62000000f20000001010000,PowerA Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b7,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
03000000d62000000520000050010000,PowerA Xbox Series X Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
|
||||||
03000000d62000000b20000001010000,PowerA Xbox Series X Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
|
||||||
030000006d040000d2ca000011010000,Precision Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
|
030000006d040000d2ca000011010000,Precision Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
|
||||||
03000000250900000017000010010000,PS/SS/N64 Adapter,a:b1,b:b2,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b5,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b7,rightx:a2~,righty:a3,start:b8,platform:Linux,
|
03000000250900000017000010010000,PS/SS/N64 Adapter,a:b1,b:b2,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b5,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b7,rightx:a2~,righty:a3,start:b8,platform:Linux,
|
||||||
03000000ff1100004133000010010000,PS2 Controller,a:b2,b:b1,back:b8,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Linux,
|
03000000ff1100004133000010010000,PS2 Controller,a:b2,b:b1,back:b8,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Linux,
|
||||||
@@ -1597,7 +1639,10 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
0300132d9b2800006500000001010000,Raphnet GameCube Adapter,a:b0,b:b7,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,rightx:a3,righty:a4,start:b3,x:b1,y:b8,platform:Linux,
|
0300132d9b2800006500000001010000,Raphnet GameCube Adapter,a:b0,b:b7,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,rightx:a3,righty:a4,start:b3,x:b1,y:b8,platform:Linux,
|
||||||
030000009b2800003200000001010000,Raphnet GC and N64 Adapter,a:b0,b:b7,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,rightx:a3,righty:a4,start:b3,x:b1,y:b8,platform:Linux,
|
030000009b2800003200000001010000,Raphnet GC and N64 Adapter,a:b0,b:b7,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,rightx:a3,righty:a4,start:b3,x:b1,y:b8,platform:Linux,
|
||||||
030000009b2800006000000001010000,Raphnet GC and N64 Adapter,a:b0,b:b7,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,rightx:a3,righty:a4,start:b3,x:b1,y:b8,platform:Linux,
|
030000009b2800006000000001010000,Raphnet GC and N64 Adapter,a:b0,b:b7,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,rightx:a3,righty:a4,start:b3,x:b1,y:b8,platform:Linux,
|
||||||
|
030000009b2800006100000001010000,Raphnet N64 Adapter,+rightx:b9,+righty:b7,-rightx:b8,-righty:b6,a:b0,b:b1,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,leftshoulder:b4,lefttrigger:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b3,platform:Linux,
|
||||||
|
030000009b2800006400000001010000,Raphnet N64 Adapter,+rightx:b9,+righty:b7,-rightx:b8,-righty:b6,a:b0,b:b1,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,leftshoulder:b4,lefttrigger:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b3,platform:Linux,
|
||||||
030000009b2800008000000020020000,Raphnet Wii Classic Adapter,a:b1,b:b4,back:b2,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,leftshoulder:b6,rightshoulder:b7,start:b3,x:b0,y:b5,platform:Linux,
|
030000009b2800008000000020020000,Raphnet Wii Classic Adapter,a:b1,b:b4,back:b2,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,leftshoulder:b6,rightshoulder:b7,start:b3,x:b0,y:b5,platform:Linux,
|
||||||
|
030000009b2800008000000001010000,Raphnet Wii Classic Adapter V3,a:b1,b:b4,back:b2,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,leftshoulder:b6,rightshoulder:b7,start:b3,x:b0,y:b5,platform:Linux,
|
||||||
03000000f8270000bf0b000011010000,Razer Kishi,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
03000000f8270000bf0b000011010000,Razer Kishi,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
030000008916000001fd000024010000,Razer Onza Classic Edition,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
030000008916000001fd000024010000,Razer Onza Classic Edition,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
03000000321500000204000011010000,Razer Panthera PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
|
03000000321500000204000011010000,Razer Panthera PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
|
||||||
@@ -1732,6 +1777,8 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
03000000100800000300000010010000,USB Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Linux,
|
03000000100800000300000010010000,USB Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Linux,
|
||||||
03000000790000000600000007010000,USB gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b3,y:b0,platform:Linux,
|
03000000790000000600000007010000,USB gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b3,y:b0,platform:Linux,
|
||||||
03000000790000001100000000010000,USB Gamepad,a:b2,b:b1,back:b8,dpdown:a0,dpleft:a1,dpright:a2,dpup:a4,start:b9,platform:Linux,
|
03000000790000001100000000010000,USB Gamepad,a:b2,b:b1,back:b8,dpdown:a0,dpleft:a1,dpright:a2,dpup:a4,start:b9,platform:Linux,
|
||||||
|
03000000790000001a18000011010000,Venom PS4 Arcade Joystick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
|
||||||
|
03000000790000001b18000011010000,Venom PS4 Arcade Joystick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
|
||||||
030000006f0e00000302000011010000,Victrix Pro Fightstick PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,touchpad:b13,x:b0,y:b3,platform:Linux,
|
030000006f0e00000302000011010000,Victrix Pro Fightstick PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,touchpad:b13,x:b0,y:b3,platform:Linux,
|
||||||
030000006f0e00000702000011010000,Victrix Pro Fightstick PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,touchpad:b13,x:b0,y:b3,platform:Linux,
|
030000006f0e00000702000011010000,Victrix Pro Fightstick PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,touchpad:b13,x:b0,y:b3,platform:Linux,
|
||||||
05000000ac0500003232000001000000,VR Box Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Linux,
|
05000000ac0500003232000001000000,VR Box Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Linux,
|
||||||
@@ -1759,11 +1806,13 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
050000005e040000e002000003090000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
050000005e040000e002000003090000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
050000005e040000fd02000003090000,Xbox One Controller,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b16,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
050000005e040000fd02000003090000,Xbox One Controller,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b16,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
050000005e040000fd02000030110000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
050000005e040000fd02000030110000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
|
060000005e040000dd02000003020000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
050000005e040000e302000002090000,Xbox One Elite,a:b0,b:b1,back:b136,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a6,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
050000005e040000e302000002090000,Xbox One Elite,a:b0,b:b1,back:b136,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a6,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
050000005e040000220b000013050000,Xbox One Elite 2 Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
050000005e040000220b000013050000,Xbox One Elite 2 Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
050000005e040000050b000002090000,Xbox One Elite Series 2,a:b0,b:b1,back:b136,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a6,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
050000005e040000050b000002090000,Xbox One Elite Series 2,a:b0,b:b1,back:b136,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a6,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
030000005e040000ea02000011050000,Xbox One S Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
030000005e040000ea02000011050000,Xbox One S Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
030000005e040000ea02000015050000,Xbox One S Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
030000005e040000ea02000015050000,Xbox One S Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
|
030000005e040000ea02000017050000,Xbox One S Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
060000005e040000ea0200000b050000,Xbox One S Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
060000005e040000ea0200000b050000,Xbox One S Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
060000005e040000ea0200000d050000,Xbox One S Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
060000005e040000ea0200000d050000,Xbox One S Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
060000005e040000ea02000016050000,Xbox One S Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
060000005e040000ea02000016050000,Xbox One S Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
@@ -1773,6 +1822,8 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
030000005e040000120b000009050000,Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
030000005e040000120b000009050000,Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
030000005e040000120b00000d050000,Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,misc1:b11,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
030000005e040000120b00000d050000,Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,misc1:b11,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
030000005e040000120b00000f050000,Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
030000005e040000120b00000f050000,Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
|
030000005e040000120b000011050000,Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,misc1:b11,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
|
030000005e040000120b000014050000,Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,misc1:b11,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
030000005e040000120b000015050000,Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
030000005e040000120b000015050000,Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
030000005e040000130b000005050000,Xbox Series Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
030000005e040000130b000005050000,Xbox Series Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
050000005e040000130b000001050000,Xbox Series Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
050000005e040000130b000001050000,Xbox Series Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
@@ -1782,15 +1833,16 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
050000005e040000130b000011050000,Xbox Series Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b15,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
050000005e040000130b000011050000,Xbox Series Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b15,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
050000005e040000130b000013050000,Xbox Series Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b15,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
050000005e040000130b000013050000,Xbox Series Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b15,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
050000005e040000130b000015050000,Xbox Series Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b15,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
050000005e040000130b000015050000,Xbox Series Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b15,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
|
050000005e040000130b000017050000,Xbox Series Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b15,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
060000005e040000120b000007050000,Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
060000005e040000120b000007050000,Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
060000005e040000120b00000b050000,Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
060000005e040000120b00000b050000,Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
|
060000005e040000120b00000d050000,Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,misc1:b11,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
060000005e040000120b00000f050000,Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,misc1:b11,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
060000005e040000120b00000f050000,Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,misc1:b11,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
030000005e040000120b000011050000,Xbox Series X Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,misc1:b11,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
060000005e040000120b000011050000,Xbox Series X Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,misc1:b11,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
030000005e040000120b000014050000,Xbox Series X Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,misc1:b11,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
050000005e040000130b000022050000,Xbox Series X Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b15,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
050000005e040000130b000017050000,Xbox Series X Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b15,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
|
||||||
060000005e040000120b00000d050000,Xbox Series X Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,misc1:b11,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
|
||||||
050000005e040000200b000013050000,Xbox Wireless Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
050000005e040000200b000013050000,Xbox Wireless Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
050000005e040000200b000017050000,Xbox Wireless Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
050000005e040000200b000017050000,Xbox Wireless Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
|
050000005e040000200b000023050000,Xbox Wireless Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
050000005e040000220b000017050000,Xbox Wireless Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
050000005e040000220b000017050000,Xbox Wireless Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
03000000450c00002043000010010000,XEOX SL6556 BK,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
|
03000000450c00002043000010010000,XEOX SL6556 BK,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
|
||||||
05000000172700004431000029010000,XiaoMi Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b20,leftshoulder:b6,leftstick:b13,lefttrigger:a7,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a6,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Linux,
|
05000000172700004431000029010000,XiaoMi Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b20,leftshoulder:b6,leftstick:b13,lefttrigger:a7,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a6,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Linux,
|
||||||
@@ -1799,6 +1851,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||||
03000000120c0000100e000011010000,Zeroplus P4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
|
03000000120c0000100e000011010000,Zeroplus P4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
|
||||||
03000000120c0000101e000011010000,Zeroplus P4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
|
03000000120c0000101e000011010000,Zeroplus P4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
|
||||||
|
03000000120c0000182e000011010000,Zeroplus PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
|
||||||
|
|
||||||
# Android
|
# Android
|
||||||
38653964633230666463343334313533,8BitDo Adapter,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
|
38653964633230666463343334313533,8BitDo Adapter,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
|
||||||
@@ -1810,7 +1863,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
33313433353539306634656436353432,8BitDo Dogbone,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
|
33313433353539306634656436353432,8BitDo Dogbone,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
|
||||||
38426974446f20446f67626f6e65204d,8BitDo Dogbone,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,start:b6,platform:Android,
|
38426974446f20446f67626f6e65204d,8BitDo Dogbone,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,start:b6,platform:Android,
|
||||||
34343439373236623466343934376233,8BitDo FC30 Pro,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,leftstick:b28,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b4,rightstick:b29,righttrigger:b7,start:b5,x:b30,y:b2,platform:Android,
|
34343439373236623466343934376233,8BitDo FC30 Pro,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,leftstick:b28,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b4,rightstick:b29,righttrigger:b7,start:b5,x:b30,y:b2,platform:Android,
|
||||||
38426974446f204e4743204d6f646b69,8BitDo GameCube,a:b0,b:b2,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,paddle1:b18,paddle2:b17,rightshoulder:b15,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b1,y:b3,platform:Android,
|
38426974446f204e4743204d6f646b69,8BitDo GameCube,a:b0,b:b2,back:b4,dpdown:b12,dpleft:b13,dpright:b14,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,paddle1:b18,paddle2:b17,rightshoulder:b15,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b1,y:b3,platform:Android,
|
||||||
38426974446f2038426974446f204c69,8BitDo Lite,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android,
|
38426974446f2038426974446f204c69,8BitDo Lite,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android,
|
||||||
30643332373663313263316637356631,8BitDo Lite 2,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android,
|
30643332373663313263316637356631,8BitDo Lite 2,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android,
|
||||||
38426974446f204c6974652032000000,8BitDo Lite 2,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android,
|
38426974446f204c6974652032000000,8BitDo Lite 2,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android,
|
||||||
@@ -1924,6 +1977,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
4a6f792d436f6e20284c290000000000,Joy-Con (L),a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,rightshoulder:b20,start:b17,x:b19,y:b2,platform:Android,
|
4a6f792d436f6e20284c290000000000,Joy-Con (L),a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,rightshoulder:b20,start:b17,x:b19,y:b2,platform:Android,
|
||||||
38383665633039363066383334653465,Joy-Con (R),a:b0,b:b1,back:b5,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,leftstick:b15,rightshoulder:b20,start:b18,x:b19,y:b2,platform:Android,
|
38383665633039363066383334653465,Joy-Con (R),a:b0,b:b1,back:b5,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,leftstick:b15,rightshoulder:b20,start:b18,x:b19,y:b2,platform:Android,
|
||||||
39363561613936303237333537383931,Joy-Con (R),a:b0,b:b1,back:b5,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,leftstick:b15,rightshoulder:b20,start:b18,x:b19,y:b2,platform:Android,
|
39363561613936303237333537383931,Joy-Con (R),a:b0,b:b1,back:b5,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,leftstick:b15,rightshoulder:b20,start:b18,x:b19,y:b2,platform:Android,
|
||||||
|
39373064396565646338333134303131,Joy-Con (R),a:b1,b:b2,back:b5,leftstick:b8,leftx:a1~,lefty:a0,start:b6,x:b0,y:b3,platform:Android,
|
||||||
4a6f792d436f6e202852290000000000,Joy-Con (R),a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,rightshoulder:b20,start:b18,x:b19,y:b2,platform:Android,
|
4a6f792d436f6e202852290000000000,Joy-Con (R),a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,rightshoulder:b20,start:b18,x:b19,y:b2,platform:Android,
|
||||||
39656136363638323036303865326464,JYS Aapter,a:b1,b:b19,back:b17,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,leftstick:b15,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b6,righttrigger:b10,rightx:a2,righty:a3,start:b18,x:b0,y:b2,platform:Android,
|
39656136363638323036303865326464,JYS Aapter,a:b1,b:b19,back:b17,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,leftstick:b15,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b6,righttrigger:b10,rightx:a2,righty:a3,start:b18,x:b0,y:b2,platform:Android,
|
||||||
63316564383539663166353034616434,JYS Adapter,a:b1,b:b3,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b0,y:b2,platform:Android,
|
63316564383539663166353034616434,JYS Adapter,a:b1,b:b3,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b0,y:b2,platform:Android,
|
||||||
@@ -1957,6 +2011,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
39306635663061636563316166303966,Mocute M053,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
|
39306635663061636563316166303966,Mocute M053,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
|
||||||
7573622067616d657061642020202020,NEXT SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,righttrigger:b6,start:b9,x:b3,y:b0,platform:Android,
|
7573622067616d657061642020202020,NEXT SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,righttrigger:b6,start:b9,x:b3,y:b0,platform:Android,
|
||||||
050000007e05000009200000ffff0f00,Nintendo Switch Pro Controller,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:b10,rightx:a2,righty:a3,start:b16,x:b17,y:b2,platform:Android,
|
050000007e05000009200000ffff0f00,Nintendo Switch Pro Controller,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:b10,rightx:a2,righty:a3,start:b16,x:b17,y:b2,platform:Android,
|
||||||
|
31316661666466633938376335383661,Nintendo Switch Pro Controller,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,leftshoulder:b9,leftstick:b7,lefttrigger:b17,leftx:a0,lefty:a1,misc1:b5,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,start:b6,x:b3,y:b2,platform:Android,
|
||||||
34323437396534643531326161633738,Nintendo Switch Pro Controller,a:b0,b:b1,back:b15,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b9,leftstick:b7,lefttrigger:b17,misc1:b5,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
|
34323437396534643531326161633738,Nintendo Switch Pro Controller,a:b0,b:b1,back:b15,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b9,leftstick:b7,lefttrigger:b17,misc1:b5,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
|
||||||
50726f20436f6e74726f6c6c65720000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b17,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b2,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b10,rightx:a2,righty:a3,start:b18,y:b3,platform:Android,
|
50726f20436f6e74726f6c6c65720000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b17,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b2,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b10,rightx:a2,righty:a3,start:b18,y:b3,platform:Android,
|
||||||
36326533353166323965623661303933,NSO N64 Controller,+rightx:b17,+righty:b10,-rightx:b2,-righty:b19,a:b1,b:b0,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,lefttrigger:b9,leftx:a0,lefty:a1,misc1:b7,rightshoulder:b20,righttrigger:b15,start:b18,platform:Android,
|
36326533353166323965623661303933,NSO N64 Controller,+rightx:b17,+righty:b10,-rightx:b2,-righty:b19,a:b1,b:b0,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,lefttrigger:b9,leftx:a0,lefty:a1,misc1:b7,rightshoulder:b20,righttrigger:b15,start:b18,platform:Android,
|
||||||
@@ -2020,6 +2075,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
61343739353764363165343237303336,Retro Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b17,lefttrigger:b18,leftx:a0,lefty:a1,start:b10,x:b2,y:b3,platform:Android,
|
61343739353764363165343237303336,Retro Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b17,lefttrigger:b18,leftx:a0,lefty:a1,start:b10,x:b2,y:b3,platform:Android,
|
||||||
526574726f696420506f636b65742043,Retroid Pocket,a:b1,b:b0,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,paddle1:b17,paddle2:b18,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android,
|
526574726f696420506f636b65742043,Retroid Pocket,a:b1,b:b0,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,paddle1:b17,paddle2:b18,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android,
|
||||||
582d426f7820436f6e74726f6c6c6572,Retroid Pocket,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,paddle1:b17,paddle2:b18,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
|
582d426f7820436f6e74726f6c6c6572,Retroid Pocket,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,paddle1:b17,paddle2:b18,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
|
||||||
|
64633735616665613536653363336132,Retroid Pocket,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,paddle1:b19,paddle2:b20,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android,
|
||||||
38653130373365613538333235303036,Retroid Pocket 2,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
|
38653130373365613538333235303036,Retroid Pocket 2,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
|
||||||
64363363336633363736393038313463,Retrolink,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,start:b6,platform:Android,
|
64363363336633363736393038313463,Retrolink,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,start:b6,platform:Android,
|
||||||
37393234373533633333323633646531,RetroUSB N64 RetroPort,+rightx:b17,+righty:b15,-rightx:b18,-righty:b6,a:b10,b:b9,dpdown:b19,dpleft:b1,dpright:b0,dpup:b2,leftshoulder:b7,lefttrigger:b20,leftx:a0,lefty:a1,rightshoulder:b5,start:b3,platform:Android,
|
37393234373533633333323633646531,RetroUSB N64 RetroPort,+rightx:b17,+righty:b15,-rightx:b18,-righty:b6,a:b10,b:b9,dpdown:b19,dpleft:b1,dpright:b0,dpup:b2,leftshoulder:b7,lefttrigger:b20,leftx:a0,lefty:a1,rightshoulder:b5,start:b3,platform:Android,
|
||||||
@@ -2080,8 +2136,9 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
33356661323266333733373865656366,Xbox One Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
|
33356661323266333733373865656366,Xbox One Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
|
||||||
34356136633366613530316338376136,Xbox One Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b3,leftstick:b15,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b16,righttrigger:a5,rightx:a3,righty:a4,x:b17,y:b2,platform:Android,
|
34356136633366613530316338376136,Xbox One Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b3,leftstick:b15,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b16,righttrigger:a5,rightx:a3,righty:a4,x:b17,y:b2,platform:Android,
|
||||||
35623965373264386238353433656138,Xbox One Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
|
35623965373264386238353433656138,Xbox One Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
|
||||||
36616131643361333337396261666433,Xbox One Controller,a:b0,b:b1,back:b15,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
|
36616131643361333337396261666433,Xbox One Controller,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
|
||||||
58626f7820576972656c65737320436f,Xbox One Controller,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
|
58626f7820576972656c65737320436f,Xbox One Controller,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
|
||||||
|
65316262316265373335666131623538,Xbox One Controller,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
|
||||||
050000005e040000000b000000783f00,Xbox One Elite 2 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:Android,
|
050000005e040000000b000000783f00,Xbox One Elite 2 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:Android,
|
||||||
050000005e040000000b000000783f80,Xbox One Elite 2 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
|
050000005e040000000b000000783f80,Xbox One Elite 2 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
|
||||||
050000005e040000050b0000ffff3f00,Xbox One Elite 2 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a6,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
|
050000005e040000050b0000ffff3f00,Xbox One Elite 2 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a6,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
|
||||||
@@ -2102,7 +2159,9 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
05000000ac05000001000000ff076d01,*,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,platform:iOS,
|
05000000ac05000001000000ff076d01,*,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,platform:iOS,
|
||||||
05000000ac0500000200000000006d02,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,rightshoulder:b5,x:b2,y:b3,platform:iOS,
|
05000000ac0500000200000000006d02,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,rightshoulder:b5,x:b2,y:b3,platform:iOS,
|
||||||
05000000ac050000020000004f066d02,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,rightshoulder:b5,x:b2,y:b3,platform:iOS,
|
05000000ac050000020000004f066d02,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,rightshoulder:b5,x:b2,y:b3,platform:iOS,
|
||||||
05000000ac05000004000000a8986d04,8BitDo Micro gamepad,a:b1,b:b0,back:b4,dpdown:b7,dpleft:b8,dpright:b9,dpup:b10,guide:b2,leftshoulder:b11,lefttrigger:b12,rightshoulder:b13,righttrigger:b14,start:b3,x:b6,y:b5,platform:iOS,
|
05000000ac05000004000000a8986d04,8BitDo Micro,a:b1,b:b0,back:b4,dpdown:b7,dpleft:b8,dpright:b9,dpup:b10,guide:b2,leftshoulder:b11,lefttrigger:b12,rightshoulder:b13,righttrigger:b14,start:b3,x:b6,y:b5,platform:iOS,
|
||||||
|
05000000ac05000004000000fd216d04,8BitDo Pro 2,a:b3,b:b2,back:b6,dpdown:b9,dpleft:b10,dpright:b11,dpup:b12,guide:b4,leftshoulder:b13,leftstick:b14,lefttrigger:+a2,leftx:a0,lefty:a1~,paddle1:b1,paddle2:b0,rightshoulder:b16,rightstick:b17,righttrigger:+a5,rightx:a3,righty:a4~,start:b5,x:b8,y:b7,platform:iOS,
|
||||||
|
05000000ac05000004000000209f6d04,8Bitdo SN30 Pro,a:b1,b:b0,back:b4,dpdown:b7,dpleft:b8,dpright:b9,dpup:b10,guide:b2,leftshoulder:b11,leftstick:b12,lefttrigger:b13,leftx:a0,lefty:a1~,rightshoulder:b14,rightstick:b15,righttrigger:b16,rightx:a2,righty:a3~,start:b3,x:b6,y:b5,platform:iOS,
|
||||||
05000000ac050000040000003b8a6d04,8BitDo SN30 Pro+,a:b1,b:b0,back:b4,dpdown:b7,dpleft:b8,dpright:b9,dpup:b10,guide:b2,leftshoulder:b11,leftstick:b12,lefttrigger:b13,leftx:a0,lefty:a1~,rightshoulder:b14,rightstick:b15,righttrigger:b16,rightx:a2,righty:a3~,start:b3,x:b6,y:b5,platform:iOS,
|
05000000ac050000040000003b8a6d04,8BitDo SN30 Pro+,a:b1,b:b0,back:b4,dpdown:b7,dpleft:b8,dpright:b9,dpup:b10,guide:b2,leftshoulder:b11,leftstick:b12,lefttrigger:b13,leftx:a0,lefty:a1~,rightshoulder:b14,rightstick:b15,righttrigger:b16,rightx:a2,righty:a3~,start:b3,x:b6,y:b5,platform:iOS,
|
||||||
050000008a35000003010000ff070000,Backbone One,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,platform:iOS,
|
050000008a35000003010000ff070000,Backbone One,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,platform:iOS,
|
||||||
050000008a35000004010000ff070000,Backbone One,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,platform:iOS,
|
050000008a35000004010000ff070000,Backbone One,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,platform:iOS,
|
||||||
@@ -2110,11 +2169,12 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
4d466947616d65706164020000000000,MFi Gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,rightshoulder:b5,start:b6,x:b2,y:b3,platform:iOS,
|
4d466947616d65706164020000000000,MFi Gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,rightshoulder:b5,start:b6,x:b2,y:b3,platform:iOS,
|
||||||
050000007e050000062000000f060000,Nintendo Switch Joy-Con (L),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b2,leftshoulder:b4,rightshoulder:b5,x:b1,y:b3,platform:iOS,
|
050000007e050000062000000f060000,Nintendo Switch Joy-Con (L),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b2,leftshoulder:b4,rightshoulder:b5,x:b1,y:b3,platform:iOS,
|
||||||
050000007e050000062000004f060000,Nintendo Switch Joy-Con (L),+leftx:h0.1,+lefty:h0.2,-leftx:h0.4,-lefty:h0.8,dpdown:b2,dpleft:b0,dpright:b3,dpup:b1,leftshoulder:b4,misc1:b6,rightshoulder:b5,platform:iOS,
|
050000007e050000062000004f060000,Nintendo Switch Joy-Con (L),+leftx:h0.1,+lefty:h0.2,-leftx:h0.4,-lefty:h0.8,dpdown:b2,dpleft:b0,dpright:b3,dpup:b1,leftshoulder:b4,misc1:b6,rightshoulder:b5,platform:iOS,
|
||||||
050000007e05000008200000df070000,Nintendo Switch Joy-Con (L/R),a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:iOS,
|
050000007e05000008200000df070000,Nintendo Switch Joy-Con (L/R),a:b1,b:b0,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:iOS,
|
||||||
050000007e0500000e200000df070000,Nintendo Switch Joy-Con (L/R),a:b1,b:b0,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:iOS,
|
050000007e0500000e200000df070000,Nintendo Switch Joy-Con (L/R),a:b1,b:b0,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:iOS,
|
||||||
050000007e050000072000004f060000,Nintendo Switch Joy-Con (R),+rightx:h0.4,+righty:h0.8,-rightx:h0.1,-righty:h0.2,a:b1,b:b0,guide:b6,leftshoulder:b4,rightshoulder:b5,x:b3,y:b2,platform:iOS,
|
050000007e050000072000000f060000,Nintendo Switch Joy-Con (R),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b2,leftshoulder:b4,rightshoulder:b5,x:b1,y:b3,platform:iOS,
|
||||||
|
050000007e050000072000004f060000,Nintendo Switch Joy-Con (R),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b2,guide:b6,leftshoulder:b4,rightshoulder:b5,x:b1,y:b3,platform:iOS,
|
||||||
050000007e05000009200000df870000,Nintendo Switch Pro Controller,a:b1,b:b0,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,misc1:b10,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:iOS,
|
050000007e05000009200000df870000,Nintendo Switch Pro Controller,a:b1,b:b0,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,misc1:b10,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:iOS,
|
||||||
050000007e05000009200000ff870000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,misc1:b11,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,platform:iOS,
|
050000007e05000009200000ff870000,Nintendo Switch Pro Controller,a:b1,b:b0,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,misc1:b11,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b3,y:b2,platform:iOS,
|
||||||
050000004c050000cc090000df070000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:iOS,
|
050000004c050000cc090000df070000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:iOS,
|
||||||
050000004c050000cc090000df870001,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:iOS,
|
050000004c050000cc090000df870001,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:iOS,
|
||||||
050000004c050000cc090000ff070000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,platform:iOS,
|
050000004c050000cc090000ff070000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,platform:iOS,
|
||||||
@@ -2126,9 +2186,9 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
05000000ac0500000300000043006d03,Remote,a:b0,b:b2,leftx:a0,lefty:a1,platform:iOS,
|
05000000ac0500000300000043006d03,Remote,a:b0,b:b2,leftx:a0,lefty:a1,platform:iOS,
|
||||||
05000000de2800000511000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:iOS,
|
05000000de2800000511000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:iOS,
|
||||||
05000000de2800000611000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:iOS,
|
05000000de2800000611000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:iOS,
|
||||||
050000005e040000050b0000df070001,Xbox Elite Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,paddle1:b10,paddle2:b12,paddle3:b11,paddle4:b13,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:iOS,
|
050000005e040000050b0000df070001,Xbox Elite Wireless Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,paddle1:b10,paddle2:b12,paddle3:b11,paddle4:b13,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:iOS,
|
||||||
050000005e040000050b0000ff070001,Xbox Elite Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,paddle1:b11,paddle2:b13,paddle3:b12,paddle4:b14,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,platform:iOS,
|
050000005e040000050b0000ff070001,Xbox Elite Wireless Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,paddle1:b11,paddle2:b13,paddle3:b12,paddle4:b14,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,platform:iOS,
|
||||||
050000005e040000e0020000df070000,Xbox One Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:iOS,
|
|
||||||
050000005e040000e0020000ff070000,Xbox One Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,platform:iOS,
|
|
||||||
050000005e040000130b0000df870001,Xbox Series X Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,misc1:b10,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:iOS,
|
050000005e040000130b0000df870001,Xbox Series X Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,misc1:b10,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:iOS,
|
||||||
050000005e040000130b0000ff870001,Xbox Series X Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,misc1:b11,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,platform:iOS,
|
050000005e040000130b0000ff870001,Xbox Series X Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,misc1:b11,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,platform:iOS,
|
||||||
|
050000005e040000e0020000df070000,Xbox Wireless Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:iOS,
|
||||||
|
050000005e040000e0020000ff070000,Xbox Wireless Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,platform:iOS,
|
||||||
|
|||||||
@@ -1,26 +1,29 @@
|
|||||||
## --- GAME ---
|
# Coffee Crisis Arcade Edition - Fichero de parametros
|
||||||
game.item_size 20 # Tamaño de los items del juego (en píxeles)
|
# Formato: PARAMETRO VALOR
|
||||||
game.width 320 # Ancho de la resolución nativa del juego (en píxeles)
|
|
||||||
game.height 240 # Alto de la resolución nativa del juego (en píxeles)
|
|
||||||
game.play_area.rect.x 0 # Posición X de la zona jugable
|
|
||||||
game.play_area.rect.y 0 # Posición Y de la zona jugable
|
|
||||||
game.play_area.rect.w 320 # Ancho de la zona jugable
|
|
||||||
game.play_area.rect.h 200 # Alto de la zona jugable
|
|
||||||
game.name_entry_idle_time 10 # Segundos para introducir el nombre al finalizar la partida si no se pulsa nada
|
|
||||||
game.name_entry_total_time 60 # Segundos totales para introducir el nombre al finalizar la partida
|
|
||||||
game.hit_stop true # Indica si debe haber un paro cuando el jugador es golpeado por un globo
|
|
||||||
game.hit_stop_ms 500 # Cantidad de milisegundos que dura el hit_stop
|
|
||||||
|
|
||||||
## --- FADE ---
|
# --- GAME ---
|
||||||
fade.color 1F2B30 # Color hexadecimal para el efecto de fundido
|
game.item_size 20 # Tamaño de los items del juego (en píxeles)
|
||||||
fade.num_squares_width 160 # Número de cuadrados en el eje X para el fundido
|
game.item_text_outline_color E0E0E0F0 # Color del outline del texto de los items (RGBA hex)
|
||||||
fade.num_squares_height 120 # Número de cuadrados en el eje Y para el fundido
|
game.width 320 # Ancho de la resolución nativa del juego (en píxeles)
|
||||||
fade.random_squares_delay 1 # Delay entre aparición de cuadrados aleatorios (frames)
|
game.height 240 # Alto de la resolución nativa del juego (en píxeles)
|
||||||
fade.random_squares_mult 500 # Multiplicador para la velocidad de aparición aleatoria
|
game.play_area.rect.x 0 # Posición X de la zona jugable
|
||||||
fade.post_duration 80 # Duración tras el fundido (frames)
|
game.play_area.rect.y 0 # Posición Y de la zona jugable
|
||||||
fade.venetian_size 12 # Tamaño de las bandas para el efecto veneciano (en píxeles)
|
game.play_area.rect.w 320 # Ancho de la zona jugable
|
||||||
|
game.play_area.rect.h 200 # Alto de la zona jugable
|
||||||
|
game.name_entry_idle_time 10 # Segundos para introducir el nombre al finalizar la partida si no se pulsa nada
|
||||||
|
game.name_entry_total_time 60 # Segundos totales para introducir el nombre al finalizar la partida
|
||||||
|
game.hit_stop false # Indica si debe haber un paro cuando el jugador es golpeado por un globo
|
||||||
|
game.hit_stop_ms 500 # Cantidad de milisegundos que dura el hit_stop
|
||||||
|
|
||||||
## --- SCOREBOARD ---
|
# --- FADE ---
|
||||||
|
fade.color 1F2B30 # Color hexadecimal para el efecto de fundido
|
||||||
|
fade.num_squares_width 64 # Número de cuadrados en el eje X para el fundido
|
||||||
|
fade.num_squares_height 48 # Número de cuadrados en el eje Y para el fundido
|
||||||
|
fade.random_squares_duration_ms 1200 # Duración del fade en milisegundos
|
||||||
|
fade.post_duration_ms 500 # Duración tras el fundido en milisegundos
|
||||||
|
fade.venetian_size 12 # Tamaño de las bandas para el efecto veneciano (en píxeles)
|
||||||
|
|
||||||
|
# --- SCOREBOARD ---
|
||||||
scoreboard.rect.x 0 # Posición X del marcador
|
scoreboard.rect.x 0 # Posición X del marcador
|
||||||
scoreboard.rect.y 216 # Posición Y del marcador
|
scoreboard.rect.y 216 # Posición Y del marcador
|
||||||
scoreboard.rect.w 320 # Ancho del marcador
|
scoreboard.rect.w 320 # Ancho del marcador
|
||||||
@@ -35,17 +38,17 @@ scoreboard.text_color1 FFFFFF # Color principal del texto del marcad
|
|||||||
scoreboard.text_color2 FFFFFF # Color secundario del texto del marcador
|
scoreboard.text_color2 FFFFFF # Color secundario del texto del marcador
|
||||||
scoreboard.skip_countdown_value 8 # Valor para saltar la cuenta atrás (segundos)
|
scoreboard.skip_countdown_value 8 # Valor para saltar la cuenta atrás (segundos)
|
||||||
|
|
||||||
## --- TITLE ---
|
# --- TITLE ---
|
||||||
title.press_start_position 180 # Posición Y del texto "Press Start"
|
title.press_start_position 180 # Posición Y del texto "Press Start"
|
||||||
title.title_duration 800 # Duración de la pantalla de título (frames)
|
title.title_duration 800 # Duración de la pantalla de título (frames)
|
||||||
title.arcade_edition_position 123 # Posición Y del subtítulo "Arcade Edition"
|
title.arcade_edition_position 123 # Posición Y del subtítulo "Arcade Edition"
|
||||||
title.title_c_c_position 80 # Posición Y del título principal
|
title.title_c_c_position 80 # Posición Y del título principal
|
||||||
title.bg_color 41526F # Color de fondo en la sección titulo
|
title.bg_color 41526F # Color de fondo en la sección titulo
|
||||||
|
|
||||||
## --- BACKGROUND ---
|
# --- BACKGROUND ---
|
||||||
background.attenuate_color FFFFFF00 # Color de atenuación del fondo (RGBA hexadecimal)
|
background.attenuate_color FFFFFF00 # Color de atenuación del fondo (RGBA hexadecimal)
|
||||||
|
|
||||||
## --- BALLOONS ---
|
# --- BALLOONS ---
|
||||||
balloon.settings[0].vel 2.75f # Velocidad inicial del globo 1
|
balloon.settings[0].vel 2.75f # Velocidad inicial del globo 1
|
||||||
balloon.settings[0].grav 0.09f # Gravedad aplicada al globo 1
|
balloon.settings[0].grav 0.09f # Gravedad aplicada al globo 1
|
||||||
balloon.settings[1].vel 3.70f # Velocidad inicial del globo 2
|
balloon.settings[1].vel 3.70f # Velocidad inicial del globo 2
|
||||||
@@ -62,28 +65,87 @@ balloon.color[3] green # Color del globo que rebota
|
|||||||
|
|
||||||
balloon.bouncing_sound false # Indica si los globos hacer sonido al rebotar
|
balloon.bouncing_sound false # Indica si los globos hacer sonido al rebotar
|
||||||
|
|
||||||
## --- NOTIFICATION ---
|
# --- NOTIFICATION ---
|
||||||
notification.pos_v TOP # Posición vertical de la notificación (TOP/BOTTOM)
|
notification.pos_v TOP # Posición vertical de la notificación (TOP/BOTTOM)
|
||||||
notification.pos_h LEFT # Posición horizontal de la notificación (LEFT/RIGHT)
|
notification.pos_h LEFT # Posición horizontal de la notificación (LEFT/RIGHT)
|
||||||
notification.sound false # ¿La notificación reproduce sonido?
|
notification.sound false # ¿La notificación reproduce sonido?
|
||||||
notification.color 303030 # Color de fondo de la notificación (hexadecimal)
|
notification.color 303030 # Color de fondo de la notificación (hexadecimal)
|
||||||
|
|
||||||
## --- SERVICE MENU ---
|
# --- SERVICE MENU ---
|
||||||
service_menu.title_color 99FF62 # Color del título del menú de servicio
|
service_menu.title_color 99FF62 # Color del título del menú de servicio
|
||||||
service_menu.text_color FFFFFF # Color del texto del menú de servicio
|
service_menu.text_color FFFFFF # Color del texto del menú de servicio
|
||||||
service_menu.selected_color FFDC44 # Color de la opción seleccionada en el menú de servicio
|
service_menu.selected_color FFDC44 # Color de la opción seleccionada en el menú de servicio
|
||||||
service_menu.bg_color 003000F5 # Color de fondo del menú de servicio (RGBA hexadecimal)
|
service_menu.bg_color 000F00F5 # Color de fondo del menú de servicio (RGBA hexadecimal)
|
||||||
service_menu.drop_shadow false # ¿El menú de servicio tiene sombra?
|
service_menu.drop_shadow false # ¿El menú de servicio tiene sombra?
|
||||||
|
|
||||||
## --- INTRO ---
|
service_menu.window_message.bg_color 141E32F0 # Color de fondo de ventanas de mensaje (RGBA hexadecimal)
|
||||||
|
service_menu.window_message.border_color 6496C8FF # Color del borde de ventanas de mensaje (RGBA hexadecimal)
|
||||||
|
service_menu.window_message.title_color 6496C8FF # Color del título en ventanas de mensaje (RGBA hexadecimal)
|
||||||
|
service_menu.window_message.text_color DCDCDCFF # Color del texto en ventanas de mensaje (RGBA hexadecimal)
|
||||||
|
service_menu.window_message.padding 15.0f # Espaciado interno de ventanas de mensaje (píxeles)
|
||||||
|
service_menu.window_message.line_spacing 5.0f # Espaciado entre líneas de texto (píxeles)
|
||||||
|
service_menu.window_message.title_separator_spacing 20.0f # Espaciado entre título y contenido (píxeles)
|
||||||
|
service_menu.window_message.min_width 200.0f # Ancho mínimo de ventanas de mensaje (píxeles)
|
||||||
|
service_menu.window_message.min_height 32.0f # Alto mínimo de ventanas de mensaje (píxeles)
|
||||||
|
service_menu.window_message.max_width_ratio 0.8f # Ratio máximo de ancho respecto a pantalla (0.0-1.0)
|
||||||
|
service_menu.window_message.max_height_ratio 0.8f # Ratio máximo de alto respecto a pantalla (0.0-1.0)
|
||||||
|
service_menu.window_message.text_safety_margin 15.0f # Margen de seguridad para el texto (píxeles)
|
||||||
|
service_menu.window_message.animation_duration 0.3f # Duración de animaciones de ventanas (segundos)
|
||||||
|
|
||||||
|
# --- INTRO ---
|
||||||
intro.bg_color 4664BD # Color de fondo de la intro
|
intro.bg_color 4664BD # Color de fondo de la intro
|
||||||
intro.card_color CBDBFC # Color de las tarjetas en la intro
|
intro.card_color CBDBFC # Color de las tarjetas en la intro
|
||||||
intro.shadow_color 00000080 # Color de la sombra de las tarjetas en la intro
|
intro.shadow_color 00000080 # Color de la sombra de las tarjetas en la intro
|
||||||
intro.text_distance_from_bottom 48 # Posicion del texto
|
intro.text_distance_from_bottom 48 # Posicion del texto
|
||||||
|
|
||||||
## --- DEBUG ---
|
# --- DEBUG ---
|
||||||
debug.color 00FFFF # Color para elementos de depuración
|
debug.color 00FFFF # Color para elementos de depuración
|
||||||
|
|
||||||
## --- RESOURCE ---
|
# --- RESOURCE ---
|
||||||
resource.color FFFFFF # Color de recurso 1
|
resource.color FFFFFF # Color de recurso 1
|
||||||
resource.color FFFFFF # Color de recurso 2
|
resource.color FFFFFF # Color de recurso 2
|
||||||
|
|
||||||
|
# --- TABE ---
|
||||||
|
tabe.min_spawn_time 2.0f # Tiempo mínimo en minutos para que aparezca el Tabe
|
||||||
|
tabe.max_spawn_time 3.0f # Tiempo máximo en minutos para que aparezca el Tabe
|
||||||
|
|
||||||
|
# --- PLAYER ---
|
||||||
|
# Jugador 1 - Camiseta por defecto
|
||||||
|
player.default_shirt[0].darkest 028ECFFF # Tono más oscuro - bordes y contornos (Jugador 1, por defecto)
|
||||||
|
player.default_shirt[0].dark 0297DBFF # Tono oscuro - sombras (Jugador 1, por defecto)
|
||||||
|
player.default_shirt[0].base 029FE8FF # Tono principal - color base (Jugador 1, por defecto)
|
||||||
|
player.default_shirt[0].light 03A9F4FF # Tono claro - zonas iluminadas (Jugador 1, por defecto)
|
||||||
|
|
||||||
|
# Jugador 2 - Camiseta por defecto
|
||||||
|
player.default_shirt[1].darkest 8E8E8EFF # Tono más oscuro - bordes y contornos (Jugador 2, por defecto)
|
||||||
|
player.default_shirt[1].dark AEADADFF # Tono oscuro - sombras (Jugador 2, por defecto)
|
||||||
|
player.default_shirt[1].base E4E4E4FF # Tono principal - color base (Jugador 2, por defecto)
|
||||||
|
player.default_shirt[1].light F7F1F1FF # Tono claro - zonas iluminadas (Jugador 2, por defecto)
|
||||||
|
|
||||||
|
# Jugador 1 - Camiseta con 1 café
|
||||||
|
player.one_coffee_shirt[0].darkest 3D9C70FF # Tono más oscuro - bordes y contornos (Jugador 1, 1 café)
|
||||||
|
player.one_coffee_shirt[0].dark 4FA370FF # Tono oscuro - sombras (Jugador 1, 1 café)
|
||||||
|
player.one_coffee_shirt[0].base 5DDE70FF # Tono principal - color base (Jugador 1, 1 café)
|
||||||
|
player.one_coffee_shirt[0].light 7DF25CFF # Tono claro - zonas iluminadas (Jugador 1, 1 café)
|
||||||
|
|
||||||
|
# Jugador 1 - Camiseta con 2 cafés
|
||||||
|
player.two_coffee_shirt[0].darkest D6A41AFF # Tono más oscuro - bordes y contornos (Jugador 1, 2 cafés)
|
||||||
|
player.two_coffee_shirt[0].dark E3AE1BFF # Tono oscuro - sombras (Jugador 1, 2 cafés)
|
||||||
|
player.two_coffee_shirt[0].base EFB71DFF # Tono principal - color base (Jugador 1, 2 cafés)
|
||||||
|
player.two_coffee_shirt[0].light FCC11EFF # Tono claro - zonas iluminadas (Jugador 1, 2 cafés)
|
||||||
|
|
||||||
|
# Jugador 2 - Camiseta con 1 café
|
||||||
|
player.one_coffee_shirt[1].darkest 2E8B57FF # Tono más oscuro - bordes y contornos (Jugador 2, 1 café)
|
||||||
|
player.one_coffee_shirt[1].dark 3CB371FF # Tono oscuro - sombras (Jugador 2, 1 café)
|
||||||
|
player.one_coffee_shirt[1].base 48D181FF # Tono principal - color base (Jugador 2, 1 café)
|
||||||
|
player.one_coffee_shirt[1].light 55EF8DFF # Tono claro - zonas iluminadas (Jugador 2, 1 café)
|
||||||
|
|
||||||
|
# Jugador 2 - Camiseta con 2 cafés
|
||||||
|
player.two_coffee_shirt[1].darkest E08500FF # Tono más oscuro - bordes y contornos (Jugador 2, 2 cafés)
|
||||||
|
player.two_coffee_shirt[1].dark FA7D00FF # Tono oscuro - sombras (Jugador 2, 2 cafés)
|
||||||
|
player.two_coffee_shirt[1].base FAA200FF # Tono principal - color base (Jugador 2, 2 cafés)
|
||||||
|
player.two_coffee_shirt[1].light FA8500FF # Tono claro - zonas iluminadas (Jugador 2, 2 cafés)
|
||||||
|
|
||||||
|
# Colores de contorno de los jugadores
|
||||||
|
player.outline_color[0] 66323FFF # Color del contorno del sprite del Jugador 1
|
||||||
|
player.outline_color[1] 422028FF # Color del contorno del sprite del Jugador 2
|
||||||
@@ -1,26 +1,29 @@
|
|||||||
## --- GAME ---
|
# Coffee Crisis Arcade Edition - Fichero de parametros
|
||||||
game.item_size 20 # Tamaño de los items del juego (en píxeles)
|
# Formato: PARAMETRO VALOR
|
||||||
game.width 320 # Ancho de la resolución nativa del juego (en píxeles)
|
|
||||||
game.height 256 # Alto de la resolución nativa del juego (en píxeles)
|
|
||||||
game.play_area.rect.x 0 # Posición X de la zona jugable
|
|
||||||
game.play_area.rect.y 0 # Posición Y de la zona jugable
|
|
||||||
game.play_area.rect.w 320 # Ancho de la zona jugable
|
|
||||||
game.play_area.rect.h 216 # Alto de la zona jugable
|
|
||||||
game.name_entry_idle_time 10 # Segundos para introducir el nombre al finalizar la partida si no se pulsa nada
|
|
||||||
game.name_entry_total_time 60 # Segundos totales para introducir el nombre al finalizar la partida
|
|
||||||
game.hit_stop true # Indica si debe haber un paro cuando el jugador es golpeado por un globo
|
|
||||||
game.hit_stop_ms 500 # Cantidad de milisegundos que dura el hit_stop
|
|
||||||
|
|
||||||
## --- FADE ---
|
# --- GAME ---
|
||||||
fade.color 1F2B30 # Color hexadecimal para el efecto de fundido
|
game.item_size 20 # Tamaño de los items del juego (en píxeles)
|
||||||
fade.num_squares_width 160 # Número de cuadrados en el eje X para el fundido
|
game.item_text_outline_color E0E0E0F0 # Color del outline del texto de los items (RGBA hex)
|
||||||
fade.num_squares_height 128 # Número de cuadrados en el eje Y para el fundido
|
game.width 320 # Ancho de la resolución nativa del juego (en píxeles)
|
||||||
fade.random_squares_delay 1 # Delay entre aparición de cuadrados aleatorios (frames)
|
game.height 256 # Alto de la resolución nativa del juego (en píxeles)
|
||||||
fade.random_squares_mult 500 # Multiplicador para la velocidad de aparición aleatoria
|
game.play_area.rect.x 0 # Posición X de la zona jugable
|
||||||
fade.post_duration 80 # Duración tras el fundido (frames)
|
game.play_area.rect.y 0 # Posición Y de la zona jugable
|
||||||
fade.venetian_size 12 # Tamaño de las bandas para el efecto veneciano (en píxeles)
|
game.play_area.rect.w 320 # Ancho de la zona jugable
|
||||||
|
game.play_area.rect.h 216 # Alto de la zona jugable
|
||||||
|
game.name_entry_idle_time 10 # Segundos para introducir el nombre al finalizar la partida si no se pulsa nada
|
||||||
|
game.name_entry_total_time 60 # Segundos totales para introducir el nombre al finalizar la partida
|
||||||
|
game.hit_stop false # Indica si debe haber un paro cuando el jugador es golpeado por un globo
|
||||||
|
game.hit_stop_ms 500 # Cantidad de milisegundos que dura el hit_stop
|
||||||
|
|
||||||
## --- SCOREBOARD ---
|
# --- FADE ---
|
||||||
|
fade.color 1F2B30 # Color hexadecimal para el efecto de fundido
|
||||||
|
fade.num_squares_width 64 # Número de cuadrados en el eje X para el fundido
|
||||||
|
fade.num_squares_height 48 # Número de cuadrados en el eje Y para el fundido
|
||||||
|
fade.random_squares_duration_ms 1200 # Duración del fade en milisegundos
|
||||||
|
fade.post_duration_ms 500 # Duración tras el fundido en milisegundos
|
||||||
|
fade.venetian_size 12 # Tamaño de las bandas para el efecto veneciano (en píxeles)
|
||||||
|
|
||||||
|
# --- SCOREBOARD ---
|
||||||
scoreboard.rect.x 0 # Posición X del marcador
|
scoreboard.rect.x 0 # Posición X del marcador
|
||||||
scoreboard.rect.y 216 # Posición Y del marcador
|
scoreboard.rect.y 216 # Posición Y del marcador
|
||||||
scoreboard.rect.w 320 # Ancho del marcador
|
scoreboard.rect.w 320 # Ancho del marcador
|
||||||
@@ -35,17 +38,17 @@ scoreboard.text_color1 FFFFFF # Color principal del texto del marcad
|
|||||||
scoreboard.text_color2 FFFFFF # Color secundario del texto del marcador
|
scoreboard.text_color2 FFFFFF # Color secundario del texto del marcador
|
||||||
scoreboard.skip_countdown_value 8 # Valor para saltar la cuenta atrás (segundos)
|
scoreboard.skip_countdown_value 8 # Valor para saltar la cuenta atrás (segundos)
|
||||||
|
|
||||||
## --- TITLE ---
|
# --- TITLE ---
|
||||||
title.press_start_position 180 # Posición Y del texto "Press Start"
|
title.press_start_position 180 # Posición Y del texto "Press Start"
|
||||||
title.title_duration 800 # Duración de la pantalla de título (frames)
|
title.title_duration 800 # Duración de la pantalla de título (frames)
|
||||||
title.arcade_edition_position 123 # Posición Y del subtítulo "Arcade Edition"
|
title.arcade_edition_position 123 # Posición Y del subtítulo "Arcade Edition"
|
||||||
title.title_c_c_position 80 # Posición Y del título principal
|
title.title_c_c_position 80 # Posición Y del título principal
|
||||||
title.bg_color 41526F # Color de fondo en la sección titulo
|
title.bg_color 41526F # Color de fondo en la sección titulo
|
||||||
|
|
||||||
## --- BACKGROUND ---
|
# --- BACKGROUND ---
|
||||||
background.attenuate_color FFFFFF00 # Color de atenuación del fondo (RGBA hexadecimal)
|
background.attenuate_color FFFFFF00 # Color de atenuación del fondo (RGBA hexadecimal)
|
||||||
|
|
||||||
## --- BALLOONS ---
|
# --- BALLOONS ---
|
||||||
balloon.settings[0].vel 2.75f # Velocidad inicial del globo 1
|
balloon.settings[0].vel 2.75f # Velocidad inicial del globo 1
|
||||||
balloon.settings[0].grav 0.09f # Gravedad aplicada al globo 1
|
balloon.settings[0].grav 0.09f # Gravedad aplicada al globo 1
|
||||||
balloon.settings[1].vel 3.70f # Velocidad inicial del globo 2
|
balloon.settings[1].vel 3.70f # Velocidad inicial del globo 2
|
||||||
@@ -62,28 +65,86 @@ balloon.color[3] green # Color del globo que rebota
|
|||||||
|
|
||||||
balloon.bouncing_sound false # Indica si los globos hacer sonido al rebotar
|
balloon.bouncing_sound false # Indica si los globos hacer sonido al rebotar
|
||||||
|
|
||||||
## --- NOTIFICATION ---
|
# --- NOTIFICATION ---
|
||||||
notification.pos_v TOP # Posición vertical de la notificación (TOP/BOTTOM)
|
notification.pos_v TOP # Posición vertical de la notificación (TOP/BOTTOM)
|
||||||
notification.pos_h LEFT # Posición horizontal de la notificación (LEFT/RIGHT)
|
notification.pos_h LEFT # Posición horizontal de la notificación (LEFT/RIGHT)
|
||||||
notification.sound false # ¿La notificación reproduce sonido?
|
notification.sound false # ¿La notificación reproduce sonido?
|
||||||
notification.color 303030 # Color de fondo de la notificación (hexadecimal)
|
notification.color 303030 # Color de fondo de la notificación (hexadecimal)
|
||||||
|
|
||||||
## --- SERVICE MENU ---
|
# --- SERVICE MENU ---
|
||||||
service_menu.title_color 99FF62 # Color del título del menú de servicio
|
service_menu.title_color 99FF62 # Color del título del menú de servicio
|
||||||
service_menu.text_color FFFFFF # Color del texto del menú de servicio
|
service_menu.text_color FFFFFF # Color del texto del menú de servicio
|
||||||
service_menu.selected_color FFDC44 # Color de la opción seleccionada en el menú de servicio
|
service_menu.selected_color FFDC44 # Color de la opción seleccionada en el menú de servicio
|
||||||
service_menu.bg_color 000F00F5 # Color de fondo del menú de servicio (RGBA hexadecimal)
|
service_menu.bg_color 000F00F5 # Color de fondo del menú de servicio (RGBA hexadecimal)
|
||||||
service_menu.drop_shadow false # ¿El menú de servicio tiene sombra?
|
service_menu.drop_shadow false # ¿El menú de servicio tiene sombra?
|
||||||
|
|
||||||
## --- INTRO ---
|
service_menu.window_message.bg_color 141E32F0 # Color de fondo de ventanas de mensaje (RGBA hexadecimal)
|
||||||
intro.bg_color 4664BD # Color de fondo de la intro
|
service_menu.window_message.border_color 6496C8FF # Color del borde de ventanas de mensaje (RGBA hexadecimal)
|
||||||
intro.card_color CBDBFC # Color de las tarjetas en la intro
|
service_menu.window_message.title_color 6496C8FF # Color del título en ventanas de mensaje (RGBA hexadecimal)
|
||||||
intro.shadow_color 00000080 # Color de la sombra de las tarjetas en la intro
|
service_menu.window_message.text_color DCDCDCFF # Color del texto en ventanas de mensaje (RGBA hexadecimal)
|
||||||
intro.text_distance_from_bottom 48 # Posicion del texto
|
service_menu.window_message.padding 15.0f # Espaciado interno de ventanas de mensaje (píxeles)
|
||||||
|
service_menu.window_message.line_spacing 5.0f # Espaciado entre líneas de texto (píxeles)
|
||||||
|
service_menu.window_message.title_separator_spacing 20.0f # Espaciado entre título y contenido (píxeles)
|
||||||
|
service_menu.window_message.min_width 200.0f # Ancho mínimo de ventanas de mensaje (píxeles)
|
||||||
|
service_menu.window_message.min_height 32.0f # Alto mínimo de ventanas de mensaje (píxeles)
|
||||||
|
service_menu.window_message.max_width_ratio 0.8f # Ratio máximo de ancho respecto a pantalla (0.0-1.0)
|
||||||
|
service_menu.window_message.max_height_ratio 0.8f # Ratio máximo de alto respecto a pantalla (0.0-1.0)
|
||||||
|
service_menu.window_message.text_safety_margin 15.0f # Margen de seguridad para el texto (píxeles)
|
||||||
|
service_menu.window_message.animation_duration 0.3f # Duración de animaciones de ventanas (segundos)
|
||||||
|
|
||||||
## --- DEBUG ---
|
# --- INTRO ---
|
||||||
|
intro.bg_color 4664BD # Color de fondo de la intro
|
||||||
|
intro.card_color CBDBFC # Color de las tarjetas en la intro
|
||||||
|
intro.shadow_color 00000080 # Color de la sombra de las tarjetas en la intro
|
||||||
|
intro.text_distance_from_bottom 48 # Posición del texto desde la parte inferior
|
||||||
|
|
||||||
|
# --- DEBUG ---
|
||||||
debug.color 00FFFF # Color para elementos de depuración
|
debug.color 00FFFF # Color para elementos de depuración
|
||||||
|
|
||||||
## --- RESOURCE ---
|
# --- RESOURCE ---
|
||||||
resource.color FFFFFF # Color de recurso 1
|
resource.color FFFFFF # Color de recursos
|
||||||
resource.color FFFFFF # Color de recurso 2
|
|
||||||
|
# --- TABE ---
|
||||||
|
tabe.min_spawn_time 2.0f # Tiempo mínimo en segundos para que aparezca el Tabe
|
||||||
|
tabe.max_spawn_time 3.0f # Tiempo máximo en segundos para que aparezca el Tabe
|
||||||
|
|
||||||
|
# --- PLAYER ---
|
||||||
|
# Jugador 1 - Camiseta por defecto
|
||||||
|
player.default_shirt[0].darkest 028ECFFF # Tono más oscuro - bordes y contornos (Jugador 1, por defecto)
|
||||||
|
player.default_shirt[0].dark 0297DBFF # Tono oscuro - sombras (Jugador 1, por defecto)
|
||||||
|
player.default_shirt[0].base 029FE8FF # Tono principal - color base (Jugador 1, por defecto)
|
||||||
|
player.default_shirt[0].light 03A9F4FF # Tono claro - zonas iluminadas (Jugador 1, por defecto)
|
||||||
|
|
||||||
|
# Jugador 2 - Camiseta por defecto
|
||||||
|
player.default_shirt[1].darkest 8E8E8EFF # Tono más oscuro - bordes y contornos (Jugador 2, por defecto)
|
||||||
|
player.default_shirt[1].dark AEADADFF # Tono oscuro - sombras (Jugador 2, por defecto)
|
||||||
|
player.default_shirt[1].base E4E4E4FF # Tono principal - color base (Jugador 2, por defecto)
|
||||||
|
player.default_shirt[1].light F7F1F1FF # Tono claro - zonas iluminadas (Jugador 2, por defecto)
|
||||||
|
|
||||||
|
# Jugador 1 - Camiseta con 1 café
|
||||||
|
player.one_coffee_shirt[0].darkest 3D9C70FF # Tono más oscuro - bordes y contornos (Jugador 1, 1 café)
|
||||||
|
player.one_coffee_shirt[0].dark 4FA370FF # Tono oscuro - sombras (Jugador 1, 1 café)
|
||||||
|
player.one_coffee_shirt[0].base 5DDE70FF # Tono principal - color base (Jugador 1, 1 café)
|
||||||
|
player.one_coffee_shirt[0].light 7DF25CFF # Tono claro - zonas iluminadas (Jugador 1, 1 café)
|
||||||
|
|
||||||
|
# Jugador 1 - Camiseta con 2 cafés
|
||||||
|
player.two_coffee_shirt[0].darkest D6A41AFF # Tono más oscuro - bordes y contornos (Jugador 1, 2 cafés)
|
||||||
|
player.two_coffee_shirt[0].dark E3AE1BFF # Tono oscuro - sombras (Jugador 1, 2 cafés)
|
||||||
|
player.two_coffee_shirt[0].base EFB71DFF # Tono principal - color base (Jugador 1, 2 cafés)
|
||||||
|
player.two_coffee_shirt[0].light FCC11EFF # Tono claro - zonas iluminadas (Jugador 1, 2 cafés)
|
||||||
|
|
||||||
|
# Jugador 2 - Camiseta con 1 café
|
||||||
|
player.one_coffee_shirt[1].darkest 2E8B57FF # Tono más oscuro - bordes y contornos (Jugador 2, 1 café)
|
||||||
|
player.one_coffee_shirt[1].dark 3CB371FF # Tono oscuro - sombras (Jugador 2, 1 café)
|
||||||
|
player.one_coffee_shirt[1].base 48D181FF # Tono principal - color base (Jugador 2, 1 café)
|
||||||
|
player.one_coffee_shirt[1].light 55EF8DFF # Tono claro - zonas iluminadas (Jugador 2, 1 café)
|
||||||
|
|
||||||
|
# Jugador 2 - Camiseta con 2 cafés
|
||||||
|
player.two_coffee_shirt[1].darkest E08500FF # Tono más oscuro - bordes y contornos (Jugador 2, 2 cafés)
|
||||||
|
player.two_coffee_shirt[1].dark FA7D00FF # Tono oscuro - sombras (Jugador 2, 2 cafés)
|
||||||
|
player.two_coffee_shirt[1].base FAA200FF # Tono principal - color base (Jugador 2, 2 cafés)
|
||||||
|
player.two_coffee_shirt[1].light FA8500FF # Tono claro - zonas iluminadas (Jugador 2, 2 cafés)
|
||||||
|
|
||||||
|
# Colores de contorno de los jugadores
|
||||||
|
player.outline_color[0] 66323FFF # Color del contorno del sprite del Jugador 1
|
||||||
|
player.outline_color[1] 422028FF # Color del contorno del sprite del Jugador 2
|
||||||
150
data/config/param_red.txt
Normal file
150
data/config/param_red.txt
Normal file
@@ -0,0 +1,150 @@
|
|||||||
|
# Coffee Crisis Arcade Edition - Fichero de parametros - RED THEME
|
||||||
|
# Formato: PARAMETRO VALOR
|
||||||
|
|
||||||
|
# --- GAME ---
|
||||||
|
game.item_size 20 # Tamaño de los items del juego (en píxeles)
|
||||||
|
game.item_text_outline_color FFB8B8F0 # Color del outline del texto de los items (RGBA hex) - Rojo claro
|
||||||
|
game.width 320 # Ancho de la resolución nativa del juego (en píxeles)
|
||||||
|
game.height 256 # Alto de la resolución nativa del juego (en píxeles)
|
||||||
|
game.play_area.rect.x 0 # Posición X de la zona jugable
|
||||||
|
game.play_area.rect.y 0 # Posición Y de la zona jugable
|
||||||
|
game.play_area.rect.w 320 # Ancho de la zona jugable
|
||||||
|
game.play_area.rect.h 216 # Alto de la zona jugable
|
||||||
|
game.name_entry_idle_time 10 # Segundos para introducir el nombre al finalizar la partida si no se pulsa nada
|
||||||
|
game.name_entry_total_time 60 # Segundos totales para introducir el nombre al finalizar la partida
|
||||||
|
game.hit_stop false # Indica si debe haber un paro cuando el jugador es golpeado por un globo
|
||||||
|
game.hit_stop_ms 500 # Cantidad de milisegundos que dura el hit_stop
|
||||||
|
|
||||||
|
# --- FADE ---
|
||||||
|
fade.color 5C1F1F # Color hexadecimal para el efecto de fundido - Rojo oscuro
|
||||||
|
fade.num_squares_width 64 # Número de cuadrados en el eje X para el fundido
|
||||||
|
fade.num_squares_height 48 # Número de cuadrados en el eje Y para el fundido
|
||||||
|
fade.random_squares_duration_ms 1200 # Duración del fade en milisegundos
|
||||||
|
fade.post_duration_ms 500 # Duración tras el fundido en milisegundos
|
||||||
|
fade.venetian_size 12 # Tamaño de las bandas para el efecto veneciano (en píxeles)
|
||||||
|
|
||||||
|
# --- SCOREBOARD ---
|
||||||
|
scoreboard.rect.x 0 # Posición X del marcador
|
||||||
|
scoreboard.rect.y 216 # Posición Y del marcador
|
||||||
|
scoreboard.rect.w 320 # Ancho del marcador
|
||||||
|
scoreboard.rect.h 40 # Alto del marcador
|
||||||
|
scoreboard.separator_autocolor true # ¿El separador usa color automático?
|
||||||
|
scoreboard.separator_color 2B0D0D # Color del separador - Rojo muy oscuro
|
||||||
|
scoreboard.easy_color 8B4A2F # Color para la dificultad fácil - Marrón rojizo
|
||||||
|
scoreboard.normal_color 6B2F2F # Color para la dificultad normal - Rojo medio
|
||||||
|
scoreboard.hard_color A73030 # Color para la dificultad difícil - Rojo fuerte
|
||||||
|
scoreboard.text_autocolor true # ¿El texto usa color automático?
|
||||||
|
scoreboard.text_color1 FFE6E6 # Color principal del texto del marcador - Blanco rosado
|
||||||
|
scoreboard.text_color2 FFE6E6 # Color secundario del texto del marcador - Blanco rosado
|
||||||
|
scoreboard.skip_countdown_value 8 # Valor para saltar la cuenta atrás (segundos)
|
||||||
|
|
||||||
|
# --- TITLE ---
|
||||||
|
title.press_start_position 180 # Posición Y del texto "Press Start"
|
||||||
|
title.title_duration 800 # Duración de la pantalla de título (frames)
|
||||||
|
title.arcade_edition_position 123 # Posición Y del subtítulo "Arcade Edition"
|
||||||
|
title.title_c_c_position 80 # Posición Y del título principal
|
||||||
|
title.bg_color 8B4A3A # Color de fondo en la sección titulo - Marrón rojizo
|
||||||
|
|
||||||
|
# --- BACKGROUND ---
|
||||||
|
background.attenuate_color FF4A3A40 # Color de atenuación del fondo (RGBA hexadecimal) - Blanco rosado
|
||||||
|
|
||||||
|
# --- BALLOONS ---
|
||||||
|
balloon.settings[0].vel 2.75f # Velocidad inicial del globo 1
|
||||||
|
balloon.settings[0].grav 0.09f # Gravedad aplicada al globo 1
|
||||||
|
balloon.settings[1].vel 3.70f # Velocidad inicial del globo 2
|
||||||
|
balloon.settings[1].grav 0.10f # Gravedad aplicada al globo 2
|
||||||
|
balloon.settings[2].vel 4.70f # Velocidad inicial del globo 3
|
||||||
|
balloon.settings[2].grav 0.10f # Gravedad aplicada al globo 3
|
||||||
|
balloon.settings[3].vel 5.45f # Velocidad inicial del globo 4
|
||||||
|
balloon.settings[3].grav 0.10f # Gravedad aplicada al globo 4
|
||||||
|
|
||||||
|
balloon.color[0] orange # Color de creación del globo normal
|
||||||
|
balloon.color[1] red # Color del globo normal
|
||||||
|
balloon.color[2] blue # Color de creación del globo que rebota
|
||||||
|
balloon.color[3] green # Color del globo que rebota
|
||||||
|
|
||||||
|
balloon.bouncing_sound false # Indica si los globos hacer sonido al rebotar
|
||||||
|
|
||||||
|
# --- NOTIFICATION ---
|
||||||
|
notification.pos_v TOP # Posición vertical de la notificación (TOP/BOTTOM)
|
||||||
|
notification.pos_h LEFT # Posición horizontal de la notificación (LEFT/RIGHT)
|
||||||
|
notification.sound false # ¿La notificación reproduce sonido?
|
||||||
|
notification.color 4D1A1A # Color de fondo de la notificación - Rojo oscuro
|
||||||
|
|
||||||
|
# --- SERVICE MENU ---
|
||||||
|
service_menu.title_color FF9966 # Color del título del menú de servicio - Naranja claro
|
||||||
|
service_menu.text_color FFE6E6 # Color del texto del menú de servicio - Blanco rosado
|
||||||
|
service_menu.selected_color FFB366 # Color de la opción seleccionada - Naranja dorado
|
||||||
|
service_menu.bg_color 331A0AF5 # Color de fondo del menú de servicio - Marrón rojizo oscuro con alpha
|
||||||
|
service_menu.drop_shadow false # ¿El menú de servicio tiene sombra?
|
||||||
|
|
||||||
|
service_menu.window_message.bg_color 4D1A1AF0 # Color de fondo de ventanas - Rojo oscuro con alpha
|
||||||
|
service_menu.window_message.border_color CC6633FF # Color del borde de ventanas - Naranja rojizo
|
||||||
|
service_menu.window_message.title_color CC6633FF # Color del título en ventanas - Naranja rojizo
|
||||||
|
service_menu.window_message.text_color FFE6E6FF # Color del texto en ventanas - Blanco rosado
|
||||||
|
service_menu.window_message.padding 15.0f # Espaciado interno de ventanas de mensaje (píxeles)
|
||||||
|
service_menu.window_message.line_spacing 5.0f # Espaciado entre líneas de texto (píxeles)
|
||||||
|
service_menu.window_message.title_separator_spacing 20.0f # Espaciado entre título y contenido (píxeles)
|
||||||
|
service_menu.window_message.min_width 200.0f # Ancho mínimo de ventanas de mensaje (píxeles)
|
||||||
|
service_menu.window_message.min_height 32.0f # Alto mínimo de ventanas de mensaje (píxeles)
|
||||||
|
service_menu.window_message.max_width_ratio 0.8f # Ratio máximo de ancho respecto a pantalla (0.0-1.0)
|
||||||
|
service_menu.window_message.max_height_ratio 0.8f # Ratio máximo de alto respecto a pantalla (0.0-1.0)
|
||||||
|
service_menu.window_message.text_safety_margin 15.0f # Margen de seguridad para el texto (píxeles)
|
||||||
|
service_menu.window_message.animation_duration 0.3f # Duración de animaciones de ventanas (segundos)
|
||||||
|
|
||||||
|
# --- INTRO ---
|
||||||
|
intro.bg_color B8664D # Color de fondo de la intro - Naranja tierra
|
||||||
|
intro.card_color FFE6CC # Color de las tarjetas en la intro - Crema rojizo
|
||||||
|
intro.shadow_color 66000080 # Color de la sombra de las tarjetas - Rojo muy oscuro con alpha
|
||||||
|
intro.text_distance_from_bottom 48 # Posición del texto desde la parte inferior
|
||||||
|
|
||||||
|
# --- DEBUG ---
|
||||||
|
debug.color FF6666 # Color para elementos de depuración - Rojo claro
|
||||||
|
|
||||||
|
# --- RESOURCE ---
|
||||||
|
resource.color FFE6E6 # Color de recursos - Blanco rosado
|
||||||
|
|
||||||
|
# --- TABE ---
|
||||||
|
tabe.min_spawn_time 2.0f # Tiempo mínimo en segundos para que aparezca el Tabe
|
||||||
|
tabe.max_spawn_time 3.0f # Tiempo máximo en segundos para que aparezca el Tabe
|
||||||
|
|
||||||
|
# --- PLAYER ---
|
||||||
|
# Jugador 1 - Camiseta por defecto (tonos rojos)
|
||||||
|
player.default_shirt[0].darkest B33030FF # Tono más oscuro - Rojo fuerte
|
||||||
|
player.default_shirt[0].dark CC4040FF # Tono oscuro - Rojo medio
|
||||||
|
player.default_shirt[0].base E65050FF # Tono principal - Rojo claro
|
||||||
|
player.default_shirt[0].light FF6666FF # Tono claro - Rojo muy claro
|
||||||
|
|
||||||
|
# Jugador 2 - Camiseta por defecto (tonos naranjas)
|
||||||
|
player.default_shirt[1].darkest B36030FF # Tono más oscuro - Naranja oscuro
|
||||||
|
player.default_shirt[1].dark CC7540FF # Tono oscuro - Naranja medio
|
||||||
|
player.default_shirt[1].base E68A50FF # Tono principal - Naranja claro
|
||||||
|
player.default_shirt[1].light FF9966FF # Tono claro - Naranja muy claro
|
||||||
|
|
||||||
|
# Jugador 1 - Camiseta con 1 café (tonos rojizos más intensos)
|
||||||
|
player.one_coffee_shirt[0].darkest 8B2635FF # Tono más oscuro - Rojo granate
|
||||||
|
player.one_coffee_shirt[0].dark A53040FF # Tono oscuro - Rojo granate claro
|
||||||
|
player.one_coffee_shirt[0].base BF3A50FF # Tono principal - Rojo vibrante
|
||||||
|
player.one_coffee_shirt[0].light D94460FF # Tono claro - Rojo vibrante claro
|
||||||
|
|
||||||
|
# Jugador 1 - Camiseta con 2 cafés (tonos naranja dorado)
|
||||||
|
player.two_coffee_shirt[0].darkest CC6600FF # Tono más oscuro - Naranja dorado oscuro
|
||||||
|
player.two_coffee_shirt[0].dark E6750AFF # Tono oscuro - Naranja dorado
|
||||||
|
player.two_coffee_shirt[0].base FF8514FF # Tono principal - Naranja dorado claro
|
||||||
|
player.two_coffee_shirt[0].light FF991EFF # Tono claro - Naranja dorado muy claro
|
||||||
|
|
||||||
|
# Jugador 2 - Camiseta con 1 café (tonos terracotas)
|
||||||
|
player.one_coffee_shirt[1].darkest A0472DFF # Tono más oscuro - Terracota oscuro
|
||||||
|
player.one_coffee_shirt[1].dark B8553AFF # Tono oscuro - Terracota medio
|
||||||
|
player.one_coffee_shirt[1].base D06347FF # Tono principal - Terracota claro
|
||||||
|
player.one_coffee_shirt[1].light E87154FF # Tono claro - Terracota muy claro
|
||||||
|
|
||||||
|
# Jugador 2 - Camiseta con 2 cafés (tonos naranjas cálidos)
|
||||||
|
player.two_coffee_shirt[1].darkest CC5500FF # Tono más oscuro - Naranja intenso
|
||||||
|
player.two_coffee_shirt[1].dark E66600FF # Tono oscuro - Naranja fuerte
|
||||||
|
player.two_coffee_shirt[1].base FF7700FF # Tono principal - Naranja brillante
|
||||||
|
player.two_coffee_shirt[1].light FF8800FF # Tono claro - Naranja muy brillante
|
||||||
|
|
||||||
|
# Colores de contorno de los jugadores
|
||||||
|
player.outline_color[0] 994D33FF # Color del contorno del Jugador 1 - Marrón rojizo
|
||||||
|
player.outline_color[1] 664433FF # Color del contorno del Jugador 2 - Marrón tierra
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# Archivo de configuración de pools de formaciones de globos
|
# Coffee Crisis Arcade Edition - Archivo de configuración de pools de formaciones de globos
|
||||||
# Formato: POOL: <id> FORMATIONS: <id1>, <id2>, <id3>, ...
|
# Formato: POOL: <id> FORMATIONS: <id1>, <id2>, <id3>, ...
|
||||||
# Los IDs de formación pueden repetirse
|
# Los IDs de formación pueden repetirse
|
||||||
# Los pools no necesitan estar ordenados ni ser consecutivos
|
# Los pools no necesitan estar ordenados ni ser consecutivos
|
||||||
|
|||||||
19
data/config/stages.txt
Normal file
19
data/config/stages.txt
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# Coffee Crisis Arcade Edition - Archivo de configuración de fases
|
||||||
|
# Formato: power_to_complete,min_menace,max_menace,name
|
||||||
|
# Líneas que empiezan con # son comentarios y se ignoran
|
||||||
|
|
||||||
|
# Fases iniciales - Tutorial y aprendizaje
|
||||||
|
200, 11, 19, Tutorial
|
||||||
|
300, 15, 23, Primeros pasos
|
||||||
|
|
||||||
|
# Fases intermedias - Incremento de dificultad
|
||||||
|
400, 19, 27, Intensificación
|
||||||
|
400, 19, 27, Persistencia
|
||||||
|
400, 23, 31, Desafío medio
|
||||||
|
400, 23, 31, Resistencia
|
||||||
|
|
||||||
|
# Fases avanzadas - Desafío final
|
||||||
|
600, 27, 35, Aproximación final
|
||||||
|
600, 27, 35, Penúltimo obstáculo
|
||||||
|
700, 31, 39, Clímax
|
||||||
|
950, 35, 47, Maestría
|
||||||
BIN
data/font/04b_25_white.png
Normal file
BIN
data/font/04b_25_white.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
@@ -114,15 +114,22 @@ frames=42,42,42,42,42,42,43,44,45,46,46,46,46,46,46,45,45,45,46,46,46,45,45,45,4
|
|||||||
[/animation]
|
[/animation]
|
||||||
|
|
||||||
[animation]
|
[animation]
|
||||||
name=dead
|
name=dizzy
|
||||||
speed=5
|
speed=5
|
||||||
loop=0
|
loop=0
|
||||||
frames=47,48,49,50,51,52,53
|
frames=47,48,49,50,51,52,53
|
||||||
[/animation]
|
[/animation]
|
||||||
|
|
||||||
|
[animation]
|
||||||
|
name=recover
|
||||||
|
speed=3
|
||||||
|
loop=-1
|
||||||
|
frames=54,54,54,54,55,56,57,58,58,58,59,60,61,58,59,60,61,58,59,60,61,62,62,62,62
|
||||||
|
[/animation]
|
||||||
|
|
||||||
[animation]
|
[animation]
|
||||||
name=hello
|
name=hello
|
||||||
speed=3
|
speed=3
|
||||||
loop=-1
|
loop=-1
|
||||||
frames=54,55,56,57,58,59,60,61,62,63,64,64,64,64,64,64,64,64,64,64,64,64,64,65,66,67,68,69,70,71,72,73,73,72,71,70,70,71,72,73,73,72,71,70,70,71,72,73,73,72,71,70,70,71,72,73,73,72,71,70,69,68,67,66,65,64,63,62,61,60,59,58,57,56,55,54
|
frames=63,64,65,66,67,68,69,70,71,72,73,73,73,73,73,73,73,73,73,73,73,73,73,74,75,76,77,78,79,80,81,82,82,81,80,79,79,80,81,82,82,81,80,79,79,80,81,82,82,81,80,79,79,80,81,82,82,81,80,79,78,77,76,75,74,73,72,71,70,69,68,67,66,65,64,63
|
||||||
[/animation]
|
[/animation]
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 16 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 16 KiB |
@@ -2,8 +2,9 @@
|
|||||||
"[CREDITS] PROGRAMMED_AND_DESIGNED_BY": "PROGRAMAT I DISSENYAT PER",
|
"[CREDITS] PROGRAMMED_AND_DESIGNED_BY": "PROGRAMAT I DISSENYAT PER",
|
||||||
"[CREDITS] PIXELART_DRAWN_BY": "GRAFICS DIBUIXATS PER",
|
"[CREDITS] PIXELART_DRAWN_BY": "GRAFICS DIBUIXATS PER",
|
||||||
"[CREDITS] MUSIC_COMPOSED_BY": "MUSICA COMPOSADA PER",
|
"[CREDITS] MUSIC_COMPOSED_BY": "MUSICA COMPOSADA PER",
|
||||||
"[CREDITS] SOUND_EFFECTS": "EFECTES DE SO",
|
"[CREDITS] SOUND_EFFECTS": "EFECTES DE SO PER",
|
||||||
|
|
||||||
|
"[DEFINE_BUTTONS] TITLE": "define buttons title",
|
||||||
"[DEFINE_BUTTONS] FIRE_LEFT": "Disparar cap a l'esquerra",
|
"[DEFINE_BUTTONS] FIRE_LEFT": "Disparar cap a l'esquerra",
|
||||||
"[DEFINE_BUTTONS] FIRE_UP": "Disparar cap amunt",
|
"[DEFINE_BUTTONS] FIRE_UP": "Disparar cap amunt",
|
||||||
"[DEFINE_BUTTONS] FIRE_RIGHT": "Disparar cap a la dreta",
|
"[DEFINE_BUTTONS] FIRE_RIGHT": "Disparar cap a la dreta",
|
||||||
@@ -11,24 +12,30 @@
|
|||||||
"[DEFINE_BUTTONS] SERVICE_MENU": "Menu de servei",
|
"[DEFINE_BUTTONS] SERVICE_MENU": "Menu de servei",
|
||||||
"[DEFINE_BUTTONS] PLAYER": "Jugador",
|
"[DEFINE_BUTTONS] PLAYER": "Jugador",
|
||||||
"[DEFINE_BUTTONS] KEYBOARD": "Teclat",
|
"[DEFINE_BUTTONS] KEYBOARD": "Teclat",
|
||||||
|
"[DEFINE_BUTTONS] CONFIGURATION_COMPLETE" : "Configuracio completada",
|
||||||
|
"[DEFINE_BUTTONS] CONFIGURING" : "Configurant",
|
||||||
|
"[DEFINE_BUTTONS] PRESS_BUTTON_FOR" : "Prem un boto per a",
|
||||||
|
"[DEFINE_BUTTONS] CONFIGURED" : "configurat",
|
||||||
|
|
||||||
"[GAME_TEXT] 1": "Felicitats!!",
|
"[GAME_TEXT] 1": "Felicitats!",
|
||||||
"[GAME_TEXT] 2": " fases mes!",
|
"[GAME_TEXT] 2": "Queden ",
|
||||||
|
"[GAME_TEXT] 2A": " fases mes!",
|
||||||
"[GAME_TEXT] 3": "Ultima fase!",
|
"[GAME_TEXT] 3": "Ultima fase!",
|
||||||
"[GAME_TEXT] 4": "SuperPoder!",
|
"[GAME_TEXT] 4": "SuperPoder!",
|
||||||
"[GAME_TEXT] 5": "+1 Colp",
|
"[GAME_TEXT] 5": "+1 Colp",
|
||||||
"[GAME_TEXT] 6": "Temps!",
|
"[GAME_TEXT] 6": "Temps!",
|
||||||
"[GAME_TEXT] 7": "Endavant!",
|
"[GAME_TEXT] 7": "Endavant!",
|
||||||
"[GAME_TEXT] 8": "1.000.000 de punts!",
|
"[GAME_TEXT] 8": "1.000.000 de punts!",
|
||||||
|
"[GAME_TEXT] THANK_YOU": "Gracies!",
|
||||||
|
|
||||||
"[HIGHSCORE_TABLE] CAPTION": "Millors puntuacions",
|
"[HIGHSCORE_TABLE] CAPTION": "Millors puntuacions",
|
||||||
|
|
||||||
"[INSTRUCTIONS] 01": "Objectiu",
|
"[INSTRUCTIONS] 01": "Objectiu",
|
||||||
"[INSTRUCTIONS] 02": "HAS D'EXPLOTAR",
|
"[INSTRUCTIONS] 02": "HAS D'EXPLOTAR TANTS",
|
||||||
"[INSTRUCTIONS] 03": "TANTS GLOBUS COM PUGUES",
|
"[INSTRUCTIONS] 03": "GLOBOS COM PUGUES",
|
||||||
"[INSTRUCTIONS] 04": "LA DIFICULTAT AUGMENTA",
|
"[INSTRUCTIONS] 04": "LA DIFICULTAT AUGMENTA",
|
||||||
"[INSTRUCTIONS] 05": "A MESURA QUE VAS PUNTUANT",
|
"[INSTRUCTIONS] 05": "A MESURA QUE VAS PUNTUANT",
|
||||||
"[INSTRUCTIONS] 06": "Objectes",
|
"[INSTRUCTIONS] 06": "Objectes de bonus",
|
||||||
"[INSTRUCTIONS] 07": "1.000 PUNTS",
|
"[INSTRUCTIONS] 07": "1.000 PUNTS",
|
||||||
"[INSTRUCTIONS] 08": "2.500 PUNTS",
|
"[INSTRUCTIONS] 08": "2.500 PUNTS",
|
||||||
"[INSTRUCTIONS] 09": "5.000 PUNTS",
|
"[INSTRUCTIONS] 09": "5.000 PUNTS",
|
||||||
@@ -60,6 +67,8 @@
|
|||||||
"[NOTIFICATIONS] 13": "Filtre",
|
"[NOTIFICATIONS] 13": "Filtre",
|
||||||
"[NOTIFICATIONS] 14": "Sincronisme vertical",
|
"[NOTIFICATIONS] 14": "Sincronisme vertical",
|
||||||
"[NOTIFICATIONS] 15": "Reiniciar",
|
"[NOTIFICATIONS] 15": "Reiniciar",
|
||||||
|
"[NOTIFICATIONS] CONNECTED": "conectat",
|
||||||
|
"[NOTIFICATIONS] DISCONNECTED": "desconectat",
|
||||||
|
|
||||||
"[RESOURCE] LOADING": "Carregant",
|
"[RESOURCE] LOADING": "Carregant",
|
||||||
|
|
||||||
@@ -92,6 +101,16 @@
|
|||||||
"[SERVICE_MENU] HARD": "Dificil",
|
"[SERVICE_MENU] HARD": "Dificil",
|
||||||
"[SERVICE_MENU] NEED_RESTART_MESSAGE": "Reiniciar per aplicar canvis",
|
"[SERVICE_MENU] NEED_RESTART_MESSAGE": "Reiniciar per aplicar canvis",
|
||||||
"[SERVICE_MENU] ENABLE_SHUTDOWN": "Permetre apagar el sistema",
|
"[SERVICE_MENU] ENABLE_SHUTDOWN": "Permetre apagar el sistema",
|
||||||
|
"[SERVICE_MENU] CONTROLS": "Controls",
|
||||||
|
"[SERVICE_MENU] KEYBOARD": "Teclat",
|
||||||
|
"[SERVICE_MENU] PLAYER1": "Jugador 1",
|
||||||
|
"[SERVICE_MENU] PLAYER2": "Jugador 2",
|
||||||
|
"[SERVICE_MENU] CONTROLLER1": "Mando 1",
|
||||||
|
"[SERVICE_MENU] CONTROLLER2": "Mando 2",
|
||||||
|
"[SERVICE_MENU] CONFIGURE1": "Configurar Mando 1",
|
||||||
|
"[SERVICE_MENU] CONFIGURE2": "Configurar Mando 2",
|
||||||
|
"[SERVICE_MENU] NO_CONTROLLER": "[ Desconectat ]",
|
||||||
|
"[SERVICE_MENU] SWAP_CONTROLLERS": "Intercanvia mandos",
|
||||||
|
|
||||||
"[SCOREBOARD] 1": "Jugador 1",
|
"[SCOREBOARD] 1": "Jugador 1",
|
||||||
"[SCOREBOARD] 2": "Jugador 2",
|
"[SCOREBOARD] 2": "Jugador 2",
|
||||||
|
|||||||
@@ -1,38 +1,44 @@
|
|||||||
{
|
{
|
||||||
"[CREDITS] PROGRAMMED_AND_DESIGNED_BY": "PROGRAMMED AND DESIGNED BY",
|
"[CREDITS] PROGRAMMED_AND_DESIGNED_BY": "PROGRAMMED AND DESIGNED BY",
|
||||||
"[CREDITS] PIXELART_DRAWN_BY" : "PIXELART DRAWN BY",
|
"[CREDITS] PIXELART_DRAWN_BY" : "PIXELART BY",
|
||||||
"[CREDITS] MUSIC_COMPOSED_BY" : "MUSIC COMPOSED BY",
|
"[CREDITS] MUSIC_COMPOSED_BY" : "MUSIC COMPOSED BY",
|
||||||
"[CREDITS] SOUND_EFFECTS" : "SOUND EFFECTS",
|
"[CREDITS] SOUND_EFFECTS" : "SOUND EFFECTS BY",
|
||||||
|
|
||||||
"[DEFINE_BUTTONS] FIRE_LEFT" : "Fire left",
|
"[DEFINE_BUTTONS] FIRE_LEFT" : "Fire left",
|
||||||
"[DEFINE_BUTTONS] FIRE_UP" : "Fire up",
|
"[DEFINE_BUTTONS] FIRE_UP" : "Fire up",
|
||||||
"[DEFINE_BUTTONS] FIRE_RIGHT" : "Fire right",
|
"[DEFINE_BUTTONS] FIRE_RIGHT" : "Fire right",
|
||||||
"[DEFINE_BUTTONS] START" : "Start",
|
"[DEFINE_BUTTONS] START" : "Start",
|
||||||
"[DEFINE_BUTTONS] SERVICE_MENU": "Service menu",
|
"[DEFINE_BUTTONS] SERVICE_MENU" : "Service menu",
|
||||||
"[DEFINE_BUTTONS] PLAYER" : "Player",
|
"[DEFINE_BUTTONS] PLAYER" : "Player",
|
||||||
"[DEFINE_BUTTONS] KEYBOARD" : "Keyboard",
|
"[DEFINE_BUTTONS] KEYBOARD" : "Keyboard",
|
||||||
|
"[DEFINE_BUTTONS] CONFIGURATION_COMPLETE": "Configuration complete",
|
||||||
|
"[DEFINE_BUTTONS] CONFIGURING" : "Configuring",
|
||||||
|
"[DEFINE_BUTTONS] PRESS_BUTTON_FOR" : "Press a button for",
|
||||||
|
"[DEFINE_BUTTONS] CONFIGURED" : "Configured",
|
||||||
|
|
||||||
"[GAME_TEXT] 1": "Congratulations!!",
|
"[GAME_TEXT] 1": "Congratulations!",
|
||||||
"[GAME_TEXT] 2": " stages left!",
|
"[GAME_TEXT] 2": "",
|
||||||
|
"[GAME_TEXT] 2A": " stages left!",
|
||||||
"[GAME_TEXT] 3": "Last stage!",
|
"[GAME_TEXT] 3": "Last stage!",
|
||||||
"[GAME_TEXT] 4": "PowerUp",
|
"[GAME_TEXT] 4": "PowerUp",
|
||||||
"[GAME_TEXT] 5": "+1 Hit",
|
"[GAME_TEXT] 5": "+1 Hit",
|
||||||
"[GAME_TEXT] 6": "Stop!",
|
"[GAME_TEXT] 6": "Stop!",
|
||||||
"[GAME_TEXT] 7": "Get Ready!",
|
"[GAME_TEXT] 7": "Get Ready!",
|
||||||
"[GAME_TEXT] 8": "1.000.000 points!",
|
"[GAME_TEXT] 8": "1,000,000 points!",
|
||||||
|
"[GAME_TEXT] THANK_YOU": "Thank you!",
|
||||||
|
|
||||||
"[HIGHSCORE_TABLE] CAPTION": "Best scores",
|
"[HIGHSCORE_TABLE] CAPTION": "Best scores",
|
||||||
|
|
||||||
"[INSTRUCTIONS] 01": "OBJECTIVE",
|
"[INSTRUCTIONS] 01": "OBJECTIVE",
|
||||||
"[INSTRUCTIONS] 02": "YOU HAVE TO POP AS MANY",
|
"[INSTRUCTIONS] 02": "POP AS MANY BALLOONS",
|
||||||
"[INSTRUCTIONS] 03": "BALLOONS AS YOU CAN",
|
"[INSTRUCTIONS] 03": "AS YOU CAN",
|
||||||
"[INSTRUCTIONS] 04": "DIFFICULTY WILL BE INCREASED",
|
"[INSTRUCTIONS] 04": "DIFFICULTY INCREASES",
|
||||||
"[INSTRUCTIONS] 05": "AS YOU SCORE POINTS",
|
"[INSTRUCTIONS] 05": "AS YOU EARN POINTS",
|
||||||
"[INSTRUCTIONS] 06": "ITEMS",
|
"[INSTRUCTIONS] 06": "BONUS ITEMS",
|
||||||
"[INSTRUCTIONS] 07": "1.000 POINTS",
|
"[INSTRUCTIONS] 07": "1.000 POINTS",
|
||||||
"[INSTRUCTIONS] 08": "2.500 POINTS",
|
"[INSTRUCTIONS] 08": "2.500 POINTS",
|
||||||
"[INSTRUCTIONS] 09": "5.000 POINTS",
|
"[INSTRUCTIONS] 09": "5.000 POINTS",
|
||||||
"[INSTRUCTIONS] 10": "TIME STOPPER",
|
"[INSTRUCTIONS] 10": "TTIME FREEZE",
|
||||||
"[INSTRUCTIONS] 11": "EXTRA HIT",
|
"[INSTRUCTIONS] 11": "EXTRA HIT",
|
||||||
|
|
||||||
"[INTRO] 1": "Any day of the year 2000",
|
"[INTRO] 1": "Any day of the year 2000",
|
||||||
@@ -46,29 +52,31 @@
|
|||||||
"[INTRO] 9": "Blop... blop... blop...",
|
"[INTRO] 9": "Blop... blop... blop...",
|
||||||
|
|
||||||
"[NOTIFICATIONS] 01": "Press again to quit",
|
"[NOTIFICATIONS] 01": "Press again to quit",
|
||||||
"[NOTIFICATIONS] 02": "Press again to shutdown system",
|
"[NOTIFICATIONS] 02": "Press again to shut down the system",
|
||||||
"[NOTIFICATIONS] 03": "Press again to reset",
|
"[NOTIFICATIONS] 03": "Press again to reset",
|
||||||
"[NOTIFICATIONS] 04": "Press again to change language to",
|
"[NOTIFICATIONS] 04": "Press again to change language to",
|
||||||
"[NOTIFICATIONS] 05": "Language set to",
|
"[NOTIFICATIONS] 05": "Language changed to",
|
||||||
"[NOTIFICATIONS] 06": "on",
|
"[NOTIFICATIONS] 06": "on",
|
||||||
"[NOTIFICATIONS] 07": "off",
|
"[NOTIFICATIONS] 07": "off",
|
||||||
"[NOTIFICATIONS] 08": "Autofire",
|
"[NOTIFICATIONS] 08": "Autofire",
|
||||||
"[NOTIFICATIONS] 09": "Window zoom",
|
"[NOTIFICATIONS] 09": "Window zoom",
|
||||||
"[NOTIFICATIONS] 10": "Window mode",
|
"[NOTIFICATIONS] 10": "Window mode",
|
||||||
"[NOTIFICATIONS] 11": "Fullscreen mode",
|
"[NOTIFICATIONS] 11": "Fullscreen mode",
|
||||||
"[NOTIFICATIONS] 12": "Integer scale",
|
"[NOTIFICATIONS] 12": "Pixel-perfect scale",
|
||||||
"[NOTIFICATIONS] 13": "Filter",
|
"[NOTIFICATIONS] 13": "Filter",
|
||||||
"[NOTIFICATIONS] 14": "Vertical Sync",
|
"[NOTIFICATIONS] 14": "Vertical Sync",
|
||||||
"[NOTIFICATIONS] 15": "Reset",
|
"[NOTIFICATIONS] 15": "Reset",
|
||||||
|
"[NOTIFICATIONS] CONNECTED": "connected",
|
||||||
|
"[NOTIFICATIONS] DISCONNECTED": "disconnected",
|
||||||
|
|
||||||
"[RESOURCE] LOADING": "Loading",
|
"[RESOURCE] LOADING": "Loading",
|
||||||
|
|
||||||
"[SERVICE_MENU] TITLE": "Service Menu",
|
"[SERVICE_MENU] TITLE": "Service Menu",
|
||||||
"[SERVICE_MENU] RESET": "Reset",
|
"[SERVICE_MENU] RESET": "Reset",
|
||||||
"[SERVICE_MENU] QUIT": "Quit Game",
|
"[SERVICE_MENU] QUIT": "Exit Game",
|
||||||
"[SERVICE_MENU] SHUTDOWN": "Shutdown System",
|
"[SERVICE_MENU] SHUTDOWN": "Shutdown System",
|
||||||
"[SERVICE_MENU] FULLSCREEN": "Fullscreen",
|
"[SERVICE_MENU] FULLSCREEN": "Fullscreen",
|
||||||
"[SERVICE_MENU] WINDOW_SIZE": "Window Size",
|
"[SERVICE_MENU] WINDOW_SIZE": "Window Zoom",
|
||||||
"[SERVICE_MENU] SHADERS": "Shaders",
|
"[SERVICE_MENU] SHADERS": "Shaders",
|
||||||
"[SERVICE_MENU] VSYNC": "V-Sync",
|
"[SERVICE_MENU] VSYNC": "V-Sync",
|
||||||
"[SERVICE_MENU] INTEGER_SCALE": "Integer Scale",
|
"[SERVICE_MENU] INTEGER_SCALE": "Integer Scale",
|
||||||
@@ -91,17 +99,27 @@
|
|||||||
"[SERVICE_MENU] NORMAL": "Normal",
|
"[SERVICE_MENU] NORMAL": "Normal",
|
||||||
"[SERVICE_MENU] HARD": "Hard",
|
"[SERVICE_MENU] HARD": "Hard",
|
||||||
"[SERVICE_MENU] NEED_RESTART_MESSAGE": "Restart to apply changes",
|
"[SERVICE_MENU] NEED_RESTART_MESSAGE": "Restart to apply changes",
|
||||||
"[SERVICE_MENU] ENABLE_SHUTDOWN": "Enable shutdown",
|
"[SERVICE_MENU] ENABLE_SHUTDOWN": "Allow system shutdown",
|
||||||
|
"[SERVICE_MENU] CONTROLS": "Controls",
|
||||||
|
"[SERVICE_MENU] KEYBOARD": "Keyboard",
|
||||||
|
"[SERVICE_MENU] PLAYER1": "Player 1",
|
||||||
|
"[SERVICE_MENU] PLAYER2": "Player 2",
|
||||||
|
"[SERVICE_MENU] CONTROLLER1": "Controller 1",
|
||||||
|
"[SERVICE_MENU] CONTROLLER2": "Controller 2",
|
||||||
|
"[SERVICE_MENU] CONFIGURE1": "Configure Controller 1",
|
||||||
|
"[SERVICE_MENU] CONFIGURE2": "Configure Controller 2",
|
||||||
|
"[SERVICE_MENU] NO_CONTROLLER": "[ No controller ]",
|
||||||
|
"[SERVICE_MENU] SWAP_CONTROLLERS": "Swap Controllers",
|
||||||
|
|
||||||
"[SCOREBOARD] 1": "Player 1",
|
"[SCOREBOARD] 1" : "Player 1",
|
||||||
"[SCOREBOARD] 2": "Player 2",
|
"[SCOREBOARD] 2" : "Player 2",
|
||||||
"[SCOREBOARD] 3": "Multiplier",
|
"[SCOREBOARD] 3" : "Multiplier",
|
||||||
"[SCOREBOARD] 4": "High Score",
|
"[SCOREBOARD] 4" : "High Score",
|
||||||
"[SCOREBOARD] 5": "Stage",
|
"[SCOREBOARD] 5" : "Stage",
|
||||||
"[SCOREBOARD] 6": "Demo mode",
|
"[SCOREBOARD] 6" : "Demo mode",
|
||||||
"[SCOREBOARD] 7": "Game Over",
|
"[SCOREBOARD] 7" : "Game Over",
|
||||||
"[SCOREBOARD] 8": "Press START",
|
"[SCOREBOARD] 8" : "Press START",
|
||||||
"[SCOREBOARD] 9": "to play",
|
"[SCOREBOARD] 9" : "to play",
|
||||||
"[SCOREBOARD] 10": "Continue?",
|
"[SCOREBOARD] 10": "Continue?",
|
||||||
"[SCOREBOARD] 11": "Enter name",
|
"[SCOREBOARD] 11": "Enter name",
|
||||||
"[SCOREBOARD] 12": "Please",
|
"[SCOREBOARD] 12": "Please",
|
||||||
|
|||||||
@@ -1,25 +1,31 @@
|
|||||||
{
|
{
|
||||||
"[CREDITS] PROGRAMMED_AND_DESIGNED_BY": "PROGRAMADO Y DISENADO POR",
|
"[CREDITS] PROGRAMMED_AND_DESIGNED_BY": "PROGRAMADO Y DISENADO POR",
|
||||||
"[CREDITS] PIXELART_DRAWN_BY": "GRAFICOS DIBUJADOS POR",
|
"[CREDITS] PIXELART_DRAWN_BY" : "GRAFICOS DIBUJADOS POR",
|
||||||
"[CREDITS] MUSIC_COMPOSED_BY": "MUSICA COMPUESTA POR",
|
"[CREDITS] MUSIC_COMPOSED_BY" : "MUSICA COMPUESTA POR",
|
||||||
"[CREDITS] SOUND_EFFECTS": "EFECTOS DE SONIDO",
|
"[CREDITS] SOUND_EFFECTS" : "EFECTOS DE SONIDO POR",
|
||||||
|
|
||||||
"[DEFINE_BUTTONS] FIRE_LEFT": "Disparar a la izquierda",
|
"[DEFINE_BUTTONS] FIRE_LEFT" : "Disparar a la izquierda",
|
||||||
"[DEFINE_BUTTONS] FIRE_UP": "Disparar hacia arriba",
|
"[DEFINE_BUTTONS] FIRE_UP" : "Disparar hacia arriba",
|
||||||
"[DEFINE_BUTTONS] FIRE_RIGHT": "Disparar hacia la derecha",
|
"[DEFINE_BUTTONS] FIRE_RIGHT" : "Disparar hacia la derecha",
|
||||||
"[DEFINE_BUTTONS] START": "Start",
|
"[DEFINE_BUTTONS] START" : "Start",
|
||||||
"[DEFINE_BUTTONS] SERVICE_MENU": "Menu de servicio",
|
"[DEFINE_BUTTONS] SERVICE_MENU" : "Menu de servicio",
|
||||||
"[DEFINE_BUTTONS] PLAYER": "Jugador",
|
"[DEFINE_BUTTONS] PLAYER" : "Jugador",
|
||||||
"[DEFINE_BUTTONS] KEYBOARD": "Teclado",
|
"[DEFINE_BUTTONS] KEYBOARD" : "Teclado",
|
||||||
|
"[DEFINE_BUTTONS] CONFIGURATION_COMPLETE": "Configuracion completada",
|
||||||
|
"[DEFINE_BUTTONS] CONFIGURING" : "Configurando",
|
||||||
|
"[DEFINE_BUTTONS] PRESS_BUTTON_FOR" : "Pulsa un boton para",
|
||||||
|
"[DEFINE_BUTTONS] CONFIGURED" : "Configurado",
|
||||||
|
|
||||||
"[GAME_TEXT] 1": "Felicidades!!",
|
"[GAME_TEXT] 1": "Felicidades!",
|
||||||
"[GAME_TEXT] 2": " fases mas!",
|
"[GAME_TEXT] 2": "!Quedan ",
|
||||||
|
"[GAME_TEXT] 2A": " fases!",
|
||||||
"[GAME_TEXT] 3": "Ultima fase!",
|
"[GAME_TEXT] 3": "Ultima fase!",
|
||||||
"[GAME_TEXT] 4": "Potenciador",
|
"[GAME_TEXT] 4": "Potenciador",
|
||||||
"[GAME_TEXT] 5": "+1 Golpe",
|
"[GAME_TEXT] 5": "+1 Golpe",
|
||||||
"[GAME_TEXT] 6": "Tiempo!",
|
"[GAME_TEXT] 6": "Tiempo!",
|
||||||
"[GAME_TEXT] 7": "Adelante!",
|
"[GAME_TEXT] 7": "Adelante!",
|
||||||
"[GAME_TEXT] 8": "1.000.000 de puntos!",
|
"[GAME_TEXT] 8": "1.000.000 de puntos!",
|
||||||
|
"[GAME_TEXT] THANK_YOU": "Gracias!",
|
||||||
|
|
||||||
"[HIGHSCORE_TABLE] CAPTION": "Mejores puntuaciones",
|
"[HIGHSCORE_TABLE] CAPTION": "Mejores puntuaciones",
|
||||||
|
|
||||||
@@ -28,7 +34,7 @@
|
|||||||
"[INSTRUCTIONS] 03": "TANTOS GLOBOS COMO PUEDAS",
|
"[INSTRUCTIONS] 03": "TANTOS GLOBOS COMO PUEDAS",
|
||||||
"[INSTRUCTIONS] 04": "LA DIFICULTAD SE INCREMENTA",
|
"[INSTRUCTIONS] 04": "LA DIFICULTAD SE INCREMENTA",
|
||||||
"[INSTRUCTIONS] 05": "A MEDIDA QUE VAS PUNTUANDO",
|
"[INSTRUCTIONS] 05": "A MEDIDA QUE VAS PUNTUANDO",
|
||||||
"[INSTRUCTIONS] 06": "OBJETOS",
|
"[INSTRUCTIONS] 06": "OBJETOS DE BONUS",
|
||||||
"[INSTRUCTIONS] 07": "1.000 PUNTOS",
|
"[INSTRUCTIONS] 07": "1.000 PUNTOS",
|
||||||
"[INSTRUCTIONS] 08": "2.500 PUNTOS",
|
"[INSTRUCTIONS] 08": "2.500 PUNTOS",
|
||||||
"[INSTRUCTIONS] 09": "5.000 PUNTOS",
|
"[INSTRUCTIONS] 09": "5.000 PUNTOS",
|
||||||
@@ -60,6 +66,8 @@
|
|||||||
"[NOTIFICATIONS] 13": "Filtro",
|
"[NOTIFICATIONS] 13": "Filtro",
|
||||||
"[NOTIFICATIONS] 14": "Sincronismo vertical",
|
"[NOTIFICATIONS] 14": "Sincronismo vertical",
|
||||||
"[NOTIFICATIONS] 15": "Reiniciar",
|
"[NOTIFICATIONS] 15": "Reiniciar",
|
||||||
|
"[NOTIFICATIONS] CONNECTED": "conectado",
|
||||||
|
"[NOTIFICATIONS] DISCONNECTED": "desconectado",
|
||||||
|
|
||||||
"[RESOURCE] LOADING": "Cargando",
|
"[RESOURCE] LOADING": "Cargando",
|
||||||
|
|
||||||
@@ -69,9 +77,9 @@
|
|||||||
"[SERVICE_MENU] SHUTDOWN": "Apagar el sistema",
|
"[SERVICE_MENU] SHUTDOWN": "Apagar el sistema",
|
||||||
"[SERVICE_MENU] FULLSCREEN": "Pantalla completa",
|
"[SERVICE_MENU] FULLSCREEN": "Pantalla completa",
|
||||||
"[SERVICE_MENU] WINDOW_SIZE": "Zoom de ventana",
|
"[SERVICE_MENU] WINDOW_SIZE": "Zoom de ventana",
|
||||||
"[SERVICE_MENU] SHADERS": "Filtro",
|
"[SERVICE_MENU] SHADERS": "Filtro grafico",
|
||||||
"[SERVICE_MENU] VSYNC": "Sincronismo vertical",
|
"[SERVICE_MENU] VSYNC": "Sincronismo vertical",
|
||||||
"[SERVICE_MENU] INTEGER_SCALE": "Escalado entero",
|
"[SERVICE_MENU] INTEGER_SCALE": "Escalado proporcional",
|
||||||
"[SERVICE_MENU] MAIN_VOLUME": "Volumen general",
|
"[SERVICE_MENU] MAIN_VOLUME": "Volumen general",
|
||||||
"[SERVICE_MENU] MUSIC_VOLUME": "Volumen de la musica",
|
"[SERVICE_MENU] MUSIC_VOLUME": "Volumen de la musica",
|
||||||
"[SERVICE_MENU] SFX_VOLUME": "Volumen de los efectos",
|
"[SERVICE_MENU] SFX_VOLUME": "Volumen de los efectos",
|
||||||
@@ -92,6 +100,16 @@
|
|||||||
"[SERVICE_MENU] HARD": "Dificil",
|
"[SERVICE_MENU] HARD": "Dificil",
|
||||||
"[SERVICE_MENU] NEED_RESTART_MESSAGE": "Reiniciar para aplicar cambios",
|
"[SERVICE_MENU] NEED_RESTART_MESSAGE": "Reiniciar para aplicar cambios",
|
||||||
"[SERVICE_MENU] ENABLE_SHUTDOWN": "Permitir apagar el sistema",
|
"[SERVICE_MENU] ENABLE_SHUTDOWN": "Permitir apagar el sistema",
|
||||||
|
"[SERVICE_MENU] CONTROLS": "Controles",
|
||||||
|
"[SERVICE_MENU] KEYBOARD": "Teclado",
|
||||||
|
"[SERVICE_MENU] PLAYER1": "Jugador 1",
|
||||||
|
"[SERVICE_MENU] PLAYER2": "Jugador 2",
|
||||||
|
"[SERVICE_MENU] CONTROLLER1": "Mando 1",
|
||||||
|
"[SERVICE_MENU] CONTROLLER2": "Mando 2",
|
||||||
|
"[SERVICE_MENU] CONFIGURE1": "Configurar Mando 1",
|
||||||
|
"[SERVICE_MENU] CONFIGURE2": "Configurar Mando 2",
|
||||||
|
"[SERVICE_MENU] NO_CONTROLLER": "[ Desconectado ]",
|
||||||
|
"[SERVICE_MENU] SWAP_CONTROLLERS": "Intercambiar mandos",
|
||||||
|
|
||||||
"[SCOREBOARD] 1": "Jugador 1",
|
"[SCOREBOARD] 1": "Jugador 1",
|
||||||
"[SCOREBOARD] 2": "Jugador 2",
|
"[SCOREBOARD] 2": "Jugador 2",
|
||||||
|
|||||||
BIN
data/sound/credit.wav
Normal file
BIN
data/sound/credit.wav
Normal file
Binary file not shown.
BIN
data/sound/voice_credit_thankyou.wav
Normal file
BIN
data/sound/voice_credit_thankyou.wav
Normal file
Binary file not shown.
BIN
data/sound/voice_recover.wav
Normal file
BIN
data/sound/voice_recover.wav
Normal file
Binary file not shown.
Binary file not shown.
BIN
define_buttons.o
Normal file
BIN
define_buttons.o
Normal file
Binary file not shown.
@@ -4,5 +4,5 @@ SOURCEPATH=../source/
|
|||||||
|
|
||||||
for i in "$SOURCEPATH"/*.cpp
|
for i in "$SOURCEPATH"/*.cpp
|
||||||
do
|
do
|
||||||
include-what-you-use -D DEBUG -D VERBOSE -std=c++20 -Wall "$i"
|
include-what-you-use -D _DEBUG -std=c++20 -Wall "$i"
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -8,9 +8,8 @@ fi
|
|||||||
|
|
||||||
FILE="$1"
|
FILE="$1"
|
||||||
|
|
||||||
include-what-you-use -D DEBUG -D VERBOSE -std=c++20 -Wall "$FILE" \
|
include-what-you-use -D _DEBUG -std=c++20 -Wall "$FILE" \
|
||||||
|
-I../source \
|
||||||
-Xiwyu --mapping_file=sdl3_mapping.imp \
|
-Xiwyu --mapping_file=sdl3_mapping.imp \
|
||||||
-Xiwyu --update_comments \
|
-Xiwyu --update_comments \
|
||||||
-Xiwyu --verbose=3 \
|
-Xiwyu --verbose=3
|
||||||
| \
|
|
||||||
python3 /usr/bin/fix_includes.py --update_comments
|
|
||||||
15
linux_utils/generate_compile_commands_json.sh
Executable file
15
linux_utils/generate_compile_commands_json.sh
Executable file
@@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 🏁 Ruta base del proyecto
|
||||||
|
BASE_DIR="/home/sergio/gitea/coffee_crisis_arcade_edition"
|
||||||
|
|
||||||
|
# 📁 Ruta al build
|
||||||
|
BUILD_DIR="$BASE_DIR/build"
|
||||||
|
|
||||||
|
# 📄 Archivo de mapping personalizado
|
||||||
|
MAPPING_FILE="$BASE_DIR/linux_utils/sdl3_mapping.imp"
|
||||||
|
|
||||||
|
# 📦 Generar compile_commands.json
|
||||||
|
echo "🔧 Generando compile_commands.json..."
|
||||||
|
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -S "$BASE_DIR" -B "$BUILD_DIR"
|
||||||
|
|
||||||
44
linux_utils/run_clang-tidy.sh
Executable file
44
linux_utils/run_clang-tidy.sh
Executable file
@@ -0,0 +1,44 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Script para ejecutar clang-tidy en múltiples directorios
|
||||||
|
# Uso: ./run_clang-tidy.sh
|
||||||
|
|
||||||
|
# Lista de rutas donde ejecutar clang-tidy
|
||||||
|
PATHS=(
|
||||||
|
"/home/sergio/gitea/coffee_crisis_arcade_edition/source"
|
||||||
|
"/home/sergio/gitea/coffee_crisis_arcade_edition/source/sections"
|
||||||
|
"/home/sergio/gitea/coffee_crisis_arcade_edition/source/ui"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Ruta del directorio build (relativa desde donde se ejecuta el script)
|
||||||
|
BUILD_DIR="/home/sergio/gitea/coffee_crisis_arcade_edition/build/"
|
||||||
|
|
||||||
|
# Función para procesar un directorio
|
||||||
|
process_directory() {
|
||||||
|
local dir="$1"
|
||||||
|
|
||||||
|
echo "=== Procesando directorio: $dir ==="
|
||||||
|
|
||||||
|
# Verificar que el directorio existe
|
||||||
|
if [[ ! -d "$dir" ]]; then
|
||||||
|
echo "Error: El directorio $dir no existe"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Cambiar al directorio y ejecutar find con -maxdepth 1 para un solo nivel
|
||||||
|
cd "$dir" || return 1
|
||||||
|
|
||||||
|
# Buscar archivos .cpp, .h, .hpp solo en el nivel actual (no subdirectorios)
|
||||||
|
find . -maxdepth 1 \( -name '*.cpp' -o -name '*.h' -o -name '*.hpp' \) | \
|
||||||
|
xargs -P4 -I{} bash -c 'echo "Procesando: {}"; clang-tidy {} -p '"$BUILD_DIR"' --fix'
|
||||||
|
|
||||||
|
echo "=== Completado: $dir ==="
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
# Procesar cada directorio en la lista
|
||||||
|
for path in "${PATHS[@]}"; do
|
||||||
|
process_directory "$path"
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "¡Proceso completado para todos los directorios!"
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
<key>NSHighResolutionCapable</key>
|
<key>NSHighResolutionCapable</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>NSHumanReadableCopyright</key>
|
<key>NSHumanReadableCopyright</key>
|
||||||
<string>Copyright 2023 JailDesigner</string>
|
<string>Copyright 2025 JailDesigner</string>
|
||||||
<key>NSPrincipalClass</key>
|
<key>NSPrincipalClass</key>
|
||||||
<string>NSApplication</string>
|
<string>NSApplication</string>
|
||||||
<key>SUPublicDSAKeyFile</key>
|
<key>SUPublicDSAKeyFile</key>
|
||||||
|
|||||||
BIN
release/SDL2.dll
BIN
release/SDL2.dll
Binary file not shown.
@@ -1 +0,0 @@
|
|||||||
Versions/Current/SDL2
|
|
||||||
@@ -1,234 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2025 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL.h
|
|
||||||
*
|
|
||||||
* Main include header for the SDL library
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_h_
|
|
||||||
#define SDL_h_
|
|
||||||
|
|
||||||
#include <SDL2/SDL_main.h>
|
|
||||||
#include <SDL2/SDL_stdinc.h>
|
|
||||||
#include <SDL2/SDL_assert.h>
|
|
||||||
#include <SDL2/SDL_atomic.h>
|
|
||||||
#include <SDL2/SDL_audio.h>
|
|
||||||
#include <SDL2/SDL_clipboard.h>
|
|
||||||
#include <SDL2/SDL_cpuinfo.h>
|
|
||||||
#include <SDL2/SDL_endian.h>
|
|
||||||
#include <SDL2/SDL_error.h>
|
|
||||||
#include <SDL2/SDL_events.h>
|
|
||||||
#include <SDL2/SDL_filesystem.h>
|
|
||||||
#include <SDL2/SDL_gamecontroller.h>
|
|
||||||
#include <SDL2/SDL_guid.h>
|
|
||||||
#include <SDL2/SDL_haptic.h>
|
|
||||||
#include <SDL2/SDL_hidapi.h>
|
|
||||||
#include <SDL2/SDL_hints.h>
|
|
||||||
#include <SDL2/SDL_joystick.h>
|
|
||||||
#include <SDL2/SDL_loadso.h>
|
|
||||||
#include <SDL2/SDL_log.h>
|
|
||||||
#include <SDL2/SDL_messagebox.h>
|
|
||||||
#include <SDL2/SDL_metal.h>
|
|
||||||
#include <SDL2/SDL_mutex.h>
|
|
||||||
#include <SDL2/SDL_power.h>
|
|
||||||
#include <SDL2/SDL_render.h>
|
|
||||||
#include <SDL2/SDL_rwops.h>
|
|
||||||
#include <SDL2/SDL_sensor.h>
|
|
||||||
#include <SDL2/SDL_shape.h>
|
|
||||||
#include <SDL2/SDL_system.h>
|
|
||||||
#include <SDL2/SDL_thread.h>
|
|
||||||
#include <SDL2/SDL_timer.h>
|
|
||||||
#include <SDL2/SDL_version.h>
|
|
||||||
#include <SDL2/SDL_video.h>
|
|
||||||
#include <SDL2/SDL_locale.h>
|
|
||||||
#include <SDL2/SDL_misc.h>
|
|
||||||
|
|
||||||
#include <SDL2/begin_code.h>
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* WIKI CATEGORY: Init */
|
|
||||||
|
|
||||||
/* As of version 0.5, SDL is loaded dynamically into the application */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name SDL_INIT_*
|
|
||||||
*
|
|
||||||
* These are the flags which may be passed to SDL_Init(). You should
|
|
||||||
* specify the subsystems which you will be using in your application.
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
#define SDL_INIT_TIMER 0x00000001u
|
|
||||||
#define SDL_INIT_AUDIO 0x00000010u
|
|
||||||
#define SDL_INIT_VIDEO 0x00000020u /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */
|
|
||||||
#define SDL_INIT_JOYSTICK 0x00000200u /**< SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS */
|
|
||||||
#define SDL_INIT_HAPTIC 0x00001000u
|
|
||||||
#define SDL_INIT_GAMECONTROLLER 0x00002000u /**< SDL_INIT_GAMECONTROLLER implies SDL_INIT_JOYSTICK */
|
|
||||||
#define SDL_INIT_EVENTS 0x00004000u
|
|
||||||
#define SDL_INIT_SENSOR 0x00008000u
|
|
||||||
#define SDL_INIT_NOPARACHUTE 0x00100000u /**< compatibility; this flag is ignored. */
|
|
||||||
#define SDL_INIT_EVERYTHING ( \
|
|
||||||
SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \
|
|
||||||
SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER | SDL_INIT_SENSOR \
|
|
||||||
)
|
|
||||||
/* @} */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize the SDL library.
|
|
||||||
*
|
|
||||||
* SDL_Init() simply forwards to calling SDL_InitSubSystem(). Therefore, the
|
|
||||||
* two may be used interchangeably. Though for readability of your code
|
|
||||||
* SDL_InitSubSystem() might be preferred.
|
|
||||||
*
|
|
||||||
* The file I/O (for example: SDL_RWFromFile) and threading (SDL_CreateThread)
|
|
||||||
* subsystems are initialized by default. Message boxes
|
|
||||||
* (SDL_ShowSimpleMessageBox) also attempt to work without initializing the
|
|
||||||
* video subsystem, in hopes of being useful in showing an error dialog when
|
|
||||||
* SDL_Init fails. You must specifically initialize other subsystems if you
|
|
||||||
* use them in your application.
|
|
||||||
*
|
|
||||||
* Logging (such as SDL_Log) works without initialization, too.
|
|
||||||
*
|
|
||||||
* `flags` may be any of the following OR'd together:
|
|
||||||
*
|
|
||||||
* - `SDL_INIT_TIMER`: timer subsystem
|
|
||||||
* - `SDL_INIT_AUDIO`: audio subsystem
|
|
||||||
* - `SDL_INIT_VIDEO`: video subsystem; automatically initializes the events
|
|
||||||
* subsystem
|
|
||||||
* - `SDL_INIT_JOYSTICK`: joystick subsystem; automatically initializes the
|
|
||||||
* events subsystem
|
|
||||||
* - `SDL_INIT_HAPTIC`: haptic (force feedback) subsystem
|
|
||||||
* - `SDL_INIT_GAMECONTROLLER`: controller subsystem; automatically
|
|
||||||
* initializes the joystick subsystem
|
|
||||||
* - `SDL_INIT_EVENTS`: events subsystem
|
|
||||||
* - `SDL_INIT_EVERYTHING`: all of the above subsystems
|
|
||||||
* - `SDL_INIT_NOPARACHUTE`: compatibility; this flag is ignored
|
|
||||||
*
|
|
||||||
* Subsystem initialization is ref-counted, you must call SDL_QuitSubSystem()
|
|
||||||
* for each SDL_InitSubSystem() to correctly shutdown a subsystem manually (or
|
|
||||||
* call SDL_Quit() to force shutdown). If a subsystem is already loaded then
|
|
||||||
* this call will increase the ref-count and return.
|
|
||||||
*
|
|
||||||
* \param flags subsystem initialization flags.
|
|
||||||
* \returns 0 on success or a negative error code on failure; call
|
|
||||||
* SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_InitSubSystem
|
|
||||||
* \sa SDL_Quit
|
|
||||||
* \sa SDL_SetMainReady
|
|
||||||
* \sa SDL_WasInit
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Compatibility function to initialize the SDL library.
|
|
||||||
*
|
|
||||||
* In SDL2, this function and SDL_Init() are interchangeable.
|
|
||||||
*
|
|
||||||
* \param flags any of the flags used by SDL_Init(); see SDL_Init for details.
|
|
||||||
* \returns 0 on success or a negative error code on failure; call
|
|
||||||
* SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_Init
|
|
||||||
* \sa SDL_Quit
|
|
||||||
* \sa SDL_QuitSubSystem
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Shut down specific SDL subsystems.
|
|
||||||
*
|
|
||||||
* If you start a subsystem using a call to that subsystem's init function
|
|
||||||
* (for example SDL_VideoInit()) instead of SDL_Init() or SDL_InitSubSystem(),
|
|
||||||
* SDL_QuitSubSystem() and SDL_WasInit() will not work. You will need to use
|
|
||||||
* that subsystem's quit function (SDL_VideoQuit()) directly instead. But
|
|
||||||
* generally, you should not be using those functions directly anyhow; use
|
|
||||||
* SDL_Init() instead.
|
|
||||||
*
|
|
||||||
* You still need to call SDL_Quit() even if you close all open subsystems
|
|
||||||
* with SDL_QuitSubSystem().
|
|
||||||
*
|
|
||||||
* \param flags any of the flags used by SDL_Init(); see SDL_Init for details.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_InitSubSystem
|
|
||||||
* \sa SDL_Quit
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get a mask of the specified subsystems which are currently initialized.
|
|
||||||
*
|
|
||||||
* \param flags any of the flags used by SDL_Init(); see SDL_Init for details.
|
|
||||||
* \returns a mask of all initialized subsystems if `flags` is 0, otherwise it
|
|
||||||
* returns the initialization status of the specified subsystems.
|
|
||||||
*
|
|
||||||
* The return value does not include SDL_INIT_NOPARACHUTE.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_Init
|
|
||||||
* \sa SDL_InitSubSystem
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Clean up all initialized subsystems.
|
|
||||||
*
|
|
||||||
* You should call this function even if you have already shutdown each
|
|
||||||
* initialized subsystem with SDL_QuitSubSystem(). It is safe to call this
|
|
||||||
* function even in the case of errors in initialization.
|
|
||||||
*
|
|
||||||
* If you start a subsystem using a call to that subsystem's init function
|
|
||||||
* (for example SDL_VideoInit()) instead of SDL_Init() or SDL_InitSubSystem(),
|
|
||||||
* then you must use that subsystem's quit function (SDL_VideoQuit()) to shut
|
|
||||||
* it down before calling SDL_Quit(). But generally, you should not be using
|
|
||||||
* those functions directly anyhow; use SDL_Init() instead.
|
|
||||||
*
|
|
||||||
* You can use this function with atexit() to ensure that it is run when your
|
|
||||||
* application is shutdown, but it is not wise to do this from a library or
|
|
||||||
* other dynamically loaded code.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_Init
|
|
||||||
* \sa SDL_QuitSubSystem
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_Quit(void);
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include <SDL2/close_code.h>
|
|
||||||
|
|
||||||
#endif /* SDL_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
||||||
@@ -1,324 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2025 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_assert_h_
|
|
||||||
#define SDL_assert_h_
|
|
||||||
|
|
||||||
#include <SDL2/SDL_stdinc.h>
|
|
||||||
|
|
||||||
#include <SDL2/begin_code.h>
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef SDL_ASSERT_LEVEL
|
|
||||||
#ifdef SDL_DEFAULT_ASSERT_LEVEL
|
|
||||||
#define SDL_ASSERT_LEVEL SDL_DEFAULT_ASSERT_LEVEL
|
|
||||||
#elif defined(_DEBUG) || defined(DEBUG) || \
|
|
||||||
(defined(__GNUC__) && !defined(__OPTIMIZE__))
|
|
||||||
#define SDL_ASSERT_LEVEL 2
|
|
||||||
#else
|
|
||||||
#define SDL_ASSERT_LEVEL 1
|
|
||||||
#endif
|
|
||||||
#endif /* SDL_ASSERT_LEVEL */
|
|
||||||
|
|
||||||
/*
|
|
||||||
These are macros and not first class functions so that the debugger breaks
|
|
||||||
on the assertion line and not in some random guts of SDL, and so each
|
|
||||||
assert can have unique static variables associated with it.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
|
||||||
/* Don't include intrin.h here because it contains C++ code */
|
|
||||||
extern void __cdecl __debugbreak(void);
|
|
||||||
#define SDL_TriggerBreakpoint() __debugbreak()
|
|
||||||
#elif _SDL_HAS_BUILTIN(__builtin_debugtrap)
|
|
||||||
#define SDL_TriggerBreakpoint() __builtin_debugtrap()
|
|
||||||
#elif ( (!defined(__NACL__)) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))) )
|
|
||||||
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
|
|
||||||
#elif (defined(__GNUC__) || defined(__clang__)) && defined(__riscv)
|
|
||||||
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "ebreak\n\t" )
|
|
||||||
#elif ( defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__)) ) /* this might work on other ARM targets, but this is a known quantity... */
|
|
||||||
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #22\n\t" )
|
|
||||||
#elif defined(__APPLE__) && defined(__arm__)
|
|
||||||
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "bkpt #22\n\t" )
|
|
||||||
#elif defined(_WIN32) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__arm64__) || defined(__aarch64__)) )
|
|
||||||
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #0xF000\n\t" )
|
|
||||||
#elif defined(__386__) && defined(__WATCOMC__)
|
|
||||||
#define SDL_TriggerBreakpoint() { _asm { int 0x03 } }
|
|
||||||
#elif defined(HAVE_SIGNAL_H) && !defined(__WATCOMC__)
|
|
||||||
#include <signal.h>
|
|
||||||
#define SDL_TriggerBreakpoint() raise(SIGTRAP)
|
|
||||||
#else
|
|
||||||
/* How do we trigger breakpoints on this platform? */
|
|
||||||
#define SDL_TriggerBreakpoint()
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */
|
|
||||||
# define SDL_FUNCTION __func__
|
|
||||||
#elif ((defined(__GNUC__) && (__GNUC__ >= 2)) || defined(_MSC_VER) || defined (__WATCOMC__))
|
|
||||||
# define SDL_FUNCTION __FUNCTION__
|
|
||||||
#else
|
|
||||||
# define SDL_FUNCTION "???"
|
|
||||||
#endif
|
|
||||||
#define SDL_FILE __FILE__
|
|
||||||
#define SDL_LINE __LINE__
|
|
||||||
|
|
||||||
/*
|
|
||||||
sizeof (x) makes the compiler still parse the expression even without
|
|
||||||
assertions enabled, so the code is always checked at compile time, but
|
|
||||||
doesn't actually generate code for it, so there are no side effects or
|
|
||||||
expensive checks at run time, just the constant size of what x WOULD be,
|
|
||||||
which presumably gets optimized out as unused.
|
|
||||||
This also solves the problem of...
|
|
||||||
|
|
||||||
int somevalue = blah();
|
|
||||||
SDL_assert(somevalue == 1);
|
|
||||||
|
|
||||||
...which would cause compiles to complain that somevalue is unused if we
|
|
||||||
disable assertions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* "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! */
|
|
||||||
#ifdef _MSC_VER /* stupid /W4 warnings. */
|
|
||||||
#define SDL_NULL_WHILE_LOOP_CONDITION (0,0)
|
|
||||||
#else
|
|
||||||
#define SDL_NULL_WHILE_LOOP_CONDITION (0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define SDL_disabled_assert(condition) \
|
|
||||||
do { (void) sizeof ((condition)); } while (SDL_NULL_WHILE_LOOP_CONDITION)
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_ASSERTION_RETRY, /**< Retry the assert immediately. */
|
|
||||||
SDL_ASSERTION_BREAK, /**< Make the debugger trigger a breakpoint. */
|
|
||||||
SDL_ASSERTION_ABORT, /**< Terminate the program. */
|
|
||||||
SDL_ASSERTION_IGNORE, /**< Ignore the assert. */
|
|
||||||
SDL_ASSERTION_ALWAYS_IGNORE /**< Ignore the assert from now on. */
|
|
||||||
} SDL_AssertState;
|
|
||||||
|
|
||||||
typedef struct SDL_AssertData
|
|
||||||
{
|
|
||||||
int always_ignore;
|
|
||||||
unsigned int trigger_count;
|
|
||||||
const char *condition;
|
|
||||||
const char *filename;
|
|
||||||
int linenum;
|
|
||||||
const char *function;
|
|
||||||
const struct SDL_AssertData *next;
|
|
||||||
} SDL_AssertData;
|
|
||||||
|
|
||||||
/* Never call this directly. Use the SDL_assert* macros. */
|
|
||||||
extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *,
|
|
||||||
const char *,
|
|
||||||
const char *, int)
|
|
||||||
#if defined(__clang__)
|
|
||||||
#if __has_feature(attribute_analyzer_noreturn)
|
|
||||||
/* this tells Clang's static analysis that we're a custom assert function,
|
|
||||||
and that the analyzer should assume the condition was always true past this
|
|
||||||
SDL_assert test. */
|
|
||||||
__attribute__((analyzer_noreturn))
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
;
|
|
||||||
|
|
||||||
/* the do {} while(0) avoids dangling else problems:
|
|
||||||
if (x) SDL_assert(y); else blah();
|
|
||||||
... without the do/while, the "else" could attach to this macro's "if".
|
|
||||||
We try to handle just the minimum we need here in a macro...the loop,
|
|
||||||
the static vars, and break points. The heavy lifting is handled in
|
|
||||||
SDL_ReportAssertion(), in SDL_assert.c.
|
|
||||||
*/
|
|
||||||
#define SDL_enabled_assert(condition) \
|
|
||||||
do { \
|
|
||||||
while ( !(condition) ) { \
|
|
||||||
static struct SDL_AssertData sdl_assert_data = { 0, 0, #condition, 0, 0, 0, 0 }; \
|
|
||||||
const SDL_AssertState sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \
|
|
||||||
if (sdl_assert_state == SDL_ASSERTION_RETRY) { \
|
|
||||||
continue; /* go again. */ \
|
|
||||||
} else if (sdl_assert_state == SDL_ASSERTION_BREAK) { \
|
|
||||||
SDL_TriggerBreakpoint(); \
|
|
||||||
} \
|
|
||||||
break; /* not retrying. */ \
|
|
||||||
} \
|
|
||||||
} while (SDL_NULL_WHILE_LOOP_CONDITION)
|
|
||||||
|
|
||||||
/* Enable various levels of assertions. */
|
|
||||||
#if SDL_ASSERT_LEVEL == 0 /* assertions disabled */
|
|
||||||
# define SDL_assert(condition) SDL_disabled_assert(condition)
|
|
||||||
# define SDL_assert_release(condition) SDL_disabled_assert(condition)
|
|
||||||
# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
|
|
||||||
#elif SDL_ASSERT_LEVEL == 1 /* release settings. */
|
|
||||||
# define SDL_assert(condition) SDL_disabled_assert(condition)
|
|
||||||
# define SDL_assert_release(condition) SDL_enabled_assert(condition)
|
|
||||||
# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
|
|
||||||
#elif SDL_ASSERT_LEVEL == 2 /* normal settings. */
|
|
||||||
# define SDL_assert(condition) SDL_enabled_assert(condition)
|
|
||||||
# define SDL_assert_release(condition) SDL_enabled_assert(condition)
|
|
||||||
# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
|
|
||||||
#elif SDL_ASSERT_LEVEL == 3 /* paranoid settings. */
|
|
||||||
# define SDL_assert(condition) SDL_enabled_assert(condition)
|
|
||||||
# define SDL_assert_release(condition) SDL_enabled_assert(condition)
|
|
||||||
# define SDL_assert_paranoid(condition) SDL_enabled_assert(condition)
|
|
||||||
#else
|
|
||||||
# error Unknown assertion level.
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* this assertion is never disabled at any level. */
|
|
||||||
#define SDL_assert_always(condition) SDL_enabled_assert(condition)
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A callback that fires when an SDL assertion fails.
|
|
||||||
*
|
|
||||||
* \param data a pointer to the SDL_AssertData structure corresponding to the
|
|
||||||
* current assertion.
|
|
||||||
* \param userdata what was passed as `userdata` to SDL_SetAssertionHandler().
|
|
||||||
* \returns an SDL_AssertState value indicating how to handle the failure.
|
|
||||||
*/
|
|
||||||
typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)(
|
|
||||||
const SDL_AssertData* data, void* userdata);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set an application-defined assertion handler.
|
|
||||||
*
|
|
||||||
* This function allows an application to show its own assertion UI and/or
|
|
||||||
* force the response to an assertion failure. If the application doesn't
|
|
||||||
* provide this, SDL will try to do the right thing, popping up a
|
|
||||||
* system-specific GUI dialog, and probably minimizing any fullscreen windows.
|
|
||||||
*
|
|
||||||
* This callback may fire from any thread, but it runs wrapped in a mutex, so
|
|
||||||
* it will only fire from one thread at a time.
|
|
||||||
*
|
|
||||||
* This callback is NOT reset to SDL's internal handler upon SDL_Quit()!
|
|
||||||
*
|
|
||||||
* \param handler the SDL_AssertionHandler function to call when an assertion
|
|
||||||
* fails or NULL for the default handler.
|
|
||||||
* \param userdata a pointer that is passed to `handler`.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetAssertionHandler
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_SetAssertionHandler(
|
|
||||||
SDL_AssertionHandler handler,
|
|
||||||
void *userdata);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the default assertion handler.
|
|
||||||
*
|
|
||||||
* This returns the function pointer that is called by default when an
|
|
||||||
* assertion is triggered. This is an internal function provided by SDL, that
|
|
||||||
* is used for assertions when SDL_SetAssertionHandler() hasn't been used to
|
|
||||||
* provide a different function.
|
|
||||||
*
|
|
||||||
* \returns the default SDL_AssertionHandler that is called when an assert
|
|
||||||
* triggers.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.2.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetAssertionHandler
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the current assertion handler.
|
|
||||||
*
|
|
||||||
* This returns the function pointer that is called when an assertion is
|
|
||||||
* triggered. This is either the value last passed to
|
|
||||||
* SDL_SetAssertionHandler(), or if no application-specified function is set,
|
|
||||||
* is equivalent to calling SDL_GetDefaultAssertionHandler().
|
|
||||||
*
|
|
||||||
* The parameter `puserdata` is a pointer to a void*, which will store the
|
|
||||||
* "userdata" pointer that was passed to SDL_SetAssertionHandler(). This value
|
|
||||||
* will always be NULL for the default handler. If you don't care about this
|
|
||||||
* data, it is safe to pass a NULL pointer to this function to ignore it.
|
|
||||||
*
|
|
||||||
* \param puserdata pointer which is filled with the "userdata" pointer that
|
|
||||||
* was passed to SDL_SetAssertionHandler().
|
|
||||||
* \returns the SDL_AssertionHandler that is called when an assert triggers.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.2.
|
|
||||||
*
|
|
||||||
* \sa SDL_SetAssertionHandler
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetAssertionHandler(void **puserdata);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get a list of all assertion failures.
|
|
||||||
*
|
|
||||||
* This function gets all assertions triggered since the last call to
|
|
||||||
* SDL_ResetAssertionReport(), or the start of the program.
|
|
||||||
*
|
|
||||||
* The proper way to examine this data looks something like this:
|
|
||||||
*
|
|
||||||
* ```c
|
|
||||||
* const SDL_AssertData *item = SDL_GetAssertionReport();
|
|
||||||
* while (item) {
|
|
||||||
* printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\\n",
|
|
||||||
* item->condition, item->function, item->filename,
|
|
||||||
* item->linenum, item->trigger_count,
|
|
||||||
* item->always_ignore ? "yes" : "no");
|
|
||||||
* item = item->next;
|
|
||||||
* }
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* \returns a list of all failed assertions or NULL if the list is empty. This
|
|
||||||
* memory should not be modified or freed by the application.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_ResetAssertionReport
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const SDL_AssertData * SDLCALL SDL_GetAssertionReport(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Clear the list of all assertion failures.
|
|
||||||
*
|
|
||||||
* This function will clear the list of all assertions triggered up to that
|
|
||||||
* point. Immediately following this call, SDL_GetAssertionReport will return
|
|
||||||
* no items. In addition, any previously-triggered assertions will be reset to
|
|
||||||
* a trigger_count of zero, and their always_ignore state will be false.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetAssertionReport
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_ResetAssertionReport(void);
|
|
||||||
|
|
||||||
|
|
||||||
/* these had wrong naming conventions until 2.0.4. Please update your app! */
|
|
||||||
#define SDL_assert_state SDL_AssertState
|
|
||||||
#define SDL_assert_data SDL_AssertData
|
|
||||||
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include <SDL2/close_code.h>
|
|
||||||
|
|
||||||
#endif /* SDL_assert_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
||||||
@@ -1,408 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2025 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* # CategoryAtomic
|
|
||||||
*
|
|
||||||
* Atomic operations.
|
|
||||||
*
|
|
||||||
* IMPORTANT: If you are not an expert in concurrent lockless programming, you
|
|
||||||
* should not be using any functions in this file. You should be protecting
|
|
||||||
* your data structures with full mutexes instead.
|
|
||||||
*
|
|
||||||
* ***Seriously, here be dragons!***
|
|
||||||
*
|
|
||||||
* You can find out a little more about lockless programming and the subtle
|
|
||||||
* issues that can arise here:
|
|
||||||
* https://learn.microsoft.com/en-us/windows/win32/dxtecharts/lockless-programming
|
|
||||||
*
|
|
||||||
* There's also lots of good information here:
|
|
||||||
*
|
|
||||||
* - https://www.1024cores.net/home/lock-free-algorithms
|
|
||||||
* - https://preshing.com/
|
|
||||||
*
|
|
||||||
* These operations may or may not actually be implemented using processor
|
|
||||||
* specific atomic operations. When possible they are implemented as true
|
|
||||||
* processor specific atomic operations. When that is not possible the are
|
|
||||||
* implemented using locks that *do* use the available atomic operations.
|
|
||||||
*
|
|
||||||
* All of the atomic operations that modify memory are full memory barriers.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_atomic_h_
|
|
||||||
#define SDL_atomic_h_
|
|
||||||
|
|
||||||
#include <SDL2/SDL_stdinc.h>
|
|
||||||
#include <SDL2/SDL_platform.h>
|
|
||||||
|
|
||||||
#include <SDL2/begin_code.h>
|
|
||||||
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name SDL AtomicLock
|
|
||||||
*
|
|
||||||
* The atomic locks are efficient spinlocks using CPU instructions,
|
|
||||||
* but are vulnerable to starvation and can spin forever if a thread
|
|
||||||
* holding a lock has been terminated. For this reason you should
|
|
||||||
* minimize the code executed inside an atomic lock and never do
|
|
||||||
* expensive things like API or system calls while holding them.
|
|
||||||
*
|
|
||||||
* The atomic locks are not safe to lock recursively.
|
|
||||||
*
|
|
||||||
* Porting Note:
|
|
||||||
* The spin lock functions and type are required and can not be
|
|
||||||
* emulated because they are used in the atomic emulation code.
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
|
|
||||||
typedef int SDL_SpinLock;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Try to lock a spin lock by setting it to a non-zero value.
|
|
||||||
*
|
|
||||||
* ***Please note that spinlocks are dangerous if you don't know what you're
|
|
||||||
* doing. Please be careful using any sort of spinlock!***
|
|
||||||
*
|
|
||||||
* \param lock a pointer to a lock variable.
|
|
||||||
* \returns SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already
|
|
||||||
* held.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_AtomicLock
|
|
||||||
* \sa SDL_AtomicUnlock
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTryLock(SDL_SpinLock *lock);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Lock a spin lock by setting it to a non-zero value.
|
|
||||||
*
|
|
||||||
* ***Please note that spinlocks are dangerous if you don't know what you're
|
|
||||||
* doing. Please be careful using any sort of spinlock!***
|
|
||||||
*
|
|
||||||
* \param lock a pointer to a lock variable.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_AtomicTryLock
|
|
||||||
* \sa SDL_AtomicUnlock
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Unlock a spin lock by setting it to 0.
|
|
||||||
*
|
|
||||||
* Always returns immediately.
|
|
||||||
*
|
|
||||||
* ***Please note that spinlocks are dangerous if you don't know what you're
|
|
||||||
* doing. Please be careful using any sort of spinlock!***
|
|
||||||
*
|
|
||||||
* \param lock a pointer to a lock variable.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_AtomicLock
|
|
||||||
* \sa SDL_AtomicTryLock
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock);
|
|
||||||
|
|
||||||
/* @} *//* SDL AtomicLock */
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The compiler barrier prevents the compiler from reordering
|
|
||||||
* reads and writes to globally visible variables across the call.
|
|
||||||
*/
|
|
||||||
#if defined(_MSC_VER) && (_MSC_VER > 1200) && !defined(__clang__)
|
|
||||||
void _ReadWriteBarrier(void);
|
|
||||||
#pragma intrinsic(_ReadWriteBarrier)
|
|
||||||
#define SDL_CompilerBarrier() _ReadWriteBarrier()
|
|
||||||
#elif (defined(__GNUC__) && !defined(__EMSCRIPTEN__)) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120))
|
|
||||||
/* This is correct for all CPUs when using GCC or Solaris Studio 12.1+. */
|
|
||||||
#define SDL_CompilerBarrier() __asm__ __volatile__ ("" : : : "memory")
|
|
||||||
#elif defined(__WATCOMC__)
|
|
||||||
extern __inline void SDL_CompilerBarrier(void);
|
|
||||||
#pragma aux SDL_CompilerBarrier = "" parm [] modify exact [];
|
|
||||||
#else
|
|
||||||
#define SDL_CompilerBarrier() \
|
|
||||||
{ SDL_SpinLock _tmp = 0; SDL_AtomicLock(&_tmp); SDL_AtomicUnlock(&_tmp); }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Memory barriers are designed to prevent reads and writes from being
|
|
||||||
* reordered by the compiler and being seen out of order on multi-core CPUs.
|
|
||||||
*
|
|
||||||
* A typical pattern would be for thread A to write some data and a flag, and
|
|
||||||
* for thread B to read the flag and get the data. In this case you would
|
|
||||||
* insert a release barrier between writing the data and the flag,
|
|
||||||
* guaranteeing that the data write completes no later than the flag is
|
|
||||||
* written, and you would insert an acquire barrier between reading the flag
|
|
||||||
* and reading the data, to ensure that all the reads associated with the flag
|
|
||||||
* have completed.
|
|
||||||
*
|
|
||||||
* In this pattern you should always see a release barrier paired with an
|
|
||||||
* acquire barrier and you should gate the data reads/writes with a single
|
|
||||||
* flag variable.
|
|
||||||
*
|
|
||||||
* For more information on these semantics, take a look at the blog post:
|
|
||||||
* http://preshing.com/20120913/acquire-and-release-semantics
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.6.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_MemoryBarrierReleaseFunction(void);
|
|
||||||
extern DECLSPEC void SDLCALL SDL_MemoryBarrierAcquireFunction(void);
|
|
||||||
|
|
||||||
#if 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")
|
|
||||||
#elif defined(__GNUC__) && defined(__arm__)
|
|
||||||
#if 0 /* defined(__LINUX__) || defined(__ANDROID__) */
|
|
||||||
/* Information from:
|
|
||||||
https://chromium.googlesource.com/chromium/chromium/+/trunk/base/atomicops_internals_arm_gcc.h#19
|
|
||||||
|
|
||||||
The Linux kernel provides a helper function which provides the right code for a memory barrier,
|
|
||||||
hard-coded at address 0xffff0fa0
|
|
||||||
*/
|
|
||||||
typedef void (*SDL_KernelMemoryBarrierFunc)();
|
|
||||||
#define SDL_MemoryBarrierRelease() ((SDL_KernelMemoryBarrierFunc)0xffff0fa0)()
|
|
||||||
#define SDL_MemoryBarrierAcquire() ((SDL_KernelMemoryBarrierFunc)0xffff0fa0)()
|
|
||||||
#elif 0 /* defined(__QNXNTO__) */
|
|
||||||
#include <sys/cpuinline.h>
|
|
||||||
|
|
||||||
#define SDL_MemoryBarrierRelease() __cpu_membarrier()
|
|
||||||
#define SDL_MemoryBarrierAcquire() __cpu_membarrier()
|
|
||||||
#else
|
|
||||||
#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) || defined(__ARM_ARCH_8A__)
|
|
||||||
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory")
|
|
||||||
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory")
|
|
||||||
#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__)
|
|
||||||
#ifdef __thumb__
|
|
||||||
/* The mcr instruction isn't available in thumb mode, use real functions */
|
|
||||||
#define SDL_MEMORY_BARRIER_USES_FUNCTION
|
|
||||||
#define SDL_MemoryBarrierRelease() SDL_MemoryBarrierReleaseFunction()
|
|
||||||
#define SDL_MemoryBarrierAcquire() SDL_MemoryBarrierAcquireFunction()
|
|
||||||
#else
|
|
||||||
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory")
|
|
||||||
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory")
|
|
||||||
#endif /* __thumb__ */
|
|
||||||
#else
|
|
||||||
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("" : : : "memory")
|
|
||||||
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("" : : : "memory")
|
|
||||||
#endif /* __LINUX__ || __ANDROID__ */
|
|
||||||
#endif /* __GNUC__ && __arm__ */
|
|
||||||
#else
|
|
||||||
#if (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120))
|
|
||||||
/* This is correct for all CPUs on Solaris when using Solaris Studio 12.1+. */
|
|
||||||
#include <mbarrier.h>
|
|
||||||
#define SDL_MemoryBarrierRelease() __machine_rel_barrier()
|
|
||||||
#define SDL_MemoryBarrierAcquire() __machine_acq_barrier()
|
|
||||||
#else
|
|
||||||
/* This is correct for the x86 and x64 CPUs, and we'll expand this over time. */
|
|
||||||
#define SDL_MemoryBarrierRelease() SDL_CompilerBarrier()
|
|
||||||
#define SDL_MemoryBarrierAcquire() SDL_CompilerBarrier()
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* "REP NOP" is PAUSE, coded for tools that don't know it by that name. */
|
|
||||||
#if (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))
|
|
||||||
#define SDL_CPUPauseInstruction() __asm__ __volatile__("pause\n") /* Some assemblers can't do REP NOP, so go with PAUSE. */
|
|
||||||
#elif (defined(__arm__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7) || defined(__aarch64__)
|
|
||||||
#define SDL_CPUPauseInstruction() __asm__ __volatile__("yield" ::: "memory")
|
|
||||||
#elif (defined(__powerpc__) || defined(__powerpc64__))
|
|
||||||
#define SDL_CPUPauseInstruction() __asm__ __volatile__("or 27,27,27");
|
|
||||||
#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
|
|
||||||
#define SDL_CPUPauseInstruction() _mm_pause() /* this is actually "rep nop" and not a SIMD instruction. No inline asm in MSVC x86-64! */
|
|
||||||
#elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64))
|
|
||||||
#define SDL_CPUPauseInstruction() __yield()
|
|
||||||
#elif defined(__WATCOMC__) && defined(__386__)
|
|
||||||
extern __inline void SDL_CPUPauseInstruction(void);
|
|
||||||
#pragma aux SDL_CPUPauseInstruction = ".686p" ".xmm2" "pause"
|
|
||||||
#else
|
|
||||||
#define SDL_CPUPauseInstruction()
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A type representing an atomic integer value.
|
|
||||||
*
|
|
||||||
* It is a struct so people don't accidentally use numeric operations on it.
|
|
||||||
*/
|
|
||||||
typedef struct SDL_atomic_t {
|
|
||||||
int value;
|
|
||||||
} SDL_atomic_t;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set an atomic variable to a new value if it is currently an old value.
|
|
||||||
*
|
|
||||||
* ***Note: If you don't know what this function is for, you shouldn't use
|
|
||||||
* it!***
|
|
||||||
*
|
|
||||||
* \param a a pointer to an SDL_atomic_t variable to be modified.
|
|
||||||
* \param oldval the old value.
|
|
||||||
* \param newval the new value.
|
|
||||||
* \returns SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_AtomicCASPtr
|
|
||||||
* \sa SDL_AtomicGet
|
|
||||||
* \sa SDL_AtomicSet
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set an atomic variable to a value.
|
|
||||||
*
|
|
||||||
* This function also acts as a full memory barrier.
|
|
||||||
*
|
|
||||||
* ***Note: If you don't know what this function is for, you shouldn't use
|
|
||||||
* it!***
|
|
||||||
*
|
|
||||||
* \param a a pointer to an SDL_atomic_t variable to be modified.
|
|
||||||
* \param v the desired value.
|
|
||||||
* \returns the previous value of the atomic variable.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.2.
|
|
||||||
*
|
|
||||||
* \sa SDL_AtomicGet
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_AtomicSet(SDL_atomic_t *a, int v);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the value of an atomic variable.
|
|
||||||
*
|
|
||||||
* ***Note: If you don't know what this function is for, you shouldn't use
|
|
||||||
* it!***
|
|
||||||
*
|
|
||||||
* \param a a pointer to an SDL_atomic_t variable.
|
|
||||||
* \returns the current value of an atomic variable.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.2.
|
|
||||||
*
|
|
||||||
* \sa SDL_AtomicSet
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_AtomicGet(SDL_atomic_t *a);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add to an atomic variable.
|
|
||||||
*
|
|
||||||
* This function also acts as a full memory barrier.
|
|
||||||
*
|
|
||||||
* ***Note: If you don't know what this function is for, you shouldn't use
|
|
||||||
* it!***
|
|
||||||
*
|
|
||||||
* \param a a pointer to an SDL_atomic_t variable to be modified.
|
|
||||||
* \param v the desired value to add.
|
|
||||||
* \returns the previous value of the atomic variable.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.2.
|
|
||||||
*
|
|
||||||
* \sa SDL_AtomicDecRef
|
|
||||||
* \sa SDL_AtomicIncRef
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_atomic_t *a, int v);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Increment an atomic variable used as a reference count.
|
|
||||||
*/
|
|
||||||
#ifndef SDL_AtomicIncRef
|
|
||||||
#define SDL_AtomicIncRef(a) SDL_AtomicAdd(a, 1)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Decrement an atomic variable used as a reference count.
|
|
||||||
*
|
|
||||||
* \return SDL_TRUE if the variable reached zero after decrementing,
|
|
||||||
* SDL_FALSE otherwise
|
|
||||||
*/
|
|
||||||
#ifndef SDL_AtomicDecRef
|
|
||||||
#define SDL_AtomicDecRef(a) (SDL_AtomicAdd(a, -1) == 1)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set a pointer to a new value if it is currently an old value.
|
|
||||||
*
|
|
||||||
* ***Note: If you don't know what this function is for, you shouldn't use
|
|
||||||
* it!***
|
|
||||||
*
|
|
||||||
* \param a a pointer to a pointer.
|
|
||||||
* \param oldval the old pointer value.
|
|
||||||
* \param newval the new pointer value.
|
|
||||||
* \returns SDL_TRUE if the pointer was set, SDL_FALSE otherwise.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_AtomicCAS
|
|
||||||
* \sa SDL_AtomicGetPtr
|
|
||||||
* \sa SDL_AtomicSetPtr
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr(void **a, void *oldval, void *newval);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set a pointer to a value atomically.
|
|
||||||
*
|
|
||||||
* ***Note: If you don't know what this function is for, you shouldn't use
|
|
||||||
* it!***
|
|
||||||
*
|
|
||||||
* \param a a pointer to a pointer.
|
|
||||||
* \param v the desired pointer value.
|
|
||||||
* \returns the previous value of the pointer.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.2.
|
|
||||||
*
|
|
||||||
* \sa SDL_AtomicCASPtr
|
|
||||||
* \sa SDL_AtomicGetPtr
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void* SDLCALL SDL_AtomicSetPtr(void **a, void* v);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the value of a pointer atomically.
|
|
||||||
*
|
|
||||||
* ***Note: If you don't know what this function is for, you shouldn't use
|
|
||||||
* it!***
|
|
||||||
*
|
|
||||||
* \param a a pointer to a pointer.
|
|
||||||
* \returns the current value of a pointer.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.2.
|
|
||||||
*
|
|
||||||
* \sa SDL_AtomicCASPtr
|
|
||||||
* \sa SDL_AtomicSetPtr
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void* SDLCALL SDL_AtomicGetPtr(void **a);
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <SDL2/close_code.h>
|
|
||||||
|
|
||||||
#endif /* SDL_atomic_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,141 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2025 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* # CategoryClipboard
|
|
||||||
*
|
|
||||||
* Include file for SDL clipboard handling
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_clipboard_h_
|
|
||||||
#define SDL_clipboard_h_
|
|
||||||
|
|
||||||
#include <SDL2/SDL_stdinc.h>
|
|
||||||
|
|
||||||
#include <SDL2/begin_code.h>
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Function prototypes */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Put UTF-8 text into the clipboard.
|
|
||||||
*
|
|
||||||
* \param text the text to store in the clipboard.
|
|
||||||
* \returns 0 on success or a negative error code on failure; call
|
|
||||||
* SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetClipboardText
|
|
||||||
* \sa SDL_HasClipboardText
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get UTF-8 text from the clipboard, which must be freed with SDL_free().
|
|
||||||
*
|
|
||||||
* This functions returns empty string if there was not enough memory left for
|
|
||||||
* a copy of the clipboard's content.
|
|
||||||
*
|
|
||||||
* \returns the clipboard text on success or an empty string on failure; call
|
|
||||||
* SDL_GetError() for more information. Caller must call SDL_free()
|
|
||||||
* on the returned pointer when done with it (even if there was an
|
|
||||||
* error).
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_HasClipboardText
|
|
||||||
* \sa SDL_SetClipboardText
|
|
||||||
*/
|
|
||||||
extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Query whether the clipboard exists and contains a non-empty text string.
|
|
||||||
*
|
|
||||||
* \returns SDL_TRUE if the clipboard has text, or SDL_FALSE if it does not.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetClipboardText
|
|
||||||
* \sa SDL_SetClipboardText
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Put UTF-8 text into the primary selection.
|
|
||||||
*
|
|
||||||
* \param text the text to store in the primary selection.
|
|
||||||
* \returns 0 on success or a negative error code on failure; call
|
|
||||||
* SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.26.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetPrimarySelectionText
|
|
||||||
* \sa SDL_HasPrimarySelectionText
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SetPrimarySelectionText(const char *text);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get UTF-8 text from the primary selection, which must be freed with
|
|
||||||
* SDL_free().
|
|
||||||
*
|
|
||||||
* This functions returns empty string if there was not enough memory left for
|
|
||||||
* a copy of the primary selection's content.
|
|
||||||
*
|
|
||||||
* \returns the primary selection text on success or an empty string on
|
|
||||||
* failure; call SDL_GetError() for more information. Caller must
|
|
||||||
* call SDL_free() on the returned pointer when done with it (even if
|
|
||||||
* there was an error).
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.26.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_HasPrimarySelectionText
|
|
||||||
* \sa SDL_SetPrimarySelectionText
|
|
||||||
*/
|
|
||||||
extern DECLSPEC char * SDLCALL SDL_GetPrimarySelectionText(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Query whether the primary selection exists and contains a non-empty text
|
|
||||||
* string.
|
|
||||||
*
|
|
||||||
* \returns SDL_TRUE if the primary selection has text, or SDL_FALSE if it
|
|
||||||
* does not.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.26.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetPrimarySelectionText
|
|
||||||
* \sa SDL_SetPrimarySelectionText
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasPrimarySelectionText(void);
|
|
||||||
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include <SDL2/close_code.h>
|
|
||||||
|
|
||||||
#endif /* SDL_clipboard_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2025 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_config_h_
|
|
||||||
#define SDL_config_h_
|
|
||||||
|
|
||||||
#include <SDL2/SDL_platform.h>
|
|
||||||
|
|
||||||
/* WIKI CATEGORY: - */
|
|
||||||
|
|
||||||
/* Add any platform that doesn't build using the configure system. */
|
|
||||||
#if defined(__WIN32__)
|
|
||||||
#include <SDL2/SDL_config_windows.h>
|
|
||||||
#elif defined(__WINRT__)
|
|
||||||
#include <SDL2/SDL_config_winrt.h>
|
|
||||||
#elif defined(__WINGDK__)
|
|
||||||
#include <SDL2/SDL_config_wingdk.h>
|
|
||||||
#elif defined(__XBOXONE__) || defined(__XBOXSERIES__)
|
|
||||||
#include <SDL2/SDL_config_xbox.h>
|
|
||||||
#elif defined(__MACOSX__)
|
|
||||||
#include <SDL2/SDL_config_macosx.h>
|
|
||||||
#elif defined(__IPHONEOS__)
|
|
||||||
#include <SDL2/SDL_config_iphoneos.h>
|
|
||||||
#elif defined(__ANDROID__)
|
|
||||||
#include <SDL2/SDL_config_android.h>
|
|
||||||
#elif defined(__OS2__)
|
|
||||||
#include <SDL2/SDL_config_os2.h>
|
|
||||||
#elif defined(__EMSCRIPTEN__)
|
|
||||||
#include <SDL2/SDL_config_emscripten.h>
|
|
||||||
#elif defined(__NGAGE__)
|
|
||||||
#include <SDL2/SDL_config_ngage.h>
|
|
||||||
#else
|
|
||||||
/* This is a minimal configuration just to get SDL running on new platforms. */
|
|
||||||
#include <SDL2/SDL_config_minimal.h>
|
|
||||||
#endif /* platform config */
|
|
||||||
|
|
||||||
#ifdef USING_GENERATED_CONFIG_H
|
|
||||||
#error Wrong SDL_config.h, check your include path?
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* SDL_config_h_ */
|
|
||||||
@@ -1,277 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2025 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_config_macosx_h_
|
|
||||||
#define SDL_config_macosx_h_
|
|
||||||
#define SDL_config_h_
|
|
||||||
|
|
||||||
#include <SDL2/SDL_platform.h>
|
|
||||||
|
|
||||||
/* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */
|
|
||||||
#include <AvailabilityMacros.h>
|
|
||||||
|
|
||||||
/* This is a set of defines to configure the SDL features */
|
|
||||||
|
|
||||||
#ifdef __LP64__
|
|
||||||
#define SIZEOF_VOIDP 8
|
|
||||||
#else
|
|
||||||
#define SIZEOF_VOIDP 4
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Useful headers */
|
|
||||||
#define STDC_HEADERS 1
|
|
||||||
#define HAVE_ALLOCA_H 1
|
|
||||||
#define HAVE_CTYPE_H 1
|
|
||||||
#define HAVE_FLOAT_H 1
|
|
||||||
#define HAVE_INTTYPES_H 1
|
|
||||||
#define HAVE_LIMITS_H 1
|
|
||||||
#define HAVE_MATH_H 1
|
|
||||||
#define HAVE_SIGNAL_H 1
|
|
||||||
#define HAVE_STDINT_H 1
|
|
||||||
#define HAVE_STDIO_H 1
|
|
||||||
#define HAVE_STRING_H 1
|
|
||||||
#define HAVE_SYS_TYPES_H 1
|
|
||||||
#define HAVE_LIBUNWIND_H 1
|
|
||||||
|
|
||||||
/* C library functions */
|
|
||||||
#define HAVE_DLOPEN 1
|
|
||||||
#define HAVE_MALLOC 1
|
|
||||||
#define HAVE_CALLOC 1
|
|
||||||
#define HAVE_REALLOC 1
|
|
||||||
#define HAVE_FREE 1
|
|
||||||
#define HAVE_ALLOCA 1
|
|
||||||
#define HAVE_GETENV 1
|
|
||||||
#define HAVE_SETENV 1
|
|
||||||
#define HAVE_PUTENV 1
|
|
||||||
#define HAVE_UNSETENV 1
|
|
||||||
#define HAVE_QSORT 1
|
|
||||||
#define HAVE_BSEARCH 1
|
|
||||||
#define HAVE_ABS 1
|
|
||||||
#define HAVE_BCOPY 1
|
|
||||||
#define HAVE_MEMSET 1
|
|
||||||
#define HAVE_MEMCPY 1
|
|
||||||
#define HAVE_MEMMOVE 1
|
|
||||||
#define HAVE_MEMCMP 1
|
|
||||||
#define HAVE_STRLEN 1
|
|
||||||
#define HAVE_STRLCPY 1
|
|
||||||
#define HAVE_STRLCAT 1
|
|
||||||
#define HAVE_STRCHR 1
|
|
||||||
#define HAVE_STRRCHR 1
|
|
||||||
#define HAVE_STRSTR 1
|
|
||||||
#define HAVE_STRTOK_R 1
|
|
||||||
#define HAVE_STRTOL 1
|
|
||||||
#define HAVE_STRTOUL 1
|
|
||||||
#define HAVE_STRTOLL 1
|
|
||||||
#define HAVE_STRTOULL 1
|
|
||||||
#define HAVE_STRTOD 1
|
|
||||||
#define HAVE_ATOI 1
|
|
||||||
#define HAVE_ATOF 1
|
|
||||||
#define HAVE_STRCMP 1
|
|
||||||
#define HAVE_STRNCMP 1
|
|
||||||
#define HAVE_STRCASECMP 1
|
|
||||||
#define HAVE_STRNCASECMP 1
|
|
||||||
#define HAVE_STRCASESTR 1
|
|
||||||
#define HAVE_VSSCANF 1
|
|
||||||
#define HAVE_VSNPRINTF 1
|
|
||||||
#define HAVE_M_PI 1
|
|
||||||
#define HAVE_ACOS 1
|
|
||||||
#define HAVE_ACOSF 1
|
|
||||||
#define HAVE_ASIN 1
|
|
||||||
#define HAVE_ASINF 1
|
|
||||||
#define HAVE_ATAN 1
|
|
||||||
#define HAVE_ATANF 1
|
|
||||||
#define HAVE_ATAN2 1
|
|
||||||
#define HAVE_ATAN2F 1
|
|
||||||
#define HAVE_CEIL 1
|
|
||||||
#define HAVE_CEILF 1
|
|
||||||
#define HAVE_COPYSIGN 1
|
|
||||||
#define HAVE_COPYSIGNF 1
|
|
||||||
#define HAVE_COS 1
|
|
||||||
#define HAVE_COSF 1
|
|
||||||
#define HAVE_EXP 1
|
|
||||||
#define HAVE_EXPF 1
|
|
||||||
#define HAVE_FABS 1
|
|
||||||
#define HAVE_FABSF 1
|
|
||||||
#define HAVE_FLOOR 1
|
|
||||||
#define HAVE_FLOORF 1
|
|
||||||
#define HAVE_FMOD 1
|
|
||||||
#define HAVE_FMODF 1
|
|
||||||
#define HAVE_LOG 1
|
|
||||||
#define HAVE_LOGF 1
|
|
||||||
#define HAVE_LOG10 1
|
|
||||||
#define HAVE_LOG10F 1
|
|
||||||
#define HAVE_LROUND 1
|
|
||||||
#define HAVE_LROUNDF 1
|
|
||||||
#define HAVE_POW 1
|
|
||||||
#define HAVE_POWF 1
|
|
||||||
#define HAVE_ROUND 1
|
|
||||||
#define HAVE_ROUNDF 1
|
|
||||||
#define HAVE_SCALBN 1
|
|
||||||
#define HAVE_SCALBNF 1
|
|
||||||
#define HAVE_SIN 1
|
|
||||||
#define HAVE_SINF 1
|
|
||||||
#define HAVE_SQRT 1
|
|
||||||
#define HAVE_SQRTF 1
|
|
||||||
#define HAVE_TAN 1
|
|
||||||
#define HAVE_TANF 1
|
|
||||||
#define HAVE_TRUNC 1
|
|
||||||
#define HAVE_TRUNCF 1
|
|
||||||
#define HAVE_SIGACTION 1
|
|
||||||
#define HAVE_SETJMP 1
|
|
||||||
#define HAVE_NANOSLEEP 1
|
|
||||||
#define HAVE_SYSCONF 1
|
|
||||||
#define HAVE_SYSCTLBYNAME 1
|
|
||||||
|
|
||||||
#if defined(__has_include) && (defined(__i386__) || defined(__x86_64))
|
|
||||||
# if __has_include(<immintrin.h>)
|
|
||||||
# define HAVE_IMMINTRIN_H 1
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1070)
|
|
||||||
#define HAVE_O_CLOEXEC 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define HAVE_GCC_ATOMICS 1
|
|
||||||
|
|
||||||
/* Enable various audio drivers */
|
|
||||||
#define SDL_AUDIO_DRIVER_COREAUDIO 1
|
|
||||||
#define SDL_AUDIO_DRIVER_DISK 1
|
|
||||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
|
||||||
|
|
||||||
/* Enable various input drivers */
|
|
||||||
#define SDL_JOYSTICK_HIDAPI 1
|
|
||||||
#define SDL_JOYSTICK_IOKIT 1
|
|
||||||
#define SDL_JOYSTICK_VIRTUAL 1
|
|
||||||
#define SDL_HAPTIC_IOKIT 1
|
|
||||||
|
|
||||||
/* The MFI controller support requires ARC Objective C runtime */
|
|
||||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 && !defined(__i386__)
|
|
||||||
#define SDL_JOYSTICK_MFI 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Enable the dummy sensor driver */
|
|
||||||
#define SDL_SENSOR_DUMMY 1
|
|
||||||
|
|
||||||
/* Enable various shared object loading systems */
|
|
||||||
#define SDL_LOADSO_DLOPEN 1
|
|
||||||
|
|
||||||
/* Enable various threading systems */
|
|
||||||
#define SDL_THREAD_PTHREAD 1
|
|
||||||
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
|
|
||||||
|
|
||||||
/* Enable various timer systems */
|
|
||||||
#define SDL_TIMER_UNIX 1
|
|
||||||
|
|
||||||
/* Enable various video drivers */
|
|
||||||
#define SDL_VIDEO_DRIVER_COCOA 1
|
|
||||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
|
||||||
#undef SDL_VIDEO_DRIVER_X11
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/opt/X11/lib/libX11.6.dylib"
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/opt/X11/lib/libXext.6.dylib"
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "/opt/X11/lib/libXi.6.dylib"
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/opt/X11/lib/libXrandr.2.dylib"
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/opt/X11/lib/libXss.1.dylib"
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_XDBE 1
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_XRANDR 1
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_XSHAPE 1
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM 1
|
|
||||||
|
|
||||||
#ifdef MAC_OS_X_VERSION_10_8
|
|
||||||
/*
|
|
||||||
* No matter the versions targeted, this is the 10.8 or later SDK, so you have
|
|
||||||
* to use the external Xquartz, which is a more modern Xlib. Previous SDKs
|
|
||||||
* used an older Xlib.
|
|
||||||
*/
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_XINPUT2 1
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef SDL_VIDEO_RENDER_OGL
|
|
||||||
#define SDL_VIDEO_RENDER_OGL 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef SDL_VIDEO_RENDER_OGL_ES2
|
|
||||||
#define SDL_VIDEO_RENDER_OGL_ES2 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Metal only supported on 64-bit architectures with 10.11+ */
|
|
||||||
#if TARGET_RT_64_BIT && (MAC_OS_X_VERSION_MAX_ALLOWED >= 101100)
|
|
||||||
#define SDL_PLATFORM_SUPPORTS_METAL 1
|
|
||||||
#else
|
|
||||||
#define SDL_PLATFORM_SUPPORTS_METAL 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef SDL_VIDEO_RENDER_METAL
|
|
||||||
#if SDL_PLATFORM_SUPPORTS_METAL
|
|
||||||
#define SDL_VIDEO_RENDER_METAL 1
|
|
||||||
#else
|
|
||||||
#define SDL_VIDEO_RENDER_METAL 0
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Enable OpenGL support */
|
|
||||||
#ifndef SDL_VIDEO_OPENGL
|
|
||||||
#define SDL_VIDEO_OPENGL 1
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_VIDEO_OPENGL_ES2
|
|
||||||
#define SDL_VIDEO_OPENGL_ES2 1
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_VIDEO_OPENGL_EGL
|
|
||||||
#define SDL_VIDEO_OPENGL_EGL 1
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_VIDEO_OPENGL_CGL
|
|
||||||
#define SDL_VIDEO_OPENGL_CGL 1
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_VIDEO_OPENGL_GLX
|
|
||||||
#define SDL_VIDEO_OPENGL_GLX 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Enable Vulkan and Metal support */
|
|
||||||
#ifndef SDL_VIDEO_VULKAN
|
|
||||||
#if SDL_PLATFORM_SUPPORTS_METAL
|
|
||||||
#define SDL_VIDEO_VULKAN 1
|
|
||||||
#else
|
|
||||||
#define SDL_VIDEO_VULKAN 0
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef SDL_VIDEO_METAL
|
|
||||||
#if SDL_PLATFORM_SUPPORTS_METAL
|
|
||||||
#define SDL_VIDEO_METAL 1
|
|
||||||
#else
|
|
||||||
#define SDL_VIDEO_METAL 0
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Enable system power support */
|
|
||||||
#define SDL_POWER_MACOSX 1
|
|
||||||
|
|
||||||
/* enable filesystem support */
|
|
||||||
#define SDL_FILESYSTEM_COCOA 1
|
|
||||||
|
|
||||||
/* Enable assembly routines */
|
|
||||||
#ifdef __ppc__
|
|
||||||
#define SDL_ALTIVEC_BLITTERS 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* SDL_config_macosx_h_ */
|
|
||||||
@@ -1,602 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2025 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* WIKI CATEGORY: CPUInfo */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* # CategoryCPUInfo
|
|
||||||
*
|
|
||||||
* CPU feature detection for SDL.
|
|
||||||
*
|
|
||||||
* These functions are largely concerned with reporting if the system has
|
|
||||||
* access to various SIMD instruction sets, but also has other important info
|
|
||||||
* to share, such as number of logical CPU cores.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_cpuinfo_h_
|
|
||||||
#define SDL_cpuinfo_h_
|
|
||||||
|
|
||||||
#include <SDL2/SDL_stdinc.h>
|
|
||||||
|
|
||||||
/* Need to do this here because intrin.h has C++ code in it */
|
|
||||||
/* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */
|
|
||||||
#if defined(_MSC_VER) && (_MSC_VER >= 1500) && (defined(_M_IX86) || defined(_M_X64))
|
|
||||||
#ifdef __clang__
|
|
||||||
/* As of Clang 11, '_m_prefetchw' is conflicting with the winnt.h's version,
|
|
||||||
so we define the needed '_m_prefetch' here as a pseudo-header, until the issue is fixed. */
|
|
||||||
|
|
||||||
#ifndef __PRFCHWINTRIN_H
|
|
||||||
#define __PRFCHWINTRIN_H
|
|
||||||
|
|
||||||
static __inline__ void __attribute__((__always_inline__, __nodebug__))
|
|
||||||
_m_prefetch(void *__P)
|
|
||||||
{
|
|
||||||
__builtin_prefetch (__P, 0, 3 /* _MM_HINT_T0 */);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* __PRFCHWINTRIN_H */
|
|
||||||
#endif /* __clang__ */
|
|
||||||
#include <intrin.h>
|
|
||||||
#ifndef _WIN64
|
|
||||||
#ifndef __MMX__
|
|
||||||
#define __MMX__
|
|
||||||
#endif
|
|
||||||
/*
|
|
||||||
#ifndef __3dNOW__
|
|
||||||
#define __3dNOW__
|
|
||||||
#endif
|
|
||||||
*/
|
|
||||||
#endif
|
|
||||||
#ifndef __SSE__
|
|
||||||
#define __SSE__
|
|
||||||
#endif
|
|
||||||
#ifndef __SSE2__
|
|
||||||
#define __SSE2__
|
|
||||||
#endif
|
|
||||||
#ifndef __SSE3__
|
|
||||||
#define __SSE3__
|
|
||||||
#endif
|
|
||||||
#elif defined(__MINGW64_VERSION_MAJOR)
|
|
||||||
#include <intrin.h>
|
|
||||||
#if !defined(SDL_DISABLE_ARM_NEON_H) && defined(__ARM_NEON)
|
|
||||||
# include <arm_neon.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_H to have it included. */
|
|
||||||
#if defined(HAVE_ALTIVEC_H) && defined(__ALTIVEC__) && !defined(__APPLE_ALTIVEC__) && defined(SDL_ENABLE_ALTIVEC_H)
|
|
||||||
#include <altivec.h>
|
|
||||||
#endif
|
|
||||||
#if !defined(SDL_DISABLE_ARM_NEON_H)
|
|
||||||
# if defined(__ARM_NEON)
|
|
||||||
# include <arm_neon.h>
|
|
||||||
# elif defined(__WINDOWS__) || defined(__WINRT__) || defined(__GDK__)
|
|
||||||
/* Visual Studio doesn't define __ARM_ARCH, but _M_ARM (if set, always 7), and _M_ARM64 (if set, always 1). */
|
|
||||||
# if defined(_M_ARM)
|
|
||||||
# include <armintr.h>
|
|
||||||
# include <arm_neon.h>
|
|
||||||
# define __ARM_NEON 1 /* Set __ARM_NEON so that it can be used elsewhere, at compile time */
|
|
||||||
# endif
|
|
||||||
# if defined (_M_ARM64)
|
|
||||||
# include <arm64intr.h>
|
|
||||||
# include <arm64_neon.h>
|
|
||||||
# define __ARM_NEON 1 /* Set __ARM_NEON so that it can be used elsewhere, at compile time */
|
|
||||||
# define __ARM_ARCH 8
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
#endif /* compiler version */
|
|
||||||
|
|
||||||
#if defined(__3dNOW__) && !defined(SDL_DISABLE_MM3DNOW_H)
|
|
||||||
#include <mm3dnow.h>
|
|
||||||
#endif
|
|
||||||
#if defined(__loongarch_sx) && !defined(SDL_DISABLE_LSX_H)
|
|
||||||
#include <lsxintrin.h>
|
|
||||||
#define __LSX__
|
|
||||||
#endif
|
|
||||||
#if defined(__loongarch_asx) && !defined(SDL_DISABLE_LASX_H)
|
|
||||||
#include <lasxintrin.h>
|
|
||||||
#define __LASX__
|
|
||||||
#endif
|
|
||||||
#if defined(HAVE_IMMINTRIN_H) && !defined(SDL_DISABLE_IMMINTRIN_H)
|
|
||||||
#include <immintrin.h>
|
|
||||||
#else
|
|
||||||
#if defined(__MMX__) && !defined(SDL_DISABLE_MMINTRIN_H)
|
|
||||||
#include <mmintrin.h>
|
|
||||||
#endif
|
|
||||||
#if defined(__SSE__) && !defined(SDL_DISABLE_XMMINTRIN_H)
|
|
||||||
#include <xmmintrin.h>
|
|
||||||
#endif
|
|
||||||
#if defined(__SSE2__) && !defined(SDL_DISABLE_EMMINTRIN_H)
|
|
||||||
#include <emmintrin.h>
|
|
||||||
#endif
|
|
||||||
#if defined(__SSE3__) && !defined(SDL_DISABLE_PMMINTRIN_H)
|
|
||||||
#include <pmmintrin.h>
|
|
||||||
#endif
|
|
||||||
#endif /* HAVE_IMMINTRIN_H */
|
|
||||||
|
|
||||||
#include <SDL2/begin_code.h>
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* This is a guess for the cacheline size used for padding.
|
|
||||||
* Most x86 processors have a 64 byte cache line.
|
|
||||||
* The 64-bit PowerPC processors have a 128 byte cache line.
|
|
||||||
* We'll use the larger value to be generally safe.
|
|
||||||
*/
|
|
||||||
#define SDL_CACHELINE_SIZE 128
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the number of CPU cores available.
|
|
||||||
*
|
|
||||||
* \returns the total number of logical CPU cores. On CPUs that include
|
|
||||||
* technologies such as hyperthreading, the number of logical cores
|
|
||||||
* may be more than the number of physical cores.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GetCPUCount(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine the L1 cache line size of the CPU.
|
|
||||||
*
|
|
||||||
* This is useful for determining multi-threaded structure padding or SIMD
|
|
||||||
* prefetch sizes.
|
|
||||||
*
|
|
||||||
* \returns the L1 cache line size of the CPU, in bytes.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GetCPUCacheLineSize(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine whether the CPU has the RDTSC instruction.
|
|
||||||
*
|
|
||||||
* This always returns false on CPUs that aren't using Intel instruction sets.
|
|
||||||
*
|
|
||||||
* \returns SDL_TRUE if the CPU has the RDTSC instruction or SDL_FALSE if not.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_Has3DNow
|
|
||||||
* \sa SDL_HasAltiVec
|
|
||||||
* \sa SDL_HasAVX
|
|
||||||
* \sa SDL_HasAVX2
|
|
||||||
* \sa SDL_HasMMX
|
|
||||||
* \sa SDL_HasSSE
|
|
||||||
* \sa SDL_HasSSE2
|
|
||||||
* \sa SDL_HasSSE3
|
|
||||||
* \sa SDL_HasSSE41
|
|
||||||
* \sa SDL_HasSSE42
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine whether the CPU has AltiVec features.
|
|
||||||
*
|
|
||||||
* This always returns false on CPUs that aren't using PowerPC instruction
|
|
||||||
* sets.
|
|
||||||
*
|
|
||||||
* \returns SDL_TRUE if the CPU has AltiVec features or SDL_FALSE if not.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_Has3DNow
|
|
||||||
* \sa SDL_HasAVX
|
|
||||||
* \sa SDL_HasAVX2
|
|
||||||
* \sa SDL_HasMMX
|
|
||||||
* \sa SDL_HasRDTSC
|
|
||||||
* \sa SDL_HasSSE
|
|
||||||
* \sa SDL_HasSSE2
|
|
||||||
* \sa SDL_HasSSE3
|
|
||||||
* \sa SDL_HasSSE41
|
|
||||||
* \sa SDL_HasSSE42
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine whether the CPU has MMX features.
|
|
||||||
*
|
|
||||||
* This always returns false on CPUs that aren't using Intel instruction sets.
|
|
||||||
*
|
|
||||||
* \returns SDL_TRUE if the CPU has MMX features or SDL_FALSE if not.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_Has3DNow
|
|
||||||
* \sa SDL_HasAltiVec
|
|
||||||
* \sa SDL_HasAVX
|
|
||||||
* \sa SDL_HasAVX2
|
|
||||||
* \sa SDL_HasRDTSC
|
|
||||||
* \sa SDL_HasSSE
|
|
||||||
* \sa SDL_HasSSE2
|
|
||||||
* \sa SDL_HasSSE3
|
|
||||||
* \sa SDL_HasSSE41
|
|
||||||
* \sa SDL_HasSSE42
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine whether the CPU has 3DNow! features.
|
|
||||||
*
|
|
||||||
* This always returns false on CPUs that aren't using AMD instruction sets.
|
|
||||||
*
|
|
||||||
* \returns SDL_TRUE if the CPU has 3DNow! features or SDL_FALSE if not.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_HasAltiVec
|
|
||||||
* \sa SDL_HasAVX
|
|
||||||
* \sa SDL_HasAVX2
|
|
||||||
* \sa SDL_HasMMX
|
|
||||||
* \sa SDL_HasRDTSC
|
|
||||||
* \sa SDL_HasSSE
|
|
||||||
* \sa SDL_HasSSE2
|
|
||||||
* \sa SDL_HasSSE3
|
|
||||||
* \sa SDL_HasSSE41
|
|
||||||
* \sa SDL_HasSSE42
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine whether the CPU has SSE features.
|
|
||||||
*
|
|
||||||
* This always returns false on CPUs that aren't using Intel instruction sets.
|
|
||||||
*
|
|
||||||
* \returns SDL_TRUE if the CPU has SSE features or SDL_FALSE if not.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_Has3DNow
|
|
||||||
* \sa SDL_HasAltiVec
|
|
||||||
* \sa SDL_HasAVX
|
|
||||||
* \sa SDL_HasAVX2
|
|
||||||
* \sa SDL_HasMMX
|
|
||||||
* \sa SDL_HasRDTSC
|
|
||||||
* \sa SDL_HasSSE2
|
|
||||||
* \sa SDL_HasSSE3
|
|
||||||
* \sa SDL_HasSSE41
|
|
||||||
* \sa SDL_HasSSE42
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine whether the CPU has SSE2 features.
|
|
||||||
*
|
|
||||||
* This always returns false on CPUs that aren't using Intel instruction sets.
|
|
||||||
*
|
|
||||||
* \returns SDL_TRUE if the CPU has SSE2 features or SDL_FALSE if not.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_Has3DNow
|
|
||||||
* \sa SDL_HasAltiVec
|
|
||||||
* \sa SDL_HasAVX
|
|
||||||
* \sa SDL_HasAVX2
|
|
||||||
* \sa SDL_HasMMX
|
|
||||||
* \sa SDL_HasRDTSC
|
|
||||||
* \sa SDL_HasSSE
|
|
||||||
* \sa SDL_HasSSE3
|
|
||||||
* \sa SDL_HasSSE41
|
|
||||||
* \sa SDL_HasSSE42
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine whether the CPU has SSE3 features.
|
|
||||||
*
|
|
||||||
* This always returns false on CPUs that aren't using Intel instruction sets.
|
|
||||||
*
|
|
||||||
* \returns SDL_TRUE if the CPU has SSE3 features or SDL_FALSE if not.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_Has3DNow
|
|
||||||
* \sa SDL_HasAltiVec
|
|
||||||
* \sa SDL_HasAVX
|
|
||||||
* \sa SDL_HasAVX2
|
|
||||||
* \sa SDL_HasMMX
|
|
||||||
* \sa SDL_HasRDTSC
|
|
||||||
* \sa SDL_HasSSE
|
|
||||||
* \sa SDL_HasSSE2
|
|
||||||
* \sa SDL_HasSSE41
|
|
||||||
* \sa SDL_HasSSE42
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE3(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine whether the CPU has SSE4.1 features.
|
|
||||||
*
|
|
||||||
* This always returns false on CPUs that aren't using Intel instruction sets.
|
|
||||||
*
|
|
||||||
* \returns SDL_TRUE if the CPU has SSE4.1 features or SDL_FALSE if not.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_Has3DNow
|
|
||||||
* \sa SDL_HasAltiVec
|
|
||||||
* \sa SDL_HasAVX
|
|
||||||
* \sa SDL_HasAVX2
|
|
||||||
* \sa SDL_HasMMX
|
|
||||||
* \sa SDL_HasRDTSC
|
|
||||||
* \sa SDL_HasSSE
|
|
||||||
* \sa SDL_HasSSE2
|
|
||||||
* \sa SDL_HasSSE3
|
|
||||||
* \sa SDL_HasSSE42
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE41(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine whether the CPU has SSE4.2 features.
|
|
||||||
*
|
|
||||||
* This always returns false on CPUs that aren't using Intel instruction sets.
|
|
||||||
*
|
|
||||||
* \returns SDL_TRUE if the CPU has SSE4.2 features or SDL_FALSE if not.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_Has3DNow
|
|
||||||
* \sa SDL_HasAltiVec
|
|
||||||
* \sa SDL_HasAVX
|
|
||||||
* \sa SDL_HasAVX2
|
|
||||||
* \sa SDL_HasMMX
|
|
||||||
* \sa SDL_HasRDTSC
|
|
||||||
* \sa SDL_HasSSE
|
|
||||||
* \sa SDL_HasSSE2
|
|
||||||
* \sa SDL_HasSSE3
|
|
||||||
* \sa SDL_HasSSE41
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE42(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine whether the CPU has AVX features.
|
|
||||||
*
|
|
||||||
* This always returns false on CPUs that aren't using Intel instruction sets.
|
|
||||||
*
|
|
||||||
* \returns SDL_TRUE if the CPU has AVX features or SDL_FALSE if not.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.2.
|
|
||||||
*
|
|
||||||
* \sa SDL_Has3DNow
|
|
||||||
* \sa SDL_HasAltiVec
|
|
||||||
* \sa SDL_HasAVX2
|
|
||||||
* \sa SDL_HasMMX
|
|
||||||
* \sa SDL_HasRDTSC
|
|
||||||
* \sa SDL_HasSSE
|
|
||||||
* \sa SDL_HasSSE2
|
|
||||||
* \sa SDL_HasSSE3
|
|
||||||
* \sa SDL_HasSSE41
|
|
||||||
* \sa SDL_HasSSE42
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine whether the CPU has AVX2 features.
|
|
||||||
*
|
|
||||||
* This always returns false on CPUs that aren't using Intel instruction sets.
|
|
||||||
*
|
|
||||||
* \returns SDL_TRUE if the CPU has AVX2 features or SDL_FALSE if not.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.4.
|
|
||||||
*
|
|
||||||
* \sa SDL_Has3DNow
|
|
||||||
* \sa SDL_HasAltiVec
|
|
||||||
* \sa SDL_HasAVX
|
|
||||||
* \sa SDL_HasMMX
|
|
||||||
* \sa SDL_HasRDTSC
|
|
||||||
* \sa SDL_HasSSE
|
|
||||||
* \sa SDL_HasSSE2
|
|
||||||
* \sa SDL_HasSSE3
|
|
||||||
* \sa SDL_HasSSE41
|
|
||||||
* \sa SDL_HasSSE42
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX2(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine whether the CPU has AVX-512F (foundation) features.
|
|
||||||
*
|
|
||||||
* This always returns false on CPUs that aren't using Intel instruction sets.
|
|
||||||
*
|
|
||||||
* \returns SDL_TRUE if the CPU has AVX-512F features or SDL_FALSE if not.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.9.
|
|
||||||
*
|
|
||||||
* \sa SDL_HasAVX
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX512F(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine whether the CPU has ARM SIMD (ARMv6) features.
|
|
||||||
*
|
|
||||||
* This is different from ARM NEON, which is a different instruction set.
|
|
||||||
*
|
|
||||||
* This always returns false on CPUs that aren't using ARM instruction sets.
|
|
||||||
*
|
|
||||||
* \returns SDL_TRUE if the CPU has ARM SIMD features or SDL_FALSE if not.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.12.
|
|
||||||
*
|
|
||||||
* \sa SDL_HasNEON
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasARMSIMD(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine whether the CPU has NEON (ARM SIMD) features.
|
|
||||||
*
|
|
||||||
* This always returns false on CPUs that aren't using ARM instruction sets.
|
|
||||||
*
|
|
||||||
* \returns SDL_TRUE if the CPU has ARM NEON features or SDL_FALSE if not.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.6.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasNEON(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine whether the CPU has LSX (LOONGARCH SIMD) features.
|
|
||||||
*
|
|
||||||
* This always returns false on CPUs that aren't using LOONGARCH instruction
|
|
||||||
* sets.
|
|
||||||
*
|
|
||||||
* \returns SDL_TRUE if the CPU has LOONGARCH LSX features or SDL_FALSE if
|
|
||||||
* not.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.24.0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasLSX(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine whether the CPU has LASX (LOONGARCH SIMD) features.
|
|
||||||
*
|
|
||||||
* This always returns false on CPUs that aren't using LOONGARCH instruction
|
|
||||||
* sets.
|
|
||||||
*
|
|
||||||
* \returns SDL_TRUE if the CPU has LOONGARCH LASX features or SDL_FALSE if
|
|
||||||
* not.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.24.0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasLASX(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the amount of RAM configured in the system.
|
|
||||||
*
|
|
||||||
* \returns the amount of RAM configured in the system in MiB.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.1.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GetSystemRAM(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Report the alignment this system needs for SIMD allocations.
|
|
||||||
*
|
|
||||||
* This will return the minimum number of bytes to which a pointer must be
|
|
||||||
* aligned to be compatible with SIMD instructions on the current machine. For
|
|
||||||
* example, if the machine supports SSE only, it will return 16, but if it
|
|
||||||
* supports AVX-512F, it'll return 64 (etc). This only reports values for
|
|
||||||
* instruction sets SDL knows about, so if your SDL build doesn't have
|
|
||||||
* SDL_HasAVX512F(), then it might return 16 for the SSE support it sees and
|
|
||||||
* not 64 for the AVX-512 instructions that exist but SDL doesn't know about.
|
|
||||||
* Plan accordingly.
|
|
||||||
*
|
|
||||||
* \returns the alignment in bytes needed for available, known SIMD
|
|
||||||
* instructions.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.10.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_SIMDGetAlignment(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Allocate memory in a SIMD-friendly way.
|
|
||||||
*
|
|
||||||
* This will allocate a block of memory that is suitable for use with SIMD
|
|
||||||
* instructions. Specifically, it will be properly aligned and padded for the
|
|
||||||
* system's supported vector instructions.
|
|
||||||
*
|
|
||||||
* The memory returned will be padded such that it is safe to read or write an
|
|
||||||
* incomplete vector at the end of the memory block. This can be useful so you
|
|
||||||
* don't have to drop back to a scalar fallback at the end of your SIMD
|
|
||||||
* processing loop to deal with the final elements without overflowing the
|
|
||||||
* allocated buffer.
|
|
||||||
*
|
|
||||||
* You must free this memory with SDL_FreeSIMD(), not free() or SDL_free() or
|
|
||||||
* delete[], etc.
|
|
||||||
*
|
|
||||||
* Note that SDL will only deal with SIMD instruction sets it is aware of; for
|
|
||||||
* example, SDL 2.0.8 knows that SSE wants 16-byte vectors (SDL_HasSSE()), and
|
|
||||||
* AVX2 wants 32 bytes (SDL_HasAVX2()), but doesn't know that AVX-512 wants
|
|
||||||
* 64. To be clear: if you can't decide to use an instruction set with an
|
|
||||||
* SDL_Has*() function, don't use that instruction set with memory allocated
|
|
||||||
* through here.
|
|
||||||
*
|
|
||||||
* SDL_AllocSIMD(0) will return a non-NULL pointer, assuming the system isn't
|
|
||||||
* out of memory, but you are not allowed to dereference it (because you only
|
|
||||||
* own zero bytes of that buffer).
|
|
||||||
*
|
|
||||||
* \param len The length, in bytes, of the block to allocate. The actual
|
|
||||||
* allocated block might be larger due to padding, etc.
|
|
||||||
* \returns a pointer to the newly-allocated block, NULL if out of memory.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.10.
|
|
||||||
*
|
|
||||||
* \sa SDL_SIMDGetAlignment
|
|
||||||
* \sa SDL_SIMDRealloc
|
|
||||||
* \sa SDL_SIMDFree
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void * SDLCALL SDL_SIMDAlloc(const size_t len);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reallocate memory obtained from SDL_SIMDAlloc
|
|
||||||
*
|
|
||||||
* It is not valid to use this function on a pointer from anything but
|
|
||||||
* SDL_SIMDAlloc(). It can't be used on pointers from malloc, realloc,
|
|
||||||
* SDL_malloc, memalign, new[], etc.
|
|
||||||
*
|
|
||||||
* \param mem The pointer obtained from SDL_SIMDAlloc. This function also
|
|
||||||
* accepts NULL, at which point this function is the same as
|
|
||||||
* calling SDL_SIMDAlloc with a NULL pointer.
|
|
||||||
* \param len The length, in bytes, of the block to allocated. The actual
|
|
||||||
* allocated block might be larger due to padding, etc. Passing 0
|
|
||||||
* will return a non-NULL pointer, assuming the system isn't out of
|
|
||||||
* memory.
|
|
||||||
* \returns a pointer to the newly-reallocated block, NULL if out of memory.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.14.
|
|
||||||
*
|
|
||||||
* \sa SDL_SIMDGetAlignment
|
|
||||||
* \sa SDL_SIMDAlloc
|
|
||||||
* \sa SDL_SIMDFree
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void * SDLCALL SDL_SIMDRealloc(void *mem, const size_t len);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Deallocate memory obtained from SDL_SIMDAlloc
|
|
||||||
*
|
|
||||||
* It is not valid to use this function on a pointer from anything but
|
|
||||||
* SDL_SIMDAlloc() or SDL_SIMDRealloc(). It can't be used on pointers from
|
|
||||||
* malloc, realloc, SDL_malloc, memalign, new[], etc.
|
|
||||||
*
|
|
||||||
* However, SDL_SIMDFree(NULL) is a legal no-op.
|
|
||||||
*
|
|
||||||
* The memory pointed to by `ptr` is no longer valid for access upon return,
|
|
||||||
* and may be returned to the system or reused by a future allocation. The
|
|
||||||
* pointer passed to this function is no longer safe to dereference once this
|
|
||||||
* function returns, and should be discarded.
|
|
||||||
*
|
|
||||||
* \param ptr The pointer, returned from SDL_SIMDAlloc or SDL_SIMDRealloc, to
|
|
||||||
* deallocate. NULL is a legal no-op.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.10.
|
|
||||||
*
|
|
||||||
* \sa SDL_SIMDAlloc
|
|
||||||
* \sa SDL_SIMDRealloc
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_SIMDFree(void *ptr);
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include <SDL2/close_code.h>
|
|
||||||
|
|
||||||
#endif /* SDL_cpuinfo_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
||||||
@@ -1,396 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2025 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* # CategoryEndian
|
|
||||||
*
|
|
||||||
* Functions for reading and writing endian-specific values
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_endian_h_
|
|
||||||
#define SDL_endian_h_
|
|
||||||
|
|
||||||
#include <SDL2/SDL_stdinc.h>
|
|
||||||
|
|
||||||
#if defined(_MSC_VER) && (_MSC_VER >= 1400)
|
|
||||||
/* As of Clang 11, '_m_prefetchw' is conflicting with the winnt.h's version,
|
|
||||||
so we define the needed '_m_prefetch' here as a pseudo-header, until the issue is fixed. */
|
|
||||||
#ifdef __clang__
|
|
||||||
#ifndef __PRFCHWINTRIN_H
|
|
||||||
#define __PRFCHWINTRIN_H
|
|
||||||
static __inline__ void __attribute__((__always_inline__, __nodebug__))
|
|
||||||
_m_prefetch(void *__P)
|
|
||||||
{
|
|
||||||
__builtin_prefetch(__P, 0, 3 /* _MM_HINT_T0 */);
|
|
||||||
}
|
|
||||||
#endif /* __PRFCHWINTRIN_H */
|
|
||||||
#endif /* __clang__ */
|
|
||||||
|
|
||||||
#include <intrin.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name The two types of endianness
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
#define SDL_LIL_ENDIAN 1234
|
|
||||||
#define SDL_BIG_ENDIAN 4321
|
|
||||||
/* @} */
|
|
||||||
|
|
||||||
#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */
|
|
||||||
#ifdef __linux__
|
|
||||||
#include <endian.h>
|
|
||||||
#define SDL_BYTEORDER __BYTE_ORDER
|
|
||||||
#elif defined(__sun) && defined(__SVR4) /* Solaris */
|
|
||||||
#include <sys/byteorder.h>
|
|
||||||
#if defined(_LITTLE_ENDIAN)
|
|
||||||
#define SDL_BYTEORDER SDL_LIL_ENDIAN
|
|
||||||
#elif defined(_BIG_ENDIAN)
|
|
||||||
#define SDL_BYTEORDER SDL_BIG_ENDIAN
|
|
||||||
#else
|
|
||||||
#error Unsupported endianness
|
|
||||||
#endif
|
|
||||||
#elif defined(__OpenBSD__) || defined(__DragonFly__)
|
|
||||||
#include <endian.h>
|
|
||||||
#define SDL_BYTEORDER BYTE_ORDER
|
|
||||||
#elif defined(__FreeBSD__) || defined(__NetBSD__)
|
|
||||||
#include <sys/endian.h>
|
|
||||||
#define SDL_BYTEORDER BYTE_ORDER
|
|
||||||
/* predefs from newer gcc and clang versions: */
|
|
||||||
#elif defined(__ORDER_LITTLE_ENDIAN__) && defined(__ORDER_BIG_ENDIAN__) && defined(__BYTE_ORDER__)
|
|
||||||
#if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
|
|
||||||
#define SDL_BYTEORDER SDL_LIL_ENDIAN
|
|
||||||
#elif (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
|
|
||||||
#define SDL_BYTEORDER SDL_BIG_ENDIAN
|
|
||||||
#else
|
|
||||||
#error Unsupported endianness
|
|
||||||
#endif /**/
|
|
||||||
#else
|
|
||||||
#if defined(__hppa__) || \
|
|
||||||
defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
|
|
||||||
(defined(__MIPS__) && defined(__MIPSEB__)) || \
|
|
||||||
defined(__ppc__) || defined(__POWERPC__) || defined(__powerpc__) || defined(__PPC__) || \
|
|
||||||
defined(__sparc__) || defined(__sparc)
|
|
||||||
#define SDL_BYTEORDER SDL_BIG_ENDIAN
|
|
||||||
#else
|
|
||||||
#define SDL_BYTEORDER SDL_LIL_ENDIAN
|
|
||||||
#endif
|
|
||||||
#endif /* __linux__ */
|
|
||||||
#endif /* !SDL_BYTEORDER */
|
|
||||||
|
|
||||||
#ifndef SDL_FLOATWORDORDER /* Not defined in SDL_config.h? */
|
|
||||||
/* predefs from newer gcc versions: */
|
|
||||||
#if defined(__ORDER_LITTLE_ENDIAN__) && defined(__ORDER_BIG_ENDIAN__) && defined(__FLOAT_WORD_ORDER__)
|
|
||||||
#if (__FLOAT_WORD_ORDER__ == __ORDER_LITTLE_ENDIAN__)
|
|
||||||
#define SDL_FLOATWORDORDER SDL_LIL_ENDIAN
|
|
||||||
#elif (__FLOAT_WORD_ORDER__ == __ORDER_BIG_ENDIAN__)
|
|
||||||
#define SDL_FLOATWORDORDER SDL_BIG_ENDIAN
|
|
||||||
#else
|
|
||||||
#error Unsupported endianness
|
|
||||||
#endif /**/
|
|
||||||
#elif defined(__MAVERICK__)
|
|
||||||
/* For Maverick, float words are always little-endian. */
|
|
||||||
#define SDL_FLOATWORDORDER SDL_LIL_ENDIAN
|
|
||||||
#elif (defined(__arm__) || defined(__thumb__)) && !defined(__VFP_FP__) && !defined(__ARM_EABI__)
|
|
||||||
/* For FPA, float words are always big-endian. */
|
|
||||||
#define SDL_FLOATWORDORDER SDL_BIG_ENDIAN
|
|
||||||
#else
|
|
||||||
/* By default, assume that floats words follow the memory system mode. */
|
|
||||||
#define SDL_FLOATWORDORDER SDL_BYTEORDER
|
|
||||||
#endif /* __FLOAT_WORD_ORDER__ */
|
|
||||||
#endif /* !SDL_FLOATWORDORDER */
|
|
||||||
|
|
||||||
|
|
||||||
#include <SDL2/begin_code.h>
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_endian.h
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* various modern compilers may have builtin swap */
|
|
||||||
#if defined(__GNUC__) || defined(__clang__)
|
|
||||||
# define HAS_BUILTIN_BSWAP16 (_SDL_HAS_BUILTIN(__builtin_bswap16)) || \
|
|
||||||
(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8))
|
|
||||||
# define HAS_BUILTIN_BSWAP32 (_SDL_HAS_BUILTIN(__builtin_bswap32)) || \
|
|
||||||
(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
|
|
||||||
# define HAS_BUILTIN_BSWAP64 (_SDL_HAS_BUILTIN(__builtin_bswap64)) || \
|
|
||||||
(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
|
|
||||||
|
|
||||||
/* this one is broken */
|
|
||||||
# define HAS_BROKEN_BSWAP (__GNUC__ == 2 && __GNUC_MINOR__ <= 95)
|
|
||||||
#else
|
|
||||||
# define HAS_BUILTIN_BSWAP16 0
|
|
||||||
# define HAS_BUILTIN_BSWAP32 0
|
|
||||||
# define HAS_BUILTIN_BSWAP64 0
|
|
||||||
# define HAS_BROKEN_BSWAP 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if HAS_BUILTIN_BSWAP16
|
|
||||||
#define SDL_Swap16(x) __builtin_bswap16(x)
|
|
||||||
#elif (defined(_MSC_VER) && (_MSC_VER >= 1400)) && !defined(__ICL)
|
|
||||||
#pragma intrinsic(_byteswap_ushort)
|
|
||||||
#define SDL_Swap16(x) _byteswap_ushort(x)
|
|
||||||
#elif defined(__i386__) && !HAS_BROKEN_BSWAP
|
|
||||||
SDL_FORCE_INLINE Uint16
|
|
||||||
SDL_Swap16(Uint16 x)
|
|
||||||
{
|
|
||||||
__asm__("xchgb %b0,%h0": "=q"(x):"0"(x));
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
#elif defined(__x86_64__)
|
|
||||||
SDL_FORCE_INLINE Uint16
|
|
||||||
SDL_Swap16(Uint16 x)
|
|
||||||
{
|
|
||||||
__asm__("xchgb %b0,%h0": "=Q"(x):"0"(x));
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
#elif (defined(__powerpc__) || defined(__ppc__))
|
|
||||||
SDL_FORCE_INLINE Uint16
|
|
||||||
SDL_Swap16(Uint16 x)
|
|
||||||
{
|
|
||||||
int result;
|
|
||||||
|
|
||||||
__asm__("rlwimi %0,%2,8,16,23": "=&r"(result):"0"(x >> 8), "r"(x));
|
|
||||||
return (Uint16)result;
|
|
||||||
}
|
|
||||||
#elif (defined(__m68k__) && !defined(__mcoldfire__))
|
|
||||||
SDL_FORCE_INLINE Uint16
|
|
||||||
SDL_Swap16(Uint16 x)
|
|
||||||
{
|
|
||||||
__asm__("rorw #8,%0": "=d"(x): "0"(x):"cc");
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
#elif defined(__WATCOMC__) && defined(__386__)
|
|
||||||
extern __inline Uint16 SDL_Swap16(Uint16);
|
|
||||||
#pragma aux SDL_Swap16 = \
|
|
||||||
"xchg al, ah" \
|
|
||||||
parm [ax] \
|
|
||||||
modify [ax];
|
|
||||||
#else
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Use this function to swap the byte order of a 16-bit value.
|
|
||||||
*
|
|
||||||
* \param x the value to be swapped.
|
|
||||||
* \returns the swapped value.
|
|
||||||
*
|
|
||||||
* \sa SDL_SwapBE16
|
|
||||||
* \sa SDL_SwapLE16
|
|
||||||
*/
|
|
||||||
SDL_FORCE_INLINE Uint16
|
|
||||||
SDL_Swap16(Uint16 x)
|
|
||||||
{
|
|
||||||
return SDL_static_cast(Uint16, ((x << 8) | (x >> 8)));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if HAS_BUILTIN_BSWAP32
|
|
||||||
#define SDL_Swap32(x) __builtin_bswap32(x)
|
|
||||||
#elif (defined(_MSC_VER) && (_MSC_VER >= 1400)) && !defined(__ICL)
|
|
||||||
#pragma intrinsic(_byteswap_ulong)
|
|
||||||
#define SDL_Swap32(x) _byteswap_ulong(x)
|
|
||||||
#elif defined(__i386__) && !HAS_BROKEN_BSWAP
|
|
||||||
SDL_FORCE_INLINE Uint32
|
|
||||||
SDL_Swap32(Uint32 x)
|
|
||||||
{
|
|
||||||
__asm__("bswap %0": "=r"(x):"0"(x));
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
#elif defined(__x86_64__)
|
|
||||||
SDL_FORCE_INLINE Uint32
|
|
||||||
SDL_Swap32(Uint32 x)
|
|
||||||
{
|
|
||||||
__asm__("bswapl %0": "=r"(x):"0"(x));
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
#elif (defined(__powerpc__) || defined(__ppc__))
|
|
||||||
SDL_FORCE_INLINE Uint32
|
|
||||||
SDL_Swap32(Uint32 x)
|
|
||||||
{
|
|
||||||
Uint32 result;
|
|
||||||
|
|
||||||
__asm__("rlwimi %0,%2,24,16,23": "=&r"(result): "0" (x>>24), "r"(x));
|
|
||||||
__asm__("rlwimi %0,%2,8,8,15" : "=&r"(result): "0" (result), "r"(x));
|
|
||||||
__asm__("rlwimi %0,%2,24,0,7" : "=&r"(result): "0" (result), "r"(x));
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
#elif (defined(__m68k__) && !defined(__mcoldfire__))
|
|
||||||
SDL_FORCE_INLINE Uint32
|
|
||||||
SDL_Swap32(Uint32 x)
|
|
||||||
{
|
|
||||||
__asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0": "=d"(x): "0"(x):"cc");
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
#elif defined(__WATCOMC__) && defined(__386__)
|
|
||||||
extern __inline Uint32 SDL_Swap32(Uint32);
|
|
||||||
#pragma aux SDL_Swap32 = \
|
|
||||||
"bswap eax" \
|
|
||||||
parm [eax] \
|
|
||||||
modify [eax];
|
|
||||||
#else
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Use this function to swap the byte order of a 32-bit value.
|
|
||||||
*
|
|
||||||
* \param x the value to be swapped.
|
|
||||||
* \returns the swapped value.
|
|
||||||
*
|
|
||||||
* \sa SDL_SwapBE32
|
|
||||||
* \sa SDL_SwapLE32
|
|
||||||
*/
|
|
||||||
SDL_FORCE_INLINE Uint32
|
|
||||||
SDL_Swap32(Uint32 x)
|
|
||||||
{
|
|
||||||
return SDL_static_cast(Uint32, ((x << 24) | ((x << 8) & 0x00FF0000) |
|
|
||||||
((x >> 8) & 0x0000FF00) | (x >> 24)));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if HAS_BUILTIN_BSWAP64
|
|
||||||
#define SDL_Swap64(x) __builtin_bswap64(x)
|
|
||||||
#elif (defined(_MSC_VER) && (_MSC_VER >= 1400)) && !defined(__ICL)
|
|
||||||
#pragma intrinsic(_byteswap_uint64)
|
|
||||||
#define SDL_Swap64(x) _byteswap_uint64(x)
|
|
||||||
#elif defined(__i386__) && !HAS_BROKEN_BSWAP
|
|
||||||
SDL_FORCE_INLINE Uint64
|
|
||||||
SDL_Swap64(Uint64 x)
|
|
||||||
{
|
|
||||||
union {
|
|
||||||
struct {
|
|
||||||
Uint32 a, b;
|
|
||||||
} s;
|
|
||||||
Uint64 u;
|
|
||||||
} v;
|
|
||||||
v.u = x;
|
|
||||||
__asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1"
|
|
||||||
: "=r"(v.s.a), "=r"(v.s.b)
|
|
||||||
: "0" (v.s.a), "1"(v.s.b));
|
|
||||||
return v.u;
|
|
||||||
}
|
|
||||||
#elif defined(__x86_64__)
|
|
||||||
SDL_FORCE_INLINE Uint64
|
|
||||||
SDL_Swap64(Uint64 x)
|
|
||||||
{
|
|
||||||
__asm__("bswapq %0": "=r"(x):"0"(x));
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
#elif defined(__WATCOMC__) && defined(__386__)
|
|
||||||
extern __inline Uint64 SDL_Swap64(Uint64);
|
|
||||||
#pragma aux SDL_Swap64 = \
|
|
||||||
"bswap eax" \
|
|
||||||
"bswap edx" \
|
|
||||||
"xchg eax,edx" \
|
|
||||||
parm [eax edx] \
|
|
||||||
modify [eax edx];
|
|
||||||
#else
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Use this function to swap the byte order of a 64-bit value.
|
|
||||||
*
|
|
||||||
* \param x the value to be swapped.
|
|
||||||
* \returns the swapped value.
|
|
||||||
*
|
|
||||||
* \sa SDL_SwapBE64
|
|
||||||
* \sa SDL_SwapLE64
|
|
||||||
*/
|
|
||||||
SDL_FORCE_INLINE Uint64
|
|
||||||
SDL_Swap64(Uint64 x)
|
|
||||||
{
|
|
||||||
Uint32 hi, lo;
|
|
||||||
|
|
||||||
/* Separate into high and low 32-bit values and swap them */
|
|
||||||
lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF);
|
|
||||||
x >>= 32;
|
|
||||||
hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF);
|
|
||||||
x = SDL_Swap32(lo);
|
|
||||||
x <<= 32;
|
|
||||||
x |= SDL_Swap32(hi);
|
|
||||||
return (x);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Use this function to swap the byte order of a floating point value.
|
|
||||||
*
|
|
||||||
* \param x the value to be swapped.
|
|
||||||
* \returns the swapped value.
|
|
||||||
*
|
|
||||||
* \sa SDL_SwapFloatBE
|
|
||||||
* \sa SDL_SwapFloatLE
|
|
||||||
*/
|
|
||||||
SDL_FORCE_INLINE float
|
|
||||||
SDL_SwapFloat(float x)
|
|
||||||
{
|
|
||||||
union {
|
|
||||||
float f;
|
|
||||||
Uint32 ui32;
|
|
||||||
} swapper;
|
|
||||||
swapper.f = x;
|
|
||||||
swapper.ui32 = SDL_Swap32(swapper.ui32);
|
|
||||||
return swapper.f;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* remove extra macros */
|
|
||||||
#undef HAS_BROKEN_BSWAP
|
|
||||||
#undef HAS_BUILTIN_BSWAP16
|
|
||||||
#undef HAS_BUILTIN_BSWAP32
|
|
||||||
#undef HAS_BUILTIN_BSWAP64
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Swap to native
|
|
||||||
* Byteswap item from the specified endianness to the native endianness.
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
|
|
||||||
#define SDL_SwapLE16(X) (X)
|
|
||||||
#define SDL_SwapLE32(X) (X)
|
|
||||||
#define SDL_SwapLE64(X) (X)
|
|
||||||
#define SDL_SwapFloatLE(X) (X)
|
|
||||||
#define SDL_SwapBE16(X) SDL_Swap16(X)
|
|
||||||
#define SDL_SwapBE32(X) SDL_Swap32(X)
|
|
||||||
#define SDL_SwapBE64(X) SDL_Swap64(X)
|
|
||||||
#define SDL_SwapFloatBE(X) SDL_SwapFloat(X)
|
|
||||||
#else
|
|
||||||
#define SDL_SwapLE16(X) SDL_Swap16(X)
|
|
||||||
#define SDL_SwapLE32(X) SDL_Swap32(X)
|
|
||||||
#define SDL_SwapLE64(X) SDL_Swap64(X)
|
|
||||||
#define SDL_SwapFloatLE(X) SDL_SwapFloat(X)
|
|
||||||
#define SDL_SwapBE16(X) (X)
|
|
||||||
#define SDL_SwapBE32(X) (X)
|
|
||||||
#define SDL_SwapBE64(X) (X)
|
|
||||||
#define SDL_SwapFloatBE(X) (X)
|
|
||||||
#endif
|
|
||||||
/* @} *//* Swap to native */
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include <SDL2/close_code.h>
|
|
||||||
|
|
||||||
#endif /* SDL_endian_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
||||||
@@ -1,163 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2025 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* # CategoryError
|
|
||||||
*
|
|
||||||
* Simple error message routines for SDL.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_error_h_
|
|
||||||
#define SDL_error_h_
|
|
||||||
|
|
||||||
#include <SDL2/SDL_stdinc.h>
|
|
||||||
|
|
||||||
#include <SDL2/begin_code.h>
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Public functions */
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the SDL error message for the current thread.
|
|
||||||
*
|
|
||||||
* Calling this function will replace any previous error message that was set.
|
|
||||||
*
|
|
||||||
* This function always returns -1, since SDL frequently uses -1 to signify an
|
|
||||||
* failing result, leading to this idiom:
|
|
||||||
*
|
|
||||||
* ```c
|
|
||||||
* if (error_code) {
|
|
||||||
* return SDL_SetError("This operation has failed: %d", error_code);
|
|
||||||
* }
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* \param fmt a printf()-style message format string.
|
|
||||||
* \param ... additional parameters matching % tokens in the `fmt` string, if
|
|
||||||
* any.
|
|
||||||
* \returns always -1.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_ClearError
|
|
||||||
* \sa SDL_GetError
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve a message about the last error that occurred on the current
|
|
||||||
* thread.
|
|
||||||
*
|
|
||||||
* It is possible for multiple errors to occur before calling SDL_GetError().
|
|
||||||
* Only the last error is returned.
|
|
||||||
*
|
|
||||||
* The message is only applicable when an SDL function has signaled an error.
|
|
||||||
* You must check the return values of SDL function calls to determine when to
|
|
||||||
* appropriately call SDL_GetError(). You should *not* use the results of
|
|
||||||
* SDL_GetError() to decide if an error has occurred! Sometimes SDL will set
|
|
||||||
* an error string even when reporting success.
|
|
||||||
*
|
|
||||||
* SDL will *not* clear the error string for successful API calls. You *must*
|
|
||||||
* check return values for failure cases before you can assume the error
|
|
||||||
* string applies.
|
|
||||||
*
|
|
||||||
* Error strings are set per-thread, so an error set in a different thread
|
|
||||||
* will not interfere with the current thread's operation.
|
|
||||||
*
|
|
||||||
* The returned string is internally allocated and must not be freed by the
|
|
||||||
* application.
|
|
||||||
*
|
|
||||||
* \returns a message with information about the specific error that occurred,
|
|
||||||
* or an empty string if there hasn't been an error message set since
|
|
||||||
* the last call to SDL_ClearError(). The message is only applicable
|
|
||||||
* when an SDL function has signaled an error. You must check the
|
|
||||||
* return values of SDL function calls to determine when to
|
|
||||||
* appropriately call SDL_GetError().
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_ClearError
|
|
||||||
* \sa SDL_SetError
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const char *SDLCALL SDL_GetError(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the last error message that was set for the current thread.
|
|
||||||
*
|
|
||||||
* This allows the caller to copy the error string into a provided buffer, but
|
|
||||||
* otherwise operates exactly the same as SDL_GetError().
|
|
||||||
*
|
|
||||||
* \param errstr A buffer to fill with the last error message that was set for
|
|
||||||
* the current thread.
|
|
||||||
* \param maxlen The size of the buffer pointed to by the errstr parameter.
|
|
||||||
* \returns the pointer passed in as the `errstr` parameter.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.14.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetError
|
|
||||||
*/
|
|
||||||
extern DECLSPEC char * SDLCALL SDL_GetErrorMsg(char *errstr, int maxlen);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Clear any previous error message for this thread.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetError
|
|
||||||
* \sa SDL_SetError
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_ClearError(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Internal error functions
|
|
||||||
*
|
|
||||||
* \internal
|
|
||||||
* Private error reporting function - used internally.
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM)
|
|
||||||
#define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED)
|
|
||||||
#define SDL_InvalidParamError(param) SDL_SetError("Parameter '%s' is invalid", (param))
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_ENOMEM,
|
|
||||||
SDL_EFREAD,
|
|
||||||
SDL_EFWRITE,
|
|
||||||
SDL_EFSEEK,
|
|
||||||
SDL_UNSUPPORTED,
|
|
||||||
SDL_LASTERROR
|
|
||||||
} SDL_errorcode;
|
|
||||||
/* SDL_Error() unconditionally returns -1. */
|
|
||||||
extern DECLSPEC int SDLCALL SDL_Error(SDL_errorcode code);
|
|
||||||
/* @} *//* Internal error functions */
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include <SDL2/close_code.h>
|
|
||||||
|
|
||||||
#endif /* SDL_error_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,149 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2025 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* # CategoryFilesystem
|
|
||||||
*
|
|
||||||
* Include file for filesystem SDL API functions
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_filesystem_h_
|
|
||||||
#define SDL_filesystem_h_
|
|
||||||
|
|
||||||
#include <SDL2/SDL_stdinc.h>
|
|
||||||
|
|
||||||
#include <SDL2/begin_code.h>
|
|
||||||
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the directory where the application was run from.
|
|
||||||
*
|
|
||||||
* This is not necessarily a fast call, so you should call this once near
|
|
||||||
* startup and save the string if you need it.
|
|
||||||
*
|
|
||||||
* **Mac OS X and iOS Specific Functionality**: If the application is in a
|
|
||||||
* ".app" bundle, this function returns the Resource directory (e.g.
|
|
||||||
* MyApp.app/Contents/Resources/). This behaviour can be overridden by adding
|
|
||||||
* a property to the Info.plist file. Adding a string key with the name
|
|
||||||
* SDL_FILESYSTEM_BASE_DIR_TYPE with a supported value will change the
|
|
||||||
* behaviour.
|
|
||||||
*
|
|
||||||
* Supported values for the SDL_FILESYSTEM_BASE_DIR_TYPE property (Given an
|
|
||||||
* application in /Applications/SDLApp/MyApp.app):
|
|
||||||
*
|
|
||||||
* - `resource`: bundle resource directory (the default). For example:
|
|
||||||
* `/Applications/SDLApp/MyApp.app/Contents/Resources`
|
|
||||||
* - `bundle`: the Bundle directory. For example:
|
|
||||||
* `/Applications/SDLApp/MyApp.app/`
|
|
||||||
* - `parent`: the containing directory of the bundle. For example:
|
|
||||||
* `/Applications/SDLApp/`
|
|
||||||
*
|
|
||||||
* **Nintendo 3DS Specific Functionality**: This function returns "romfs"
|
|
||||||
* directory of the application as it is uncommon to store resources outside
|
|
||||||
* the executable. As such it is not a writable directory.
|
|
||||||
*
|
|
||||||
* The returned path is guaranteed to end with a path separator ('\\' on
|
|
||||||
* Windows, '/' on most other platforms).
|
|
||||||
*
|
|
||||||
* The pointer returned is owned by the caller. Please call SDL_free() on the
|
|
||||||
* pointer when done with it.
|
|
||||||
*
|
|
||||||
* \returns an absolute path in UTF-8 encoding to the application data
|
|
||||||
* directory. NULL will be returned on error or when the platform
|
|
||||||
* doesn't implement this functionality, call SDL_GetError() for more
|
|
||||||
* information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.1.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetPrefPath
|
|
||||||
*/
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_GetBasePath(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the user-and-app-specific path where files can be written.
|
|
||||||
*
|
|
||||||
* Get the "pref dir". This is meant to be where users can write personal
|
|
||||||
* files (preferences and save games, etc) that are specific to your
|
|
||||||
* application. This directory is unique per user, per application.
|
|
||||||
*
|
|
||||||
* This function will decide the appropriate location in the native
|
|
||||||
* filesystem, create the directory if necessary, and return a string of the
|
|
||||||
* absolute path to the directory in UTF-8 encoding.
|
|
||||||
*
|
|
||||||
* On Windows, the string might look like:
|
|
||||||
*
|
|
||||||
* `C:\\Users\\bob\\AppData\\Roaming\\My Company\\My Program Name\\`
|
|
||||||
*
|
|
||||||
* On Linux, the string might look like:
|
|
||||||
*
|
|
||||||
* `/home/bob/.local/share/My Program Name/`
|
|
||||||
*
|
|
||||||
* On Mac OS X, the string might look like:
|
|
||||||
*
|
|
||||||
* `/Users/bob/Library/Application Support/My Program Name/`
|
|
||||||
*
|
|
||||||
* You should assume the path returned by this function is the only safe place
|
|
||||||
* to write files (and that SDL_GetBasePath(), while it might be writable, or
|
|
||||||
* even the parent of the returned path, isn't where you should be writing
|
|
||||||
* things).
|
|
||||||
*
|
|
||||||
* Both the org and app strings may become part of a directory name, so please
|
|
||||||
* follow these rules:
|
|
||||||
*
|
|
||||||
* - Try to use the same org string (_including case-sensitivity_) for all
|
|
||||||
* your applications that use this function.
|
|
||||||
* - Always use a unique app string for each one, and make sure it never
|
|
||||||
* changes for an app once you've decided on it.
|
|
||||||
* - Unicode characters are legal, as long as it's UTF-8 encoded, but...
|
|
||||||
* - ...only use letters, numbers, and spaces. Avoid punctuation like "Game
|
|
||||||
* Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient.
|
|
||||||
*
|
|
||||||
* The returned path is guaranteed to end with a path separator ('\\' on
|
|
||||||
* Windows, '/' on most other platforms).
|
|
||||||
*
|
|
||||||
* The pointer returned is owned by the caller. Please call SDL_free() on the
|
|
||||||
* pointer when done with it.
|
|
||||||
*
|
|
||||||
* \param org the name of your organization.
|
|
||||||
* \param app the name of your application.
|
|
||||||
* \returns a UTF-8 string of the user directory in platform-dependent
|
|
||||||
* notation. NULL if there's a problem (creating directory failed,
|
|
||||||
* etc.).
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.1.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetBasePath
|
|
||||||
*/
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_GetPrefPath(const char *org, const char *app);
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include <SDL2/close_code.h>
|
|
||||||
|
|
||||||
#endif /* SDL_filesystem_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,117 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2025 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* # CategoryGesture
|
|
||||||
*
|
|
||||||
* Include file for SDL gesture event handling.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_gesture_h_
|
|
||||||
#define SDL_gesture_h_
|
|
||||||
|
|
||||||
#include <SDL2/SDL_stdinc.h>
|
|
||||||
#include <SDL2/SDL_error.h>
|
|
||||||
#include <SDL2/SDL_video.h>
|
|
||||||
|
|
||||||
#include <SDL2/SDL_touch.h>
|
|
||||||
|
|
||||||
|
|
||||||
#include <SDL2/begin_code.h>
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef Sint64 SDL_GestureID;
|
|
||||||
|
|
||||||
/* Function prototypes */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Begin recording a gesture on a specified touch device or all touch devices.
|
|
||||||
*
|
|
||||||
* If the parameter `touchId` is -1 (i.e., all devices), this function will
|
|
||||||
* always return 1, regardless of whether there actually are any devices.
|
|
||||||
*
|
|
||||||
* \param touchId the touch device id, or -1 for all touch devices.
|
|
||||||
* \returns 1 on success or 0 if the specified device could not be found.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetTouchDevice
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_RecordGesture(SDL_TouchID touchId);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Save all currently loaded Dollar Gesture templates.
|
|
||||||
*
|
|
||||||
* \param dst a SDL_RWops to save to.
|
|
||||||
* \returns the number of saved templates on success or 0 on failure; call
|
|
||||||
* SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_LoadDollarTemplates
|
|
||||||
* \sa SDL_SaveDollarTemplate
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SaveAllDollarTemplates(SDL_RWops *dst);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Save a currently loaded Dollar Gesture template.
|
|
||||||
*
|
|
||||||
* \param gestureId a gesture id.
|
|
||||||
* \param dst a SDL_RWops to save to.
|
|
||||||
* \returns 1 on success or 0 on failure; call SDL_GetError() for more
|
|
||||||
* information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_LoadDollarTemplates
|
|
||||||
* \sa SDL_SaveAllDollarTemplates
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SaveDollarTemplate(SDL_GestureID gestureId,SDL_RWops *dst);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Load Dollar Gesture templates from a file.
|
|
||||||
*
|
|
||||||
* \param touchId a touch id.
|
|
||||||
* \param src a SDL_RWops to load from.
|
|
||||||
* \returns the number of loaded templates on success or a negative error code
|
|
||||||
* (or 0) on failure; call SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_SaveAllDollarTemplates
|
|
||||||
* \sa SDL_SaveDollarTemplate
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src);
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include <SDL2/close_code.h>
|
|
||||||
|
|
||||||
#endif /* SDL_gesture_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
||||||
@@ -1,443 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2025 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* WIKI CATEGORY: HIDAPI */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* # CategoryHIDAPI
|
|
||||||
*
|
|
||||||
* Header file for SDL HIDAPI functions.
|
|
||||||
*
|
|
||||||
* This is an adaptation of the original HIDAPI interface by Alan Ott, and
|
|
||||||
* includes source code licensed under the following license:
|
|
||||||
*
|
|
||||||
* ```
|
|
||||||
* HIDAPI - Multi-Platform library for
|
|
||||||
* communication with HID devices.
|
|
||||||
*
|
|
||||||
* Copyright 2009, Alan Ott, Signal 11 Software.
|
|
||||||
* All Rights Reserved.
|
|
||||||
*
|
|
||||||
* This software may be used by anyone for any reason so
|
|
||||||
* long as the copyright notice in the source files
|
|
||||||
* remains intact.
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* (Note that this license is the same as item three of SDL's zlib license, so
|
|
||||||
* it adds no new requirements on the user.)
|
|
||||||
*
|
|
||||||
* If you would like a version of SDL without this code, you can build SDL
|
|
||||||
* with SDL_HIDAPI_DISABLED defined to 1. You might want to do this for
|
|
||||||
* example on iOS or tvOS to avoid a dependency on the CoreBluetooth
|
|
||||||
* framework.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_hidapi_h_
|
|
||||||
#define SDL_hidapi_h_
|
|
||||||
|
|
||||||
#include <SDL2/SDL_stdinc.h>
|
|
||||||
|
|
||||||
#include <SDL2/begin_code.h>
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A handle representing an open HID device
|
|
||||||
*/
|
|
||||||
struct SDL_hid_device_;
|
|
||||||
typedef struct SDL_hid_device_ SDL_hid_device; /**< opaque hidapi structure */
|
|
||||||
|
|
||||||
/** hidapi info structure */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Information about a connected HID device
|
|
||||||
*/
|
|
||||||
typedef struct SDL_hid_device_info
|
|
||||||
{
|
|
||||||
/** Platform-specific device path */
|
|
||||||
char *path;
|
|
||||||
/** Device Vendor ID */
|
|
||||||
unsigned short vendor_id;
|
|
||||||
/** Device Product ID */
|
|
||||||
unsigned short product_id;
|
|
||||||
/** Serial Number */
|
|
||||||
wchar_t *serial_number;
|
|
||||||
/** Device Release Number in binary-coded decimal,
|
|
||||||
also known as Device Version Number */
|
|
||||||
unsigned short release_number;
|
|
||||||
/** Manufacturer String */
|
|
||||||
wchar_t *manufacturer_string;
|
|
||||||
/** Product string */
|
|
||||||
wchar_t *product_string;
|
|
||||||
/** Usage Page for this Device/Interface
|
|
||||||
(Windows/Mac only). */
|
|
||||||
unsigned short usage_page;
|
|
||||||
/** Usage for this Device/Interface
|
|
||||||
(Windows/Mac only).*/
|
|
||||||
unsigned short usage;
|
|
||||||
/** The USB interface which this logical device
|
|
||||||
represents.
|
|
||||||
|
|
||||||
* Valid on both Linux implementations in all cases.
|
|
||||||
* Valid on the Windows implementation only if the device
|
|
||||||
contains more than one interface. */
|
|
||||||
int interface_number;
|
|
||||||
|
|
||||||
/** Additional information about the USB interface.
|
|
||||||
Valid on libusb and Android implementations. */
|
|
||||||
int interface_class;
|
|
||||||
int interface_subclass;
|
|
||||||
int interface_protocol;
|
|
||||||
|
|
||||||
/** Pointer to the next device */
|
|
||||||
struct SDL_hid_device_info *next;
|
|
||||||
} SDL_hid_device_info;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize the HIDAPI library.
|
|
||||||
*
|
|
||||||
* This function initializes the HIDAPI library. Calling it is not strictly
|
|
||||||
* necessary, as it will be called automatically by SDL_hid_enumerate() and
|
|
||||||
* any of the SDL_hid_open_*() functions if it is needed. This function should
|
|
||||||
* be called at the beginning of execution however, if there is a chance of
|
|
||||||
* HIDAPI handles being opened by different threads simultaneously.
|
|
||||||
*
|
|
||||||
* Each call to this function should have a matching call to SDL_hid_exit()
|
|
||||||
*
|
|
||||||
* \returns 0 on success and -1 on error.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.18.
|
|
||||||
*
|
|
||||||
* \sa SDL_hid_exit
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_hid_init(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Finalize the HIDAPI library.
|
|
||||||
*
|
|
||||||
* This function frees all of the static data associated with HIDAPI. It
|
|
||||||
* should be called at the end of execution to avoid memory leaks.
|
|
||||||
*
|
|
||||||
* \returns 0 on success and -1 on error.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.18.
|
|
||||||
*
|
|
||||||
* \sa SDL_hid_init
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_hid_exit(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check to see if devices may have been added or removed.
|
|
||||||
*
|
|
||||||
* Enumerating the HID devices is an expensive operation, so you can call this
|
|
||||||
* to see if there have been any system device changes since the last call to
|
|
||||||
* this function. A change in the counter returned doesn't necessarily mean
|
|
||||||
* that anything has changed, but you can call SDL_hid_enumerate() to get an
|
|
||||||
* updated device list.
|
|
||||||
*
|
|
||||||
* Calling this function for the first time may cause a thread or other system
|
|
||||||
* resource to be allocated to track device change notifications.
|
|
||||||
*
|
|
||||||
* \returns a change counter that is incremented with each potential device
|
|
||||||
* change, or 0 if device change detection isn't available.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.18.
|
|
||||||
*
|
|
||||||
* \sa SDL_hid_enumerate
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint32 SDLCALL SDL_hid_device_change_count(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Enumerate the HID Devices.
|
|
||||||
*
|
|
||||||
* This function returns a linked list of all the HID devices attached to the
|
|
||||||
* system which match vendor_id and product_id. If `vendor_id` is set to 0
|
|
||||||
* then any vendor matches. If `product_id` is set to 0 then any product
|
|
||||||
* matches. If `vendor_id` and `product_id` are both set to 0, then all HID
|
|
||||||
* devices will be returned.
|
|
||||||
*
|
|
||||||
* \param vendor_id The Vendor ID (VID) of the types of device to open.
|
|
||||||
* \param product_id The Product ID (PID) of the types of device to open.
|
|
||||||
* \returns a pointer to a linked list of type SDL_hid_device_info, containing
|
|
||||||
* information about the HID devices attached to the system, or NULL
|
|
||||||
* in the case of failure. Free this linked list by calling
|
|
||||||
* SDL_hid_free_enumeration().
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.18.
|
|
||||||
*
|
|
||||||
* \sa SDL_hid_device_change_count
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_hid_device_info * SDLCALL SDL_hid_enumerate(unsigned short vendor_id, unsigned short product_id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Free an enumeration Linked List
|
|
||||||
*
|
|
||||||
* This function frees a linked list created by SDL_hid_enumerate().
|
|
||||||
*
|
|
||||||
* \param devs Pointer to a list of struct_device returned from
|
|
||||||
* SDL_hid_enumerate().
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.18.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_hid_free_enumeration(SDL_hid_device_info *devs);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Open a HID device using a Vendor ID (VID), Product ID (PID) and optionally
|
|
||||||
* a serial number.
|
|
||||||
*
|
|
||||||
* If `serial_number` is NULL, the first device with the specified VID and PID
|
|
||||||
* is opened.
|
|
||||||
*
|
|
||||||
* \param vendor_id The Vendor ID (VID) of the device to open.
|
|
||||||
* \param product_id The Product ID (PID) of the device to open.
|
|
||||||
* \param serial_number The Serial Number of the device to open (Optionally
|
|
||||||
* NULL).
|
|
||||||
* \returns a pointer to a SDL_hid_device object on success or NULL on
|
|
||||||
* failure.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.18.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open(unsigned short vendor_id, unsigned short product_id, const wchar_t *serial_number);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Open a HID device by its path name.
|
|
||||||
*
|
|
||||||
* The path name be determined by calling SDL_hid_enumerate(), or a
|
|
||||||
* platform-specific path name can be used (eg: /dev/hidraw0 on Linux).
|
|
||||||
*
|
|
||||||
* \param path The path name of the device to open.
|
|
||||||
* \returns a pointer to a SDL_hid_device object on success or NULL on
|
|
||||||
* failure.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.18.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open_path(const char *path, int bExclusive);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Write an Output report to a HID device.
|
|
||||||
*
|
|
||||||
* The first byte of `data` must contain the Report ID. For devices which only
|
|
||||||
* support a single report, this must be set to 0x0. The remaining bytes
|
|
||||||
* contain the report data. Since the Report ID is mandatory, calls to
|
|
||||||
* SDL_hid_write() will always contain one more byte than the report contains.
|
|
||||||
* For example, if a hid report is 16 bytes long, 17 bytes must be passed to
|
|
||||||
* SDL_hid_write(), the Report ID (or 0x0, for devices with a single report),
|
|
||||||
* followed by the report data (16 bytes). In this example, the length passed
|
|
||||||
* in would be 17.
|
|
||||||
*
|
|
||||||
* SDL_hid_write() will send the data on the first OUT endpoint, if one
|
|
||||||
* exists. If it does not, it will send the data through the Control Endpoint
|
|
||||||
* (Endpoint 0).
|
|
||||||
*
|
|
||||||
* \param dev A device handle returned from SDL_hid_open().
|
|
||||||
* \param data The data to send, including the report number as the first
|
|
||||||
* byte.
|
|
||||||
* \param length The length in bytes of the data to send.
|
|
||||||
* \returns the actual number of bytes written and -1 on error.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.18.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_hid_write(SDL_hid_device *dev, const unsigned char *data, size_t length);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Read an Input report from a HID device with timeout.
|
|
||||||
*
|
|
||||||
* Input reports are returned to the host through the INTERRUPT IN endpoint.
|
|
||||||
* The first byte will contain the Report number if the device uses numbered
|
|
||||||
* reports.
|
|
||||||
*
|
|
||||||
* \param dev A device handle returned from SDL_hid_open().
|
|
||||||
* \param data A buffer to put the read data into.
|
|
||||||
* \param length The number of bytes to read. For devices with multiple
|
|
||||||
* reports, make sure to read an extra byte for the report
|
|
||||||
* number.
|
|
||||||
* \param milliseconds timeout in milliseconds or -1 for blocking wait.
|
|
||||||
* \returns the actual number of bytes read and -1 on error. If no packet was
|
|
||||||
* available to be read within the timeout period, this function
|
|
||||||
* returns 0.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.18.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_hid_read_timeout(SDL_hid_device *dev, unsigned char *data, size_t length, int milliseconds);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Read an Input report from a HID device.
|
|
||||||
*
|
|
||||||
* Input reports are returned to the host through the INTERRUPT IN endpoint.
|
|
||||||
* The first byte will contain the Report number if the device uses numbered
|
|
||||||
* reports.
|
|
||||||
*
|
|
||||||
* \param dev A device handle returned from SDL_hid_open().
|
|
||||||
* \param data A buffer to put the read data into.
|
|
||||||
* \param length The number of bytes to read. For devices with multiple
|
|
||||||
* reports, make sure to read an extra byte for the report
|
|
||||||
* number.
|
|
||||||
* \returns the actual number of bytes read and -1 on error. If no packet was
|
|
||||||
* available to be read and the handle is in non-blocking mode, this
|
|
||||||
* function returns 0.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.18.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_hid_read(SDL_hid_device *dev, unsigned char *data, size_t length);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the device handle to be non-blocking.
|
|
||||||
*
|
|
||||||
* In non-blocking mode calls to SDL_hid_read() will return immediately with a
|
|
||||||
* value of 0 if there is no data to be read. In blocking mode, SDL_hid_read()
|
|
||||||
* will wait (block) until there is data to read before returning.
|
|
||||||
*
|
|
||||||
* Nonblocking can be turned on and off at any time.
|
|
||||||
*
|
|
||||||
* \param dev A device handle returned from SDL_hid_open().
|
|
||||||
* \param nonblock enable or not the nonblocking reads - 1 to enable
|
|
||||||
* nonblocking - 0 to disable nonblocking.
|
|
||||||
* \returns 0 on success and -1 on error.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.18.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_hid_set_nonblocking(SDL_hid_device *dev, int nonblock);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Send a Feature report to the device.
|
|
||||||
*
|
|
||||||
* Feature reports are sent over the Control endpoint as a Set_Report
|
|
||||||
* transfer. The first byte of `data` must contain the Report ID. For devices
|
|
||||||
* which only support a single report, this must be set to 0x0. The remaining
|
|
||||||
* bytes contain the report data. Since the Report ID is mandatory, calls to
|
|
||||||
* SDL_hid_send_feature_report() will always contain one more byte than the
|
|
||||||
* report contains. For example, if a hid report is 16 bytes long, 17 bytes
|
|
||||||
* must be passed to SDL_hid_send_feature_report(): the Report ID (or 0x0, for
|
|
||||||
* devices which do not use numbered reports), followed by the report data (16
|
|
||||||
* bytes). In this example, the length passed in would be 17.
|
|
||||||
*
|
|
||||||
* \param dev A device handle returned from SDL_hid_open().
|
|
||||||
* \param data The data to send, including the report number as the first
|
|
||||||
* byte.
|
|
||||||
* \param length The length in bytes of the data to send, including the report
|
|
||||||
* number.
|
|
||||||
* \returns the actual number of bytes written and -1 on error.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.18.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_hid_send_feature_report(SDL_hid_device *dev, const unsigned char *data, size_t length);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get a feature report from a HID device.
|
|
||||||
*
|
|
||||||
* Set the first byte of `data` to the Report ID of the report to be read.
|
|
||||||
* Make sure to allow space for this extra byte in `data`. Upon return, the
|
|
||||||
* first byte will still contain the Report ID, and the report data will start
|
|
||||||
* in data[1].
|
|
||||||
*
|
|
||||||
* \param dev A device handle returned from SDL_hid_open().
|
|
||||||
* \param data A buffer to put the read data into, including the Report ID.
|
|
||||||
* Set the first byte of `data` to the Report ID of the report to
|
|
||||||
* be read, or set it to zero if your device does not use numbered
|
|
||||||
* reports.
|
|
||||||
* \param length The number of bytes to read, including an extra byte for the
|
|
||||||
* report ID. The buffer can be longer than the actual report.
|
|
||||||
* \returns the number of bytes read plus one for the report ID (which is
|
|
||||||
* still in the first byte), or -1 on error.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.18.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_hid_get_feature_report(SDL_hid_device *dev, unsigned char *data, size_t length);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Close a HID device.
|
|
||||||
*
|
|
||||||
* \param dev A device handle returned from SDL_hid_open().
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.18.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_hid_close(SDL_hid_device *dev);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get The Manufacturer String from a HID device.
|
|
||||||
*
|
|
||||||
* \param dev A device handle returned from SDL_hid_open().
|
|
||||||
* \param string A wide string buffer to put the data into.
|
|
||||||
* \param maxlen The length of the buffer in multiples of wchar_t.
|
|
||||||
* \returns 0 on success and -1 on error.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.18.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_hid_get_manufacturer_string(SDL_hid_device *dev, wchar_t *string, size_t maxlen);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get The Product String from a HID device.
|
|
||||||
*
|
|
||||||
* \param dev A device handle returned from SDL_hid_open().
|
|
||||||
* \param string A wide string buffer to put the data into.
|
|
||||||
* \param maxlen The length of the buffer in multiples of wchar_t.
|
|
||||||
* \returns 0 on success and -1 on error.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.18.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_hid_get_product_string(SDL_hid_device *dev, wchar_t *string, size_t maxlen);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get The Serial Number String from a HID device.
|
|
||||||
*
|
|
||||||
* \param dev A device handle returned from SDL_hid_open().
|
|
||||||
* \param string A wide string buffer to put the data into.
|
|
||||||
* \param maxlen The length of the buffer in multiples of wchar_t.
|
|
||||||
* \returns 0 on success and -1 on error.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.18.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_hid_get_serial_number_string(SDL_hid_device *dev, wchar_t *string, size_t maxlen);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get a string from a HID device, based on its string index.
|
|
||||||
*
|
|
||||||
* \param dev A device handle returned from SDL_hid_open().
|
|
||||||
* \param string_index The index of the string to get.
|
|
||||||
* \param string A wide string buffer to put the data into.
|
|
||||||
* \param maxlen The length of the buffer in multiples of wchar_t.
|
|
||||||
* \returns 0 on success and -1 on error.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.18.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_hid_get_indexed_string(SDL_hid_device *dev, int string_index, wchar_t *string, size_t maxlen);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Start or stop a BLE scan on iOS and tvOS to pair Steam Controllers
|
|
||||||
*
|
|
||||||
* \param active SDL_TRUE to start the scan, SDL_FALSE to stop the scan.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.18.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_hid_ble_scan(SDL_bool active);
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include <SDL2/close_code.h>
|
|
||||||
|
|
||||||
#endif /* SDL_hidapi_h_ */
|
|
||||||
|
|
||||||
/* vi: set sts=4 ts=4 sw=4 expandtab: */
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,361 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2025 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* # CategoryKeyboard
|
|
||||||
*
|
|
||||||
* Include file for SDL keyboard event handling
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_keyboard_h_
|
|
||||||
#define SDL_keyboard_h_
|
|
||||||
|
|
||||||
#include <SDL2/SDL_stdinc.h>
|
|
||||||
#include <SDL2/SDL_error.h>
|
|
||||||
#include <SDL2/SDL_keycode.h>
|
|
||||||
#include <SDL2/SDL_video.h>
|
|
||||||
|
|
||||||
#include <SDL2/begin_code.h>
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The SDL keysym structure, used in key events.
|
|
||||||
*
|
|
||||||
* If you are looking for translated character input, see the SDL_TEXTINPUT
|
|
||||||
* event.
|
|
||||||
*/
|
|
||||||
typedef struct SDL_Keysym
|
|
||||||
{
|
|
||||||
SDL_Scancode scancode; /**< SDL physical key code - see SDL_Scancode for details */
|
|
||||||
SDL_Keycode sym; /**< SDL virtual key code - see SDL_Keycode for details */
|
|
||||||
Uint16 mod; /**< current key modifiers */
|
|
||||||
Uint32 unused;
|
|
||||||
} SDL_Keysym;
|
|
||||||
|
|
||||||
/* Function prototypes */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Query the window which currently has keyboard focus.
|
|
||||||
*
|
|
||||||
* \returns the window with keyboard focus.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get a snapshot of the current state of the keyboard.
|
|
||||||
*
|
|
||||||
* The pointer returned is a pointer to an internal SDL array. It will be
|
|
||||||
* valid for the whole lifetime of the application and should not be freed by
|
|
||||||
* the caller.
|
|
||||||
*
|
|
||||||
* A array element with a value of 1 means that the key is pressed and a value
|
|
||||||
* of 0 means that it is not. Indexes into this array are obtained by using
|
|
||||||
* SDL_Scancode values.
|
|
||||||
*
|
|
||||||
* Use SDL_PumpEvents() to update the state array.
|
|
||||||
*
|
|
||||||
* This function gives you the current state after all events have been
|
|
||||||
* processed, so if a key or button has been pressed and released before you
|
|
||||||
* process events, then the pressed state will never show up in the
|
|
||||||
* SDL_GetKeyboardState() calls.
|
|
||||||
*
|
|
||||||
* Note: This function doesn't take into account whether shift has been
|
|
||||||
* pressed or not.
|
|
||||||
*
|
|
||||||
* \param numkeys if non-NULL, receives the length of the returned array.
|
|
||||||
* \returns a pointer to an array of key states.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_PumpEvents
|
|
||||||
* \sa SDL_ResetKeyboard
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Clear the state of the keyboard
|
|
||||||
*
|
|
||||||
* This function will generate key up events for all pressed keys.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.24.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetKeyboardState
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_ResetKeyboard(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the current key modifier state for the keyboard.
|
|
||||||
*
|
|
||||||
* \returns an OR'd combination of the modifier keys for the keyboard. See
|
|
||||||
* SDL_Keymod for details.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetKeyboardState
|
|
||||||
* \sa SDL_SetModState
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the current key modifier state for the keyboard.
|
|
||||||
*
|
|
||||||
* The inverse of SDL_GetModState(), SDL_SetModState() allows you to impose
|
|
||||||
* modifier key states on your application. Simply pass your desired modifier
|
|
||||||
* states into `modstate`. This value may be a bitwise, OR'd combination of
|
|
||||||
* SDL_Keymod values.
|
|
||||||
*
|
|
||||||
* This does not change the keyboard state, only the key modifier flags that
|
|
||||||
* SDL reports.
|
|
||||||
*
|
|
||||||
* \param modstate the desired SDL_Keymod for the keyboard.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetModState
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the key code corresponding to the given scancode according to the
|
|
||||||
* current keyboard layout.
|
|
||||||
*
|
|
||||||
* See SDL_Keycode for details.
|
|
||||||
*
|
|
||||||
* \param scancode the desired SDL_Scancode to query.
|
|
||||||
* \returns the SDL_Keycode that corresponds to the given SDL_Scancode.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetKeyName
|
|
||||||
* \sa SDL_GetScancodeFromKey
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the scancode corresponding to the given key code according to the
|
|
||||||
* current keyboard layout.
|
|
||||||
*
|
|
||||||
* See SDL_Scancode for details.
|
|
||||||
*
|
|
||||||
* \param key the desired SDL_Keycode to query.
|
|
||||||
* \returns the SDL_Scancode that corresponds to the given SDL_Keycode.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetKeyFromScancode
|
|
||||||
* \sa SDL_GetScancodeName
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get a human-readable name for a scancode.
|
|
||||||
*
|
|
||||||
* See SDL_Scancode for details.
|
|
||||||
*
|
|
||||||
* **Warning**: The returned name is by design not stable across platforms,
|
|
||||||
* e.g. the name for `SDL_SCANCODE_LGUI` is "Left GUI" under Linux but "Left
|
|
||||||
* Windows" under Microsoft Windows, and some scancodes like
|
|
||||||
* `SDL_SCANCODE_NONUSBACKSLASH` don't have any name at all. There are even
|
|
||||||
* scancodes that share names, e.g. `SDL_SCANCODE_RETURN` and
|
|
||||||
* `SDL_SCANCODE_RETURN2` (both called "Return"). This function is therefore
|
|
||||||
* unsuitable for creating a stable cross-platform two-way mapping between
|
|
||||||
* strings and scancodes.
|
|
||||||
*
|
|
||||||
* \param scancode the desired SDL_Scancode to query.
|
|
||||||
* \returns a pointer to the name for the scancode. If the scancode doesn't
|
|
||||||
* have a name this function returns an empty string ("").
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetScancodeFromKey
|
|
||||||
* \sa SDL_GetScancodeFromName
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_Scancode scancode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get a scancode from a human-readable name.
|
|
||||||
*
|
|
||||||
* \param name the human-readable scancode name.
|
|
||||||
* \returns the SDL_Scancode, or `SDL_SCANCODE_UNKNOWN` if the name wasn't
|
|
||||||
* recognized; call SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetKeyFromName
|
|
||||||
* \sa SDL_GetScancodeFromKey
|
|
||||||
* \sa SDL_GetScancodeName
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *name);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get a human-readable name for a key.
|
|
||||||
*
|
|
||||||
* See SDL_Scancode and SDL_Keycode for details.
|
|
||||||
*
|
|
||||||
* \param key the desired SDL_Keycode to query.
|
|
||||||
* \returns a pointer to a UTF-8 string that stays valid at least until the
|
|
||||||
* next call to this function. If you need it around any longer, you
|
|
||||||
* must copy it. If the key doesn't have a name, this function
|
|
||||||
* returns an empty string ("").
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetKeyFromName
|
|
||||||
* \sa SDL_GetKeyFromScancode
|
|
||||||
* \sa SDL_GetScancodeFromKey
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get a key code from a human-readable name.
|
|
||||||
*
|
|
||||||
* \param name the human-readable key name.
|
|
||||||
* \returns key code, or `SDLK_UNKNOWN` if the name wasn't recognized; call
|
|
||||||
* SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetKeyFromScancode
|
|
||||||
* \sa SDL_GetKeyName
|
|
||||||
* \sa SDL_GetScancodeFromName
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Start accepting Unicode text input events.
|
|
||||||
*
|
|
||||||
* This function will start accepting Unicode text input events in the focused
|
|
||||||
* SDL window, and start emitting SDL_TextInputEvent (SDL_TEXTINPUT) and
|
|
||||||
* SDL_TextEditingEvent (SDL_TEXTEDITING) events. Please use this function in
|
|
||||||
* pair with SDL_StopTextInput().
|
|
||||||
*
|
|
||||||
* On some platforms using this function activates the screen keyboard.
|
|
||||||
*
|
|
||||||
* On desktop platforms, SDL_StartTextInput() is implicitly called on SDL
|
|
||||||
* video subsystem initialization which will cause SDL_TextInputEvent and
|
|
||||||
* SDL_TextEditingEvent to begin emitting.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_SetTextInputRect
|
|
||||||
* \sa SDL_StopTextInput
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_StartTextInput(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check whether or not Unicode text input events are enabled.
|
|
||||||
*
|
|
||||||
* \returns SDL_TRUE if text input events are enabled else SDL_FALSE.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_StartTextInput
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputActive(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Stop receiving any text input events.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_StartTextInput
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_StopTextInput(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Dismiss the composition window/IME without disabling the subsystem.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.22.
|
|
||||||
*
|
|
||||||
* \sa SDL_StartTextInput
|
|
||||||
* \sa SDL_StopTextInput
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_ClearComposition(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns if an IME Composite or Candidate window is currently shown.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.22.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputShown(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the rectangle used to type Unicode text inputs.
|
|
||||||
*
|
|
||||||
* Native input methods will place a window with word suggestions near it,
|
|
||||||
* without covering the text being inputted.
|
|
||||||
*
|
|
||||||
* To start text input in a given location, this function is intended to be
|
|
||||||
* called before SDL_StartTextInput, although some platforms support moving
|
|
||||||
* the rectangle even while text input (and a composition) is active.
|
|
||||||
*
|
|
||||||
* Note: If you want to use the system native IME window, try setting hint
|
|
||||||
* **SDL_HINT_IME_SHOW_UI** to **1**, otherwise this function won't give you
|
|
||||||
* any feedback.
|
|
||||||
*
|
|
||||||
* \param rect the SDL_Rect structure representing the rectangle to receive
|
|
||||||
* text (ignored if NULL).
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_StartTextInput
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_SetTextInputRect(const SDL_Rect *rect);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check whether the platform has screen keyboard support.
|
|
||||||
*
|
|
||||||
* \returns SDL_TRUE if the platform has some screen keyboard support or
|
|
||||||
* SDL_FALSE if not.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_StartTextInput
|
|
||||||
* \sa SDL_IsScreenKeyboardShown
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasScreenKeyboardSupport(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check whether the screen keyboard is shown for given window.
|
|
||||||
*
|
|
||||||
* \param window the window for which screen keyboard should be queried.
|
|
||||||
* \returns SDL_TRUE if screen keyboard is shown or SDL_FALSE if not.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_HasScreenKeyboardSupport
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenKeyboardShown(SDL_Window *window);
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include <SDL2/close_code.h>
|
|
||||||
|
|
||||||
#endif /* SDL_keyboard_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
||||||
@@ -1,358 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2025 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* # CategoryKeycode
|
|
||||||
*
|
|
||||||
* Defines constants which identify keyboard keys and modifiers.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_keycode_h_
|
|
||||||
#define SDL_keycode_h_
|
|
||||||
|
|
||||||
#include <SDL2/SDL_stdinc.h>
|
|
||||||
#include <SDL2/SDL_scancode.h>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The SDL virtual key representation.
|
|
||||||
*
|
|
||||||
* Values of this type are used to represent keyboard keys using the current
|
|
||||||
* layout of the keyboard. These values include Unicode values representing
|
|
||||||
* the unmodified character that would be generated by pressing the key, or an
|
|
||||||
* SDLK_* constant for those keys that do not generate characters.
|
|
||||||
*
|
|
||||||
* A special exception is the number keys at the top of the keyboard which map
|
|
||||||
* to SDLK_0...SDLK_9 on AZERTY layouts.
|
|
||||||
*/
|
|
||||||
typedef Sint32 SDL_Keycode;
|
|
||||||
|
|
||||||
#define SDLK_SCANCODE_MASK (1<<30)
|
|
||||||
#define SDL_SCANCODE_TO_KEYCODE(X) (X | SDLK_SCANCODE_MASK)
|
|
||||||
|
|
||||||
typedef enum SDL_KeyCode
|
|
||||||
{
|
|
||||||
SDLK_UNKNOWN = 0,
|
|
||||||
|
|
||||||
SDLK_RETURN = '\r',
|
|
||||||
SDLK_ESCAPE = '\x1B',
|
|
||||||
SDLK_BACKSPACE = '\b',
|
|
||||||
SDLK_TAB = '\t',
|
|
||||||
SDLK_SPACE = ' ',
|
|
||||||
SDLK_EXCLAIM = '!',
|
|
||||||
SDLK_QUOTEDBL = '"',
|
|
||||||
SDLK_HASH = '#',
|
|
||||||
SDLK_PERCENT = '%',
|
|
||||||
SDLK_DOLLAR = '$',
|
|
||||||
SDLK_AMPERSAND = '&',
|
|
||||||
SDLK_QUOTE = '\'',
|
|
||||||
SDLK_LEFTPAREN = '(',
|
|
||||||
SDLK_RIGHTPAREN = ')',
|
|
||||||
SDLK_ASTERISK = '*',
|
|
||||||
SDLK_PLUS = '+',
|
|
||||||
SDLK_COMMA = ',',
|
|
||||||
SDLK_MINUS = '-',
|
|
||||||
SDLK_PERIOD = '.',
|
|
||||||
SDLK_SLASH = '/',
|
|
||||||
SDLK_0 = '0',
|
|
||||||
SDLK_1 = '1',
|
|
||||||
SDLK_2 = '2',
|
|
||||||
SDLK_3 = '3',
|
|
||||||
SDLK_4 = '4',
|
|
||||||
SDLK_5 = '5',
|
|
||||||
SDLK_6 = '6',
|
|
||||||
SDLK_7 = '7',
|
|
||||||
SDLK_8 = '8',
|
|
||||||
SDLK_9 = '9',
|
|
||||||
SDLK_COLON = ':',
|
|
||||||
SDLK_SEMICOLON = ';',
|
|
||||||
SDLK_LESS = '<',
|
|
||||||
SDLK_EQUALS = '=',
|
|
||||||
SDLK_GREATER = '>',
|
|
||||||
SDLK_QUESTION = '?',
|
|
||||||
SDLK_AT = '@',
|
|
||||||
|
|
||||||
/*
|
|
||||||
Skip uppercase letters
|
|
||||||
*/
|
|
||||||
|
|
||||||
SDLK_LEFTBRACKET = '[',
|
|
||||||
SDLK_BACKSLASH = '\\',
|
|
||||||
SDLK_RIGHTBRACKET = ']',
|
|
||||||
SDLK_CARET = '^',
|
|
||||||
SDLK_UNDERSCORE = '_',
|
|
||||||
SDLK_BACKQUOTE = '`',
|
|
||||||
SDLK_a = 'a',
|
|
||||||
SDLK_b = 'b',
|
|
||||||
SDLK_c = 'c',
|
|
||||||
SDLK_d = 'd',
|
|
||||||
SDLK_e = 'e',
|
|
||||||
SDLK_f = 'f',
|
|
||||||
SDLK_g = 'g',
|
|
||||||
SDLK_h = 'h',
|
|
||||||
SDLK_i = 'i',
|
|
||||||
SDLK_j = 'j',
|
|
||||||
SDLK_k = 'k',
|
|
||||||
SDLK_l = 'l',
|
|
||||||
SDLK_m = 'm',
|
|
||||||
SDLK_n = 'n',
|
|
||||||
SDLK_o = 'o',
|
|
||||||
SDLK_p = 'p',
|
|
||||||
SDLK_q = 'q',
|
|
||||||
SDLK_r = 'r',
|
|
||||||
SDLK_s = 's',
|
|
||||||
SDLK_t = 't',
|
|
||||||
SDLK_u = 'u',
|
|
||||||
SDLK_v = 'v',
|
|
||||||
SDLK_w = 'w',
|
|
||||||
SDLK_x = 'x',
|
|
||||||
SDLK_y = 'y',
|
|
||||||
SDLK_z = 'z',
|
|
||||||
|
|
||||||
SDLK_CAPSLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CAPSLOCK),
|
|
||||||
|
|
||||||
SDLK_F1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F1),
|
|
||||||
SDLK_F2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F2),
|
|
||||||
SDLK_F3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F3),
|
|
||||||
SDLK_F4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F4),
|
|
||||||
SDLK_F5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F5),
|
|
||||||
SDLK_F6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F6),
|
|
||||||
SDLK_F7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F7),
|
|
||||||
SDLK_F8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F8),
|
|
||||||
SDLK_F9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F9),
|
|
||||||
SDLK_F10 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F10),
|
|
||||||
SDLK_F11 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F11),
|
|
||||||
SDLK_F12 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F12),
|
|
||||||
|
|
||||||
SDLK_PRINTSCREEN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRINTSCREEN),
|
|
||||||
SDLK_SCROLLLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SCROLLLOCK),
|
|
||||||
SDLK_PAUSE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAUSE),
|
|
||||||
SDLK_INSERT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_INSERT),
|
|
||||||
SDLK_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HOME),
|
|
||||||
SDLK_PAGEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEUP),
|
|
||||||
SDLK_DELETE = '\x7F',
|
|
||||||
SDLK_END = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_END),
|
|
||||||
SDLK_PAGEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEDOWN),
|
|
||||||
SDLK_RIGHT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RIGHT),
|
|
||||||
SDLK_LEFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LEFT),
|
|
||||||
SDLK_DOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DOWN),
|
|
||||||
SDLK_UP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UP),
|
|
||||||
|
|
||||||
SDLK_NUMLOCKCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_NUMLOCKCLEAR),
|
|
||||||
SDLK_KP_DIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DIVIDE),
|
|
||||||
SDLK_KP_MULTIPLY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MULTIPLY),
|
|
||||||
SDLK_KP_MINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MINUS),
|
|
||||||
SDLK_KP_PLUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUS),
|
|
||||||
SDLK_KP_ENTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_ENTER),
|
|
||||||
SDLK_KP_1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_1),
|
|
||||||
SDLK_KP_2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_2),
|
|
||||||
SDLK_KP_3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_3),
|
|
||||||
SDLK_KP_4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_4),
|
|
||||||
SDLK_KP_5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_5),
|
|
||||||
SDLK_KP_6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_6),
|
|
||||||
SDLK_KP_7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_7),
|
|
||||||
SDLK_KP_8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_8),
|
|
||||||
SDLK_KP_9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_9),
|
|
||||||
SDLK_KP_0 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_0),
|
|
||||||
SDLK_KP_PERIOD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERIOD),
|
|
||||||
|
|
||||||
SDLK_APPLICATION = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APPLICATION),
|
|
||||||
SDLK_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_POWER),
|
|
||||||
SDLK_KP_EQUALS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALS),
|
|
||||||
SDLK_F13 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F13),
|
|
||||||
SDLK_F14 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F14),
|
|
||||||
SDLK_F15 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F15),
|
|
||||||
SDLK_F16 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F16),
|
|
||||||
SDLK_F17 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F17),
|
|
||||||
SDLK_F18 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F18),
|
|
||||||
SDLK_F19 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F19),
|
|
||||||
SDLK_F20 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F20),
|
|
||||||
SDLK_F21 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F21),
|
|
||||||
SDLK_F22 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F22),
|
|
||||||
SDLK_F23 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F23),
|
|
||||||
SDLK_F24 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F24),
|
|
||||||
SDLK_EXECUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXECUTE),
|
|
||||||
SDLK_HELP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HELP),
|
|
||||||
SDLK_MENU = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MENU),
|
|
||||||
SDLK_SELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SELECT),
|
|
||||||
SDLK_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_STOP),
|
|
||||||
SDLK_AGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AGAIN),
|
|
||||||
SDLK_UNDO = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UNDO),
|
|
||||||
SDLK_CUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CUT),
|
|
||||||
SDLK_COPY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COPY),
|
|
||||||
SDLK_PASTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PASTE),
|
|
||||||
SDLK_FIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_FIND),
|
|
||||||
SDLK_MUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MUTE),
|
|
||||||
SDLK_VOLUMEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEUP),
|
|
||||||
SDLK_VOLUMEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEDOWN),
|
|
||||||
SDLK_KP_COMMA = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COMMA),
|
|
||||||
SDLK_KP_EQUALSAS400 =
|
|
||||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALSAS400),
|
|
||||||
|
|
||||||
SDLK_ALTERASE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ALTERASE),
|
|
||||||
SDLK_SYSREQ = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SYSREQ),
|
|
||||||
SDLK_CANCEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CANCEL),
|
|
||||||
SDLK_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEAR),
|
|
||||||
SDLK_PRIOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRIOR),
|
|
||||||
SDLK_RETURN2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RETURN2),
|
|
||||||
SDLK_SEPARATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SEPARATOR),
|
|
||||||
SDLK_OUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OUT),
|
|
||||||
SDLK_OPER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OPER),
|
|
||||||
SDLK_CLEARAGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEARAGAIN),
|
|
||||||
SDLK_CRSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CRSEL),
|
|
||||||
SDLK_EXSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXSEL),
|
|
||||||
|
|
||||||
SDLK_KP_00 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_00),
|
|
||||||
SDLK_KP_000 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_000),
|
|
||||||
SDLK_THOUSANDSSEPARATOR =
|
|
||||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_THOUSANDSSEPARATOR),
|
|
||||||
SDLK_DECIMALSEPARATOR =
|
|
||||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DECIMALSEPARATOR),
|
|
||||||
SDLK_CURRENCYUNIT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYUNIT),
|
|
||||||
SDLK_CURRENCYSUBUNIT =
|
|
||||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYSUBUNIT),
|
|
||||||
SDLK_KP_LEFTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTPAREN),
|
|
||||||
SDLK_KP_RIGHTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTPAREN),
|
|
||||||
SDLK_KP_LEFTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTBRACE),
|
|
||||||
SDLK_KP_RIGHTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTBRACE),
|
|
||||||
SDLK_KP_TAB = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_TAB),
|
|
||||||
SDLK_KP_BACKSPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BACKSPACE),
|
|
||||||
SDLK_KP_A = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_A),
|
|
||||||
SDLK_KP_B = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_B),
|
|
||||||
SDLK_KP_C = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_C),
|
|
||||||
SDLK_KP_D = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_D),
|
|
||||||
SDLK_KP_E = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_E),
|
|
||||||
SDLK_KP_F = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_F),
|
|
||||||
SDLK_KP_XOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_XOR),
|
|
||||||
SDLK_KP_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_POWER),
|
|
||||||
SDLK_KP_PERCENT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERCENT),
|
|
||||||
SDLK_KP_LESS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LESS),
|
|
||||||
SDLK_KP_GREATER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_GREATER),
|
|
||||||
SDLK_KP_AMPERSAND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AMPERSAND),
|
|
||||||
SDLK_KP_DBLAMPERSAND =
|
|
||||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLAMPERSAND),
|
|
||||||
SDLK_KP_VERTICALBAR =
|
|
||||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_VERTICALBAR),
|
|
||||||
SDLK_KP_DBLVERTICALBAR =
|
|
||||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLVERTICALBAR),
|
|
||||||
SDLK_KP_COLON = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COLON),
|
|
||||||
SDLK_KP_HASH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HASH),
|
|
||||||
SDLK_KP_SPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_SPACE),
|
|
||||||
SDLK_KP_AT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AT),
|
|
||||||
SDLK_KP_EXCLAM = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EXCLAM),
|
|
||||||
SDLK_KP_MEMSTORE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSTORE),
|
|
||||||
SDLK_KP_MEMRECALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMRECALL),
|
|
||||||
SDLK_KP_MEMCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMCLEAR),
|
|
||||||
SDLK_KP_MEMADD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMADD),
|
|
||||||
SDLK_KP_MEMSUBTRACT =
|
|
||||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSUBTRACT),
|
|
||||||
SDLK_KP_MEMMULTIPLY =
|
|
||||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMMULTIPLY),
|
|
||||||
SDLK_KP_MEMDIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMDIVIDE),
|
|
||||||
SDLK_KP_PLUSMINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUSMINUS),
|
|
||||||
SDLK_KP_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEAR),
|
|
||||||
SDLK_KP_CLEARENTRY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEARENTRY),
|
|
||||||
SDLK_KP_BINARY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BINARY),
|
|
||||||
SDLK_KP_OCTAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_OCTAL),
|
|
||||||
SDLK_KP_DECIMAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DECIMAL),
|
|
||||||
SDLK_KP_HEXADECIMAL =
|
|
||||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HEXADECIMAL),
|
|
||||||
|
|
||||||
SDLK_LCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LCTRL),
|
|
||||||
SDLK_LSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LSHIFT),
|
|
||||||
SDLK_LALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LALT),
|
|
||||||
SDLK_LGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LGUI),
|
|
||||||
SDLK_RCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RCTRL),
|
|
||||||
SDLK_RSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RSHIFT),
|
|
||||||
SDLK_RALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RALT),
|
|
||||||
SDLK_RGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RGUI),
|
|
||||||
|
|
||||||
SDLK_MODE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MODE),
|
|
||||||
|
|
||||||
SDLK_AUDIONEXT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIONEXT),
|
|
||||||
SDLK_AUDIOPREV = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPREV),
|
|
||||||
SDLK_AUDIOSTOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOSTOP),
|
|
||||||
SDLK_AUDIOPLAY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPLAY),
|
|
||||||
SDLK_AUDIOMUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOMUTE),
|
|
||||||
SDLK_MEDIASELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIASELECT),
|
|
||||||
SDLK_WWW = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_WWW),
|
|
||||||
SDLK_MAIL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MAIL),
|
|
||||||
SDLK_CALCULATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALCULATOR),
|
|
||||||
SDLK_COMPUTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COMPUTER),
|
|
||||||
SDLK_AC_SEARCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_SEARCH),
|
|
||||||
SDLK_AC_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_HOME),
|
|
||||||
SDLK_AC_BACK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BACK),
|
|
||||||
SDLK_AC_FORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_FORWARD),
|
|
||||||
SDLK_AC_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_STOP),
|
|
||||||
SDLK_AC_REFRESH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_REFRESH),
|
|
||||||
SDLK_AC_BOOKMARKS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BOOKMARKS),
|
|
||||||
|
|
||||||
SDLK_BRIGHTNESSDOWN =
|
|
||||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSDOWN),
|
|
||||||
SDLK_BRIGHTNESSUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSUP),
|
|
||||||
SDLK_DISPLAYSWITCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DISPLAYSWITCH),
|
|
||||||
SDLK_KBDILLUMTOGGLE =
|
|
||||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMTOGGLE),
|
|
||||||
SDLK_KBDILLUMDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMDOWN),
|
|
||||||
SDLK_KBDILLUMUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMUP),
|
|
||||||
SDLK_EJECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EJECT),
|
|
||||||
SDLK_SLEEP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SLEEP),
|
|
||||||
SDLK_APP1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APP1),
|
|
||||||
SDLK_APP2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APP2),
|
|
||||||
|
|
||||||
SDLK_AUDIOREWIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOREWIND),
|
|
||||||
SDLK_AUDIOFASTFORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOFASTFORWARD),
|
|
||||||
|
|
||||||
SDLK_SOFTLEFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SOFTLEFT),
|
|
||||||
SDLK_SOFTRIGHT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SOFTRIGHT),
|
|
||||||
SDLK_CALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALL),
|
|
||||||
SDLK_ENDCALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ENDCALL)
|
|
||||||
} SDL_KeyCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Enumeration of valid key mods (possibly OR'd together).
|
|
||||||
*/
|
|
||||||
typedef enum SDL_Keymod
|
|
||||||
{
|
|
||||||
KMOD_NONE = 0x0000,
|
|
||||||
KMOD_LSHIFT = 0x0001,
|
|
||||||
KMOD_RSHIFT = 0x0002,
|
|
||||||
KMOD_LCTRL = 0x0040,
|
|
||||||
KMOD_RCTRL = 0x0080,
|
|
||||||
KMOD_LALT = 0x0100,
|
|
||||||
KMOD_RALT = 0x0200,
|
|
||||||
KMOD_LGUI = 0x0400,
|
|
||||||
KMOD_RGUI = 0x0800,
|
|
||||||
KMOD_NUM = 0x1000,
|
|
||||||
KMOD_CAPS = 0x2000,
|
|
||||||
KMOD_MODE = 0x4000,
|
|
||||||
KMOD_SCROLL = 0x8000,
|
|
||||||
|
|
||||||
KMOD_CTRL = KMOD_LCTRL | KMOD_RCTRL,
|
|
||||||
KMOD_SHIFT = KMOD_LSHIFT | KMOD_RSHIFT,
|
|
||||||
KMOD_ALT = KMOD_LALT | KMOD_RALT,
|
|
||||||
KMOD_GUI = KMOD_LGUI | KMOD_RGUI,
|
|
||||||
|
|
||||||
KMOD_RESERVED = KMOD_SCROLL /* This is for source-level compatibility with SDL 2.0.0. */
|
|
||||||
} SDL_Keymod;
|
|
||||||
|
|
||||||
#endif /* SDL_keycode_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
||||||
@@ -1,405 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2025 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* # CategoryLog
|
|
||||||
*
|
|
||||||
* Simple log messages with categories and priorities.
|
|
||||||
*
|
|
||||||
* By default logs are quiet, but if you're debugging SDL you might want:
|
|
||||||
*
|
|
||||||
* SDL_LogSetAllPriority(SDL_LOG_PRIORITY_WARN);
|
|
||||||
*
|
|
||||||
* Here's where the messages go on different platforms:
|
|
||||||
*
|
|
||||||
* - Windows: debug output stream
|
|
||||||
* - Android: log output
|
|
||||||
* - Others: standard error output (stderr)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_log_h_
|
|
||||||
#define SDL_log_h_
|
|
||||||
|
|
||||||
#include <SDL2/SDL_stdinc.h>
|
|
||||||
|
|
||||||
#include <SDL2/begin_code.h>
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The maximum size of a log message prior to SDL 2.0.24
|
|
||||||
*
|
|
||||||
* As of 2.0.24 there is no limit to the length of SDL log messages.
|
|
||||||
*/
|
|
||||||
#define SDL_MAX_LOG_MESSAGE 4096
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The predefined log categories
|
|
||||||
*
|
|
||||||
* By default the application category is enabled at the INFO level, the
|
|
||||||
* assert category is enabled at the WARN level, test is enabled at the
|
|
||||||
* VERBOSE level and all other categories are enabled at the ERROR level.
|
|
||||||
*/
|
|
||||||
typedef enum SDL_LogCategory
|
|
||||||
{
|
|
||||||
SDL_LOG_CATEGORY_APPLICATION,
|
|
||||||
SDL_LOG_CATEGORY_ERROR,
|
|
||||||
SDL_LOG_CATEGORY_ASSERT,
|
|
||||||
SDL_LOG_CATEGORY_SYSTEM,
|
|
||||||
SDL_LOG_CATEGORY_AUDIO,
|
|
||||||
SDL_LOG_CATEGORY_VIDEO,
|
|
||||||
SDL_LOG_CATEGORY_RENDER,
|
|
||||||
SDL_LOG_CATEGORY_INPUT,
|
|
||||||
SDL_LOG_CATEGORY_TEST,
|
|
||||||
|
|
||||||
/* Reserved for future SDL library use */
|
|
||||||
SDL_LOG_CATEGORY_RESERVED1,
|
|
||||||
SDL_LOG_CATEGORY_RESERVED2,
|
|
||||||
SDL_LOG_CATEGORY_RESERVED3,
|
|
||||||
SDL_LOG_CATEGORY_RESERVED4,
|
|
||||||
SDL_LOG_CATEGORY_RESERVED5,
|
|
||||||
SDL_LOG_CATEGORY_RESERVED6,
|
|
||||||
SDL_LOG_CATEGORY_RESERVED7,
|
|
||||||
SDL_LOG_CATEGORY_RESERVED8,
|
|
||||||
SDL_LOG_CATEGORY_RESERVED9,
|
|
||||||
SDL_LOG_CATEGORY_RESERVED10,
|
|
||||||
|
|
||||||
/* Beyond this point is reserved for application use, e.g.
|
|
||||||
enum {
|
|
||||||
MYAPP_CATEGORY_AWESOME1 = SDL_LOG_CATEGORY_CUSTOM,
|
|
||||||
MYAPP_CATEGORY_AWESOME2,
|
|
||||||
MYAPP_CATEGORY_AWESOME3,
|
|
||||||
...
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
SDL_LOG_CATEGORY_CUSTOM
|
|
||||||
} SDL_LogCategory;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The predefined log priorities
|
|
||||||
*/
|
|
||||||
typedef enum SDL_LogPriority
|
|
||||||
{
|
|
||||||
SDL_LOG_PRIORITY_VERBOSE = 1,
|
|
||||||
SDL_LOG_PRIORITY_DEBUG,
|
|
||||||
SDL_LOG_PRIORITY_INFO,
|
|
||||||
SDL_LOG_PRIORITY_WARN,
|
|
||||||
SDL_LOG_PRIORITY_ERROR,
|
|
||||||
SDL_LOG_PRIORITY_CRITICAL,
|
|
||||||
SDL_NUM_LOG_PRIORITIES
|
|
||||||
} SDL_LogPriority;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the priority of all log categories.
|
|
||||||
*
|
|
||||||
* \param priority the SDL_LogPriority to assign.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_LogSetPriority
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_LogSetAllPriority(SDL_LogPriority priority);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the priority of a particular log category.
|
|
||||||
*
|
|
||||||
* \param category the category to assign a priority to.
|
|
||||||
* \param priority the SDL_LogPriority to assign.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_LogGetPriority
|
|
||||||
* \sa SDL_LogSetAllPriority
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_LogSetPriority(int category,
|
|
||||||
SDL_LogPriority priority);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the priority of a particular log category.
|
|
||||||
*
|
|
||||||
* \param category the category to query.
|
|
||||||
* \returns the SDL_LogPriority for the requested category.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_LogSetPriority
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_LogPriority SDLCALL SDL_LogGetPriority(int category);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reset all priorities to default.
|
|
||||||
*
|
|
||||||
* This is called by SDL_Quit().
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_LogSetAllPriority
|
|
||||||
* \sa SDL_LogSetPriority
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_LogResetPriorities(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO.
|
|
||||||
*
|
|
||||||
* = * \param fmt a printf() style message format string
|
|
||||||
*
|
|
||||||
* \param ... additional parameters matching % tokens in the `fmt` string, if
|
|
||||||
* any.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_LogCritical
|
|
||||||
* \sa SDL_LogDebug
|
|
||||||
* \sa SDL_LogError
|
|
||||||
* \sa SDL_LogInfo
|
|
||||||
* \sa SDL_LogMessage
|
|
||||||
* \sa SDL_LogMessageV
|
|
||||||
* \sa SDL_LogVerbose
|
|
||||||
* \sa SDL_LogWarn
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Log a message with SDL_LOG_PRIORITY_VERBOSE.
|
|
||||||
*
|
|
||||||
* \param category the category of the message.
|
|
||||||
* \param fmt a printf() style message format string.
|
|
||||||
* \param ... additional parameters matching % tokens in the **fmt** string,
|
|
||||||
* if any.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_Log
|
|
||||||
* \sa SDL_LogCritical
|
|
||||||
* \sa SDL_LogDebug
|
|
||||||
* \sa SDL_LogError
|
|
||||||
* \sa SDL_LogInfo
|
|
||||||
* \sa SDL_LogMessage
|
|
||||||
* \sa SDL_LogMessageV
|
|
||||||
* \sa SDL_LogWarn
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_LogVerbose(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Log a message with SDL_LOG_PRIORITY_DEBUG.
|
|
||||||
*
|
|
||||||
* \param category the category of the message.
|
|
||||||
* \param fmt a printf() style message format string.
|
|
||||||
* \param ... additional parameters matching % tokens in the **fmt** string,
|
|
||||||
* if any.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_Log
|
|
||||||
* \sa SDL_LogCritical
|
|
||||||
* \sa SDL_LogError
|
|
||||||
* \sa SDL_LogInfo
|
|
||||||
* \sa SDL_LogMessage
|
|
||||||
* \sa SDL_LogMessageV
|
|
||||||
* \sa SDL_LogVerbose
|
|
||||||
* \sa SDL_LogWarn
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_LogDebug(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Log a message with SDL_LOG_PRIORITY_INFO.
|
|
||||||
*
|
|
||||||
* \param category the category of the message.
|
|
||||||
* \param fmt a printf() style message format string.
|
|
||||||
* \param ... additional parameters matching % tokens in the **fmt** string,
|
|
||||||
* if any.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_Log
|
|
||||||
* \sa SDL_LogCritical
|
|
||||||
* \sa SDL_LogDebug
|
|
||||||
* \sa SDL_LogError
|
|
||||||
* \sa SDL_LogMessage
|
|
||||||
* \sa SDL_LogMessageV
|
|
||||||
* \sa SDL_LogVerbose
|
|
||||||
* \sa SDL_LogWarn
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_LogInfo(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Log a message with SDL_LOG_PRIORITY_WARN.
|
|
||||||
*
|
|
||||||
* \param category the category of the message.
|
|
||||||
* \param fmt a printf() style message format string.
|
|
||||||
* \param ... additional parameters matching % tokens in the **fmt** string,
|
|
||||||
* if any.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_Log
|
|
||||||
* \sa SDL_LogCritical
|
|
||||||
* \sa SDL_LogDebug
|
|
||||||
* \sa SDL_LogError
|
|
||||||
* \sa SDL_LogInfo
|
|
||||||
* \sa SDL_LogMessage
|
|
||||||
* \sa SDL_LogMessageV
|
|
||||||
* \sa SDL_LogVerbose
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_LogWarn(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Log a message with SDL_LOG_PRIORITY_ERROR.
|
|
||||||
*
|
|
||||||
* \param category the category of the message.
|
|
||||||
* \param fmt a printf() style message format string.
|
|
||||||
* \param ... additional parameters matching % tokens in the **fmt** string,
|
|
||||||
* if any.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_Log
|
|
||||||
* \sa SDL_LogCritical
|
|
||||||
* \sa SDL_LogDebug
|
|
||||||
* \sa SDL_LogInfo
|
|
||||||
* \sa SDL_LogMessage
|
|
||||||
* \sa SDL_LogMessageV
|
|
||||||
* \sa SDL_LogVerbose
|
|
||||||
* \sa SDL_LogWarn
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_LogError(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Log a message with SDL_LOG_PRIORITY_CRITICAL.
|
|
||||||
*
|
|
||||||
* \param category the category of the message.
|
|
||||||
* \param fmt a printf() style message format string.
|
|
||||||
* \param ... additional parameters matching % tokens in the **fmt** string,
|
|
||||||
* if any.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_Log
|
|
||||||
* \sa SDL_LogDebug
|
|
||||||
* \sa SDL_LogError
|
|
||||||
* \sa SDL_LogInfo
|
|
||||||
* \sa SDL_LogMessage
|
|
||||||
* \sa SDL_LogMessageV
|
|
||||||
* \sa SDL_LogVerbose
|
|
||||||
* \sa SDL_LogWarn
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_LogCritical(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Log a message with the specified category and priority.
|
|
||||||
*
|
|
||||||
* \param category the category of the message.
|
|
||||||
* \param priority the priority of the message.
|
|
||||||
* \param fmt a printf() style message format string.
|
|
||||||
* \param ... additional parameters matching % tokens in the **fmt** string,
|
|
||||||
* if any.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_Log
|
|
||||||
* \sa SDL_LogCritical
|
|
||||||
* \sa SDL_LogDebug
|
|
||||||
* \sa SDL_LogError
|
|
||||||
* \sa SDL_LogInfo
|
|
||||||
* \sa SDL_LogMessageV
|
|
||||||
* \sa SDL_LogVerbose
|
|
||||||
* \sa SDL_LogWarn
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_LogMessage(int category,
|
|
||||||
SDL_LogPriority priority,
|
|
||||||
SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(3);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Log a message with the specified category and priority.
|
|
||||||
*
|
|
||||||
* \param category the category of the message.
|
|
||||||
* \param priority the priority of the message.
|
|
||||||
* \param fmt a printf() style message format string.
|
|
||||||
* \param ap a variable argument list.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_Log
|
|
||||||
* \sa SDL_LogCritical
|
|
||||||
* \sa SDL_LogDebug
|
|
||||||
* \sa SDL_LogError
|
|
||||||
* \sa SDL_LogInfo
|
|
||||||
* \sa SDL_LogMessage
|
|
||||||
* \sa SDL_LogVerbose
|
|
||||||
* \sa SDL_LogWarn
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_LogMessageV(int category,
|
|
||||||
SDL_LogPriority priority,
|
|
||||||
SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap) SDL_PRINTF_VARARG_FUNCV(3);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The prototype for the log output callback function.
|
|
||||||
*
|
|
||||||
* This function is called by SDL when there is new text to be logged.
|
|
||||||
*
|
|
||||||
* \param userdata what was passed as `userdata` to
|
|
||||||
* SDL_LogSetOutputFunction().
|
|
||||||
* \param category the category of the message.
|
|
||||||
* \param priority the priority of the message.
|
|
||||||
* \param message the message being output.
|
|
||||||
*/
|
|
||||||
typedef void (SDLCALL *SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the current log output function.
|
|
||||||
*
|
|
||||||
* \param callback an SDL_LogOutputFunction filled in with the current log
|
|
||||||
* callback.
|
|
||||||
* \param userdata a pointer filled in with the pointer that is passed to
|
|
||||||
* `callback`.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_LogSetOutputFunction
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_LogGetOutputFunction(SDL_LogOutputFunction *callback, void **userdata);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Replace the default log output function with one of your own.
|
|
||||||
*
|
|
||||||
* \param callback an SDL_LogOutputFunction to call instead of the default.
|
|
||||||
* \param userdata a pointer that is passed to `callback`.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_LogGetOutputFunction
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_LogSetOutputFunction(SDL_LogOutputFunction callback, void *userdata);
|
|
||||||
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include <SDL2/close_code.h>
|
|
||||||
|
|
||||||
#endif /* SDL_log_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
||||||
@@ -1,282 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2025 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_main_h_
|
|
||||||
#define SDL_main_h_
|
|
||||||
|
|
||||||
#include <SDL2/SDL_stdinc.h>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* # CategoryMain
|
|
||||||
*
|
|
||||||
* Redefine main() on some platforms so that it is called by SDL.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_MAIN_HANDLED
|
|
||||||
#if defined(__WIN32__)
|
|
||||||
/* On Windows SDL provides WinMain(), which parses the command line and passes
|
|
||||||
the arguments to your main function.
|
|
||||||
|
|
||||||
If you provide your own WinMain(), you may define SDL_MAIN_HANDLED
|
|
||||||
*/
|
|
||||||
#define SDL_MAIN_AVAILABLE
|
|
||||||
|
|
||||||
#elif defined(__WINRT__)
|
|
||||||
/* On WinRT, SDL provides a main function that initializes CoreApplication,
|
|
||||||
creating an instance of IFrameworkView in the process.
|
|
||||||
|
|
||||||
Please note that #include'ing SDL_main.h is not enough to get a main()
|
|
||||||
function working. In non-XAML apps, the file,
|
|
||||||
src/main/winrt/SDL_WinRT_main_NonXAML.cpp, or a copy of it, must be compiled
|
|
||||||
into the app itself. In XAML apps, the function, SDL_WinRTRunApp must be
|
|
||||||
called, with a pointer to the Direct3D-hosted XAML control passed in.
|
|
||||||
*/
|
|
||||||
#define SDL_MAIN_NEEDED
|
|
||||||
|
|
||||||
#elif defined(__GDK__)
|
|
||||||
/* On GDK, SDL provides a main function that initializes the game runtime.
|
|
||||||
|
|
||||||
Please note that #include'ing SDL_main.h is not enough to get a main()
|
|
||||||
function working. You must either link against SDL2main or, if not possible,
|
|
||||||
call the SDL_GDKRunApp function from your entry point.
|
|
||||||
*/
|
|
||||||
#define SDL_MAIN_NEEDED
|
|
||||||
|
|
||||||
#elif defined(__IPHONEOS__)
|
|
||||||
/* On iOS SDL provides a main function that creates an application delegate
|
|
||||||
and starts the iOS application run loop.
|
|
||||||
|
|
||||||
If you link with SDL dynamically on iOS, the main function can't be in a
|
|
||||||
shared library, so you need to link with libSDLmain.a, which includes a
|
|
||||||
stub main function that calls into the shared library to start execution.
|
|
||||||
|
|
||||||
See src/video/uikit/SDL_uikitappdelegate.m for more details.
|
|
||||||
*/
|
|
||||||
#define SDL_MAIN_NEEDED
|
|
||||||
|
|
||||||
#elif defined(__ANDROID__)
|
|
||||||
/* On Android SDL provides a Java class in SDLActivity.java that is the
|
|
||||||
main activity entry point.
|
|
||||||
|
|
||||||
See docs/README-android.md for more details on extending that class.
|
|
||||||
*/
|
|
||||||
#define SDL_MAIN_NEEDED
|
|
||||||
|
|
||||||
/* We need to export SDL_main so it can be launched from Java */
|
|
||||||
#define SDLMAIN_DECLSPEC DECLSPEC
|
|
||||||
|
|
||||||
#elif defined(__NACL__)
|
|
||||||
/* On NACL we use ppapi_simple to set up the application helper code,
|
|
||||||
then wait for the first PSE_INSTANCE_DIDCHANGEVIEW event before
|
|
||||||
starting the user main function.
|
|
||||||
All user code is run in a separate thread by ppapi_simple, thus
|
|
||||||
allowing for blocking io to take place via nacl_io
|
|
||||||
*/
|
|
||||||
#define SDL_MAIN_NEEDED
|
|
||||||
|
|
||||||
#elif defined(__PSP__)
|
|
||||||
/* On PSP SDL provides a main function that sets the module info,
|
|
||||||
activates the GPU and starts the thread required to be able to exit
|
|
||||||
the software.
|
|
||||||
|
|
||||||
If you provide this yourself, you may define SDL_MAIN_HANDLED
|
|
||||||
*/
|
|
||||||
#define SDL_MAIN_AVAILABLE
|
|
||||||
|
|
||||||
#elif defined(__PS2__)
|
|
||||||
#define SDL_MAIN_AVAILABLE
|
|
||||||
|
|
||||||
#define SDL_PS2_SKIP_IOP_RESET() \
|
|
||||||
void reset_IOP(); \
|
|
||||||
void reset_IOP() {}
|
|
||||||
|
|
||||||
#elif defined(__3DS__)
|
|
||||||
/*
|
|
||||||
On N3DS, SDL provides a main function that sets up the screens
|
|
||||||
and storage.
|
|
||||||
|
|
||||||
If you provide this yourself, you may define SDL_MAIN_HANDLED
|
|
||||||
*/
|
|
||||||
#define SDL_MAIN_AVAILABLE
|
|
||||||
|
|
||||||
#endif
|
|
||||||
#endif /* SDL_MAIN_HANDLED */
|
|
||||||
|
|
||||||
#ifndef SDLMAIN_DECLSPEC
|
|
||||||
#define SDLMAIN_DECLSPEC
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_main.h
|
|
||||||
*
|
|
||||||
* The application's main() function must be called with C linkage,
|
|
||||||
* and should be declared like this:
|
|
||||||
* ```c
|
|
||||||
* #ifdef __cplusplus
|
|
||||||
* extern "C"
|
|
||||||
* #endif
|
|
||||||
* int main(int argc, char *argv[])
|
|
||||||
* {
|
|
||||||
* }
|
|
||||||
* ```
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE)
|
|
||||||
#define main SDL_main
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <SDL2/begin_code.h>
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The prototype for the application's main() function
|
|
||||||
*/
|
|
||||||
typedef int (*SDL_main_func)(int argc, char *argv[]);
|
|
||||||
extern SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[]);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Circumvent failure of SDL_Init() when not using SDL_main() as an entry
|
|
||||||
* point.
|
|
||||||
*
|
|
||||||
* This function is defined in SDL_main.h, along with the preprocessor rule to
|
|
||||||
* redefine main() as SDL_main(). Thus to ensure that your main() function
|
|
||||||
* will not be changed it is necessary to define SDL_MAIN_HANDLED before
|
|
||||||
* including SDL.h.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_Init
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_SetMainReady(void);
|
|
||||||
|
|
||||||
#if defined(__WIN32__) || defined(__GDK__)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Register a win32 window class for SDL's use.
|
|
||||||
*
|
|
||||||
* This can be called to set the application window class at startup. It is
|
|
||||||
* safe to call this multiple times, as long as every call is eventually
|
|
||||||
* paired with a call to SDL_UnregisterApp, but a second registration attempt
|
|
||||||
* while a previous registration is still active will be ignored, other than
|
|
||||||
* to increment a counter.
|
|
||||||
*
|
|
||||||
* Most applications do not need to, and should not, call this directly; SDL
|
|
||||||
* will call it when initializing the video subsystem.
|
|
||||||
*
|
|
||||||
* \param name the window class name, in UTF-8 encoding. If NULL, SDL
|
|
||||||
* currently uses "SDL_app" but this isn't guaranteed.
|
|
||||||
* \param style the value to use in WNDCLASSEX::style. If `name` is NULL, SDL
|
|
||||||
* currently uses `(CS_BYTEALIGNCLIENT | CS_OWNDC)` regardless of
|
|
||||||
* what is specified here.
|
|
||||||
* \param hInst the HINSTANCE to use in WNDCLASSEX::hInstance. If zero, SDL
|
|
||||||
* will use `GetModuleHandle(NULL)` instead.
|
|
||||||
* \returns 0 on success, -1 on error. SDL_GetError() may have details.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.2.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void *hInst);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Deregister the win32 window class from an SDL_RegisterApp call.
|
|
||||||
*
|
|
||||||
* This can be called to undo the effects of SDL_RegisterApp.
|
|
||||||
*
|
|
||||||
* Most applications do not need to, and should not, call this directly; SDL
|
|
||||||
* will call it when deinitializing the video subsystem.
|
|
||||||
*
|
|
||||||
* It is safe to call this multiple times, as long as every call is eventually
|
|
||||||
* paired with a prior call to SDL_RegisterApp. The window class will only be
|
|
||||||
* deregistered when the registration counter in SDL_RegisterApp decrements to
|
|
||||||
* zero through calls to this function.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.2.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
|
|
||||||
|
|
||||||
#endif /* defined(__WIN32__) || defined(__GDK__) */
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __WINRT__
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize and launch an SDL/WinRT application.
|
|
||||||
*
|
|
||||||
* \param mainFunction the SDL app's C-style main(), an SDL_main_func.
|
|
||||||
* \param reserved reserved for future use; should be NULL.
|
|
||||||
* \returns 0 on success or -1 on failure; call SDL_GetError() to retrieve
|
|
||||||
* more information on the failure.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.3.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_WinRTRunApp(SDL_main_func mainFunction, void * reserved);
|
|
||||||
|
|
||||||
#endif /* __WINRT__ */
|
|
||||||
|
|
||||||
#if defined(__IPHONEOS__)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializes and launches an SDL application.
|
|
||||||
*
|
|
||||||
* \param argc The argc parameter from the application's main() function.
|
|
||||||
* \param argv The argv parameter from the application's main() function.
|
|
||||||
* \param mainFunction The SDL app's C-style main(), an SDL_main_func.
|
|
||||||
* \return the return value from mainFunction.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.10.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_UIKitRunApp(int argc, char *argv[], SDL_main_func mainFunction);
|
|
||||||
|
|
||||||
#endif /* __IPHONEOS__ */
|
|
||||||
|
|
||||||
#ifdef __GDK__
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize and launch an SDL GDK application.
|
|
||||||
*
|
|
||||||
* \param mainFunction the SDL app's C-style main(), an SDL_main_func.
|
|
||||||
* \param reserved reserved for future use; should be NULL.
|
|
||||||
* \returns 0 on success or -1 on failure; call SDL_GetError() to retrieve
|
|
||||||
* more information on the failure.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.24.0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GDKRunApp(SDL_main_func mainFunction, void *reserved);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Callback from the application to let the suspend continue.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.28.0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_GDKSuspendComplete(void);
|
|
||||||
|
|
||||||
#endif /* __GDK__ */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include <SDL2/close_code.h>
|
|
||||||
|
|
||||||
#endif /* SDL_main_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
||||||
@@ -1,464 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2025 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* # CategoryMouse
|
|
||||||
*
|
|
||||||
* Include file for SDL mouse event handling.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_mouse_h_
|
|
||||||
#define SDL_mouse_h_
|
|
||||||
|
|
||||||
#include <SDL2/SDL_stdinc.h>
|
|
||||||
#include <SDL2/SDL_error.h>
|
|
||||||
#include <SDL2/SDL_video.h>
|
|
||||||
|
|
||||||
#include <SDL2/begin_code.h>
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct SDL_Cursor SDL_Cursor; /**< Implementation dependent */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Cursor types for SDL_CreateSystemCursor().
|
|
||||||
*/
|
|
||||||
typedef enum SDL_SystemCursor
|
|
||||||
{
|
|
||||||
SDL_SYSTEM_CURSOR_ARROW, /**< Arrow */
|
|
||||||
SDL_SYSTEM_CURSOR_IBEAM, /**< I-beam */
|
|
||||||
SDL_SYSTEM_CURSOR_WAIT, /**< Wait */
|
|
||||||
SDL_SYSTEM_CURSOR_CROSSHAIR, /**< Crosshair */
|
|
||||||
SDL_SYSTEM_CURSOR_WAITARROW, /**< Small wait cursor (or Wait if not available) */
|
|
||||||
SDL_SYSTEM_CURSOR_SIZENWSE, /**< Double arrow pointing northwest and southeast */
|
|
||||||
SDL_SYSTEM_CURSOR_SIZENESW, /**< Double arrow pointing northeast and southwest */
|
|
||||||
SDL_SYSTEM_CURSOR_SIZEWE, /**< Double arrow pointing west and east */
|
|
||||||
SDL_SYSTEM_CURSOR_SIZENS, /**< Double arrow pointing north and south */
|
|
||||||
SDL_SYSTEM_CURSOR_SIZEALL, /**< Four pointed arrow pointing north, south, east, and west */
|
|
||||||
SDL_SYSTEM_CURSOR_NO, /**< Slashed circle or crossbones */
|
|
||||||
SDL_SYSTEM_CURSOR_HAND, /**< Hand */
|
|
||||||
SDL_NUM_SYSTEM_CURSORS
|
|
||||||
} SDL_SystemCursor;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Scroll direction types for the Scroll event
|
|
||||||
*/
|
|
||||||
typedef enum SDL_MouseWheelDirection
|
|
||||||
{
|
|
||||||
SDL_MOUSEWHEEL_NORMAL, /**< The scroll direction is normal */
|
|
||||||
SDL_MOUSEWHEEL_FLIPPED /**< The scroll direction is flipped / natural */
|
|
||||||
} SDL_MouseWheelDirection;
|
|
||||||
|
|
||||||
/* Function prototypes */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the window which currently has mouse focus.
|
|
||||||
*
|
|
||||||
* \returns the window with mouse focus.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Window * SDLCALL SDL_GetMouseFocus(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve the current state of the mouse.
|
|
||||||
*
|
|
||||||
* The current button state is returned as a button bitmask, which can be
|
|
||||||
* tested using the `SDL_BUTTON(X)` macros (where `X` is generally 1 for the
|
|
||||||
* left, 2 for middle, 3 for the right button), and `x` and `y` are set to the
|
|
||||||
* mouse cursor position relative to the focus window. You can pass NULL for
|
|
||||||
* either `x` or `y`.
|
|
||||||
*
|
|
||||||
* \param x the x coordinate of the mouse cursor position relative to the
|
|
||||||
* focus window.
|
|
||||||
* \param y the y coordinate of the mouse cursor position relative to the
|
|
||||||
* focus window.
|
|
||||||
* \returns a 32-bit button bitmask of the current button state.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetGlobalMouseState
|
|
||||||
* \sa SDL_GetRelativeMouseState
|
|
||||||
* \sa SDL_PumpEvents
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint32 SDLCALL SDL_GetMouseState(int *x, int *y);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the current state of the mouse in relation to the desktop.
|
|
||||||
*
|
|
||||||
* This works similarly to SDL_GetMouseState(), but the coordinates will be
|
|
||||||
* reported relative to the top-left of the desktop. This can be useful if you
|
|
||||||
* need to track the mouse outside of a specific window and SDL_CaptureMouse()
|
|
||||||
* doesn't fit your needs. For example, it could be useful if you need to
|
|
||||||
* track the mouse while dragging a window, where coordinates relative to a
|
|
||||||
* window might not be in sync at all times.
|
|
||||||
*
|
|
||||||
* Note: SDL_GetMouseState() returns the mouse position as SDL understands it
|
|
||||||
* from the last pump of the event queue. This function, however, queries the
|
|
||||||
* OS for the current mouse position, and as such, might be a slightly less
|
|
||||||
* efficient function. Unless you know what you're doing and have a good
|
|
||||||
* reason to use this function, you probably want SDL_GetMouseState() instead.
|
|
||||||
*
|
|
||||||
* \param x filled in with the current X coord relative to the desktop; can be
|
|
||||||
* NULL.
|
|
||||||
* \param y filled in with the current Y coord relative to the desktop; can be
|
|
||||||
* NULL.
|
|
||||||
* \returns the current button state as a bitmask which can be tested using
|
|
||||||
* the SDL_BUTTON(X) macros.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.4.
|
|
||||||
*
|
|
||||||
* \sa SDL_CaptureMouse
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint32 SDLCALL SDL_GetGlobalMouseState(int *x, int *y);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve the relative state of the mouse.
|
|
||||||
*
|
|
||||||
* The current button state is returned as a button bitmask, which can be
|
|
||||||
* tested using the `SDL_BUTTON(X)` macros (where `X` is generally 1 for the
|
|
||||||
* left, 2 for middle, 3 for the right button), and `x` and `y` are set to the
|
|
||||||
* mouse deltas since the last call to SDL_GetRelativeMouseState() or since
|
|
||||||
* event initialization. You can pass NULL for either `x` or `y`.
|
|
||||||
*
|
|
||||||
* \param x a pointer filled with the last recorded x coordinate of the mouse.
|
|
||||||
* \param y a pointer filled with the last recorded y coordinate of the mouse.
|
|
||||||
* \returns a 32-bit button bitmask of the relative button state.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetMouseState
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint32 SDLCALL SDL_GetRelativeMouseState(int *x, int *y);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Move the mouse cursor to the given position within the window.
|
|
||||||
*
|
|
||||||
* This function generates a mouse motion event if relative mode is not
|
|
||||||
* enabled. If relative mode is enabled, you can force mouse events for the
|
|
||||||
* warp by setting the SDL_HINT_MOUSE_RELATIVE_WARP_MOTION hint.
|
|
||||||
*
|
|
||||||
* Note that this function will appear to succeed, but not actually move the
|
|
||||||
* mouse when used over Microsoft Remote Desktop.
|
|
||||||
*
|
|
||||||
* \param window the window to move the mouse into, or NULL for the current
|
|
||||||
* mouse focus.
|
|
||||||
* \param x the x coordinate within the window.
|
|
||||||
* \param y the y coordinate within the window.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_WarpMouseGlobal
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window,
|
|
||||||
int x, int y);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Move the mouse to the given position in global screen space.
|
|
||||||
*
|
|
||||||
* This function generates a mouse motion event.
|
|
||||||
*
|
|
||||||
* A failure of this function usually means that it is unsupported by a
|
|
||||||
* platform.
|
|
||||||
*
|
|
||||||
* Note that this function will appear to succeed, but not actually move the
|
|
||||||
* mouse when used over Microsoft Remote Desktop.
|
|
||||||
*
|
|
||||||
* \param x the x coordinate.
|
|
||||||
* \param y the y coordinate.
|
|
||||||
* \returns 0 on success or a negative error code on failure; call
|
|
||||||
* SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.4.
|
|
||||||
*
|
|
||||||
* \sa SDL_WarpMouseInWindow
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_WarpMouseGlobal(int x, int y);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set relative mouse mode.
|
|
||||||
*
|
|
||||||
* While the mouse is in relative mode, the cursor is hidden, the mouse
|
|
||||||
* position is constrained to the window, and SDL will report continuous
|
|
||||||
* relative mouse motion even if the mouse is at the edge of the window.
|
|
||||||
*
|
|
||||||
* This function will flush any pending mouse motion.
|
|
||||||
*
|
|
||||||
* \param enabled SDL_TRUE to enable relative mode, SDL_FALSE to disable.
|
|
||||||
* \returns 0 on success or a negative error code on failure; call
|
|
||||||
* SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* If relative mode is not supported, this returns -1.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetRelativeMouseMode
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Capture the mouse and to track input outside an SDL window.
|
|
||||||
*
|
|
||||||
* Capturing enables your app to obtain mouse events globally, instead of just
|
|
||||||
* within your window. Not all video targets support this function. When
|
|
||||||
* capturing is enabled, the current window will get all mouse events, but
|
|
||||||
* unlike relative mode, no change is made to the cursor and it is not
|
|
||||||
* restrained to your window.
|
|
||||||
*
|
|
||||||
* This function may also deny mouse input to other windows--both those in
|
|
||||||
* your application and others on the system--so you should use this function
|
|
||||||
* sparingly, and in small bursts. For example, you might want to track the
|
|
||||||
* mouse while the user is dragging something, until the user releases a mouse
|
|
||||||
* button. It is not recommended that you capture the mouse for long periods
|
|
||||||
* of time, such as the entire time your app is running. For that, you should
|
|
||||||
* probably use SDL_SetRelativeMouseMode() or SDL_SetWindowGrab(), depending
|
|
||||||
* on your goals.
|
|
||||||
*
|
|
||||||
* While captured, mouse events still report coordinates relative to the
|
|
||||||
* current (foreground) window, but those coordinates may be outside the
|
|
||||||
* bounds of the window (including negative values). Capturing is only allowed
|
|
||||||
* for the foreground window. If the window loses focus while capturing, the
|
|
||||||
* capture will be disabled automatically.
|
|
||||||
*
|
|
||||||
* While capturing is enabled, the current window will have the
|
|
||||||
* `SDL_WINDOW_MOUSE_CAPTURE` flag set.
|
|
||||||
*
|
|
||||||
* Please note that as of SDL 2.0.22, SDL will attempt to "auto capture" the
|
|
||||||
* mouse while the user is pressing a button; this is to try and make mouse
|
|
||||||
* behavior more consistent between platforms, and deal with the common case
|
|
||||||
* of a user dragging the mouse outside of the window. This means that if you
|
|
||||||
* are calling SDL_CaptureMouse() only to deal with this situation, you no
|
|
||||||
* longer have to (although it is safe to do so). If this causes problems for
|
|
||||||
* your app, you can disable auto capture by setting the
|
|
||||||
* `SDL_HINT_MOUSE_AUTO_CAPTURE` hint to zero.
|
|
||||||
*
|
|
||||||
* \param enabled SDL_TRUE to enable capturing, SDL_FALSE to disable.
|
|
||||||
* \returns 0 on success or -1 if not supported; call SDL_GetError() for more
|
|
||||||
* information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.4.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetGlobalMouseState
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_CaptureMouse(SDL_bool enabled);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Query whether relative mouse mode is enabled.
|
|
||||||
*
|
|
||||||
* \returns SDL_TRUE if relative mode is enabled or SDL_FALSE otherwise.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_SetRelativeMouseMode
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a cursor using the specified bitmap data and mask (in MSB format).
|
|
||||||
*
|
|
||||||
* `mask` has to be in MSB (Most Significant Bit) format.
|
|
||||||
*
|
|
||||||
* The cursor width (`w`) must be a multiple of 8 bits.
|
|
||||||
*
|
|
||||||
* The cursor is created in black and white according to the following:
|
|
||||||
*
|
|
||||||
* - data=0, mask=1: white
|
|
||||||
* - data=1, mask=1: black
|
|
||||||
* - data=0, mask=0: transparent
|
|
||||||
* - data=1, mask=0: inverted color if possible, black if not.
|
|
||||||
*
|
|
||||||
* Cursors created with this function must be freed with SDL_FreeCursor().
|
|
||||||
*
|
|
||||||
* If you want to have a color cursor, or create your cursor from an
|
|
||||||
* SDL_Surface, you should use SDL_CreateColorCursor(). Alternately, you can
|
|
||||||
* hide the cursor and draw your own as part of your game's rendering, but it
|
|
||||||
* will be bound to the framerate.
|
|
||||||
*
|
|
||||||
* Also, since SDL 2.0.0, SDL_CreateSystemCursor() is available, which
|
|
||||||
* provides twelve readily available system cursors to pick from.
|
|
||||||
*
|
|
||||||
* \param data the color value for each pixel of the cursor.
|
|
||||||
* \param mask the mask value for each pixel of the cursor.
|
|
||||||
* \param w the width of the cursor.
|
|
||||||
* \param h the height of the cursor.
|
|
||||||
* \param hot_x the X-axis location of the upper left corner of the cursor
|
|
||||||
* relative to the actual mouse position.
|
|
||||||
* \param hot_y the Y-axis location of the upper left corner of the cursor
|
|
||||||
* relative to the actual mouse position.
|
|
||||||
* \returns a new cursor with the specified parameters on success or NULL on
|
|
||||||
* failure; call SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_FreeCursor
|
|
||||||
* \sa SDL_SetCursor
|
|
||||||
* \sa SDL_ShowCursor
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data,
|
|
||||||
const Uint8 * mask,
|
|
||||||
int w, int h, int hot_x,
|
|
||||||
int hot_y);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a color cursor.
|
|
||||||
*
|
|
||||||
* \param surface an SDL_Surface structure representing the cursor image.
|
|
||||||
* \param hot_x the x position of the cursor hot spot.
|
|
||||||
* \param hot_y the y position of the cursor hot spot.
|
|
||||||
* \returns the new cursor on success or NULL on failure; call SDL_GetError()
|
|
||||||
* for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_CreateCursor
|
|
||||||
* \sa SDL_FreeCursor
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateColorCursor(SDL_Surface *surface,
|
|
||||||
int hot_x,
|
|
||||||
int hot_y);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a system cursor.
|
|
||||||
*
|
|
||||||
* \param id an SDL_SystemCursor enum value.
|
|
||||||
* \returns a cursor on success or NULL on failure; call SDL_GetError() for
|
|
||||||
* more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_FreeCursor
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the active cursor.
|
|
||||||
*
|
|
||||||
* This function sets the currently active cursor to the specified one. If the
|
|
||||||
* cursor is currently visible, the change will be immediately represented on
|
|
||||||
* the display. SDL_SetCursor(NULL) can be used to force cursor redraw, if
|
|
||||||
* this is desired for any reason.
|
|
||||||
*
|
|
||||||
* \param cursor a cursor to make active.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_CreateCursor
|
|
||||||
* \sa SDL_GetCursor
|
|
||||||
* \sa SDL_ShowCursor
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor * cursor);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the active cursor.
|
|
||||||
*
|
|
||||||
* This function returns a pointer to the current cursor which is owned by the
|
|
||||||
* library. It is not necessary to free the cursor with SDL_FreeCursor().
|
|
||||||
*
|
|
||||||
* \returns the active cursor or NULL if there is no mouse.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_SetCursor
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the default cursor.
|
|
||||||
*
|
|
||||||
* You do not have to call SDL_FreeCursor() on the return value, but it is
|
|
||||||
* safe to do so.
|
|
||||||
*
|
|
||||||
* \returns the default cursor on success or NULL on failure.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_CreateSystemCursor
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetDefaultCursor(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Free a previously-created cursor.
|
|
||||||
*
|
|
||||||
* Use this function to free cursor resources created with SDL_CreateCursor(),
|
|
||||||
* SDL_CreateColorCursor() or SDL_CreateSystemCursor().
|
|
||||||
*
|
|
||||||
* \param cursor the cursor to free.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_CreateColorCursor
|
|
||||||
* \sa SDL_CreateCursor
|
|
||||||
* \sa SDL_CreateSystemCursor
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor * cursor);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Toggle whether or not the cursor is shown.
|
|
||||||
*
|
|
||||||
* The cursor starts off displayed but can be turned off. Passing `SDL_ENABLE`
|
|
||||||
* displays the cursor and passing `SDL_DISABLE` hides it.
|
|
||||||
*
|
|
||||||
* The current state of the mouse cursor can be queried by passing
|
|
||||||
* `SDL_QUERY`; either `SDL_DISABLE` or `SDL_ENABLE` will be returned.
|
|
||||||
*
|
|
||||||
* \param toggle `SDL_ENABLE` to show the cursor, `SDL_DISABLE` to hide it,
|
|
||||||
* `SDL_QUERY` to query the current state without changing it.
|
|
||||||
* \returns `SDL_ENABLE` if the cursor is shown, or `SDL_DISABLE` if the
|
|
||||||
* cursor is hidden, or a negative error code on failure; call
|
|
||||||
* SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_CreateCursor
|
|
||||||
* \sa SDL_SetCursor
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Used as a mask when testing buttons in buttonstate.
|
|
||||||
*
|
|
||||||
* - Button 1: Left mouse button
|
|
||||||
* - Button 2: Middle mouse button
|
|
||||||
* - Button 3: Right mouse button
|
|
||||||
*/
|
|
||||||
#define SDL_BUTTON(X) (1 << ((X)-1))
|
|
||||||
#define SDL_BUTTON_LEFT 1
|
|
||||||
#define SDL_BUTTON_MIDDLE 2
|
|
||||||
#define SDL_BUTTON_RIGHT 3
|
|
||||||
#define SDL_BUTTON_X1 4
|
|
||||||
#define SDL_BUTTON_X2 5
|
|
||||||
#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT)
|
|
||||||
#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE)
|
|
||||||
#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT)
|
|
||||||
#define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1)
|
|
||||||
#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2)
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include <SDL2/close_code.h>
|
|
||||||
|
|
||||||
#endif /* SDL_mouse_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
||||||
@@ -1,545 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2025 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_mutex_h_
|
|
||||||
#define SDL_mutex_h_
|
|
||||||
|
|
||||||
/**
|
|
||||||
* # CategoryMutex
|
|
||||||
*
|
|
||||||
* Functions to provide thread synchronization primitives.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <SDL2/SDL_stdinc.h>
|
|
||||||
#include <SDL2/SDL_error.h>
|
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
/* Enable thread safety attributes only with clang.
|
|
||||||
* The attributes can be safely erased when compiling with other compilers.
|
|
||||||
*/
|
|
||||||
#if defined(SDL_THREAD_SAFETY_ANALYSIS) && \
|
|
||||||
defined(__clang__) && (!defined(SWIG))
|
|
||||||
#define SDL_THREAD_ANNOTATION_ATTRIBUTE__(x) __attribute__((x))
|
|
||||||
#else
|
|
||||||
#define SDL_THREAD_ANNOTATION_ATTRIBUTE__(x) /* no-op */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define SDL_CAPABILITY(x) \
|
|
||||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(capability(x))
|
|
||||||
|
|
||||||
#define SDL_SCOPED_CAPABILITY \
|
|
||||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(scoped_lockable)
|
|
||||||
|
|
||||||
#define SDL_GUARDED_BY(x) \
|
|
||||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(guarded_by(x))
|
|
||||||
|
|
||||||
#define SDL_PT_GUARDED_BY(x) \
|
|
||||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(pt_guarded_by(x))
|
|
||||||
|
|
||||||
#define SDL_ACQUIRED_BEFORE(x) \
|
|
||||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(acquired_before(x))
|
|
||||||
|
|
||||||
#define SDL_ACQUIRED_AFTER(x) \
|
|
||||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(acquired_after(x))
|
|
||||||
|
|
||||||
#define SDL_REQUIRES(x) \
|
|
||||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(requires_capability(x))
|
|
||||||
|
|
||||||
#define SDL_REQUIRES_SHARED(x) \
|
|
||||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(requires_shared_capability(x))
|
|
||||||
|
|
||||||
#define SDL_ACQUIRE(x) \
|
|
||||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(acquire_capability(x))
|
|
||||||
|
|
||||||
#define SDL_ACQUIRE_SHARED(x) \
|
|
||||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(acquire_shared_capability(x))
|
|
||||||
|
|
||||||
#define SDL_RELEASE(x) \
|
|
||||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(release_capability(x))
|
|
||||||
|
|
||||||
#define SDL_RELEASE_SHARED(x) \
|
|
||||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(release_shared_capability(x))
|
|
||||||
|
|
||||||
#define SDL_RELEASE_GENERIC(x) \
|
|
||||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(release_generic_capability(x))
|
|
||||||
|
|
||||||
#define SDL_TRY_ACQUIRE(x, y) \
|
|
||||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(try_acquire_capability(x, y))
|
|
||||||
|
|
||||||
#define SDL_TRY_ACQUIRE_SHARED(x, y) \
|
|
||||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(try_acquire_shared_capability(x, y))
|
|
||||||
|
|
||||||
#define SDL_EXCLUDES(x) \
|
|
||||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(locks_excluded(x))
|
|
||||||
|
|
||||||
#define SDL_ASSERT_CAPABILITY(x) \
|
|
||||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(assert_capability(x))
|
|
||||||
|
|
||||||
#define SDL_ASSERT_SHARED_CAPABILITY(x) \
|
|
||||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(assert_shared_capability(x))
|
|
||||||
|
|
||||||
#define SDL_RETURN_CAPABILITY(x) \
|
|
||||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(lock_returned(x))
|
|
||||||
|
|
||||||
#define SDL_NO_THREAD_SAFETY_ANALYSIS \
|
|
||||||
SDL_THREAD_ANNOTATION_ATTRIBUTE__(no_thread_safety_analysis)
|
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
#include <SDL2/begin_code.h>
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Synchronization functions which can time out return this value if they time
|
|
||||||
* out.
|
|
||||||
*/
|
|
||||||
#define SDL_MUTEX_TIMEDOUT 1
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is the timeout value which corresponds to never time out.
|
|
||||||
*/
|
|
||||||
#define SDL_MUTEX_MAXWAIT (~(Uint32)0)
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Mutex functions
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
|
|
||||||
/* The SDL mutex structure, defined in SDL_sysmutex.c */
|
|
||||||
struct SDL_mutex;
|
|
||||||
typedef struct SDL_mutex SDL_mutex;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new mutex.
|
|
||||||
*
|
|
||||||
* All newly-created mutexes begin in the _unlocked_ state.
|
|
||||||
*
|
|
||||||
* Calls to SDL_LockMutex() will not return while the mutex is locked by
|
|
||||||
* another thread. See SDL_TryLockMutex() to attempt to lock without blocking.
|
|
||||||
*
|
|
||||||
* SDL mutexes are reentrant.
|
|
||||||
*
|
|
||||||
* \returns the initialized and unlocked mutex or NULL on failure; call
|
|
||||||
* SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_DestroyMutex
|
|
||||||
* \sa SDL_LockMutex
|
|
||||||
* \sa SDL_TryLockMutex
|
|
||||||
* \sa SDL_UnlockMutex
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_mutex *SDLCALL SDL_CreateMutex(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Lock the mutex.
|
|
||||||
*
|
|
||||||
* This will block until the mutex is available, which is to say it is in the
|
|
||||||
* unlocked state and the OS has chosen the caller as the next thread to lock
|
|
||||||
* it. Of all threads waiting to lock the mutex, only one may do so at a time.
|
|
||||||
*
|
|
||||||
* It is legal for the owning thread to lock an already-locked mutex. It must
|
|
||||||
* unlock it the same number of times before it is actually made available for
|
|
||||||
* other threads in the system (this is known as a "recursive mutex").
|
|
||||||
*
|
|
||||||
* \param mutex the mutex to lock.
|
|
||||||
* \return 0, or -1 on error.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_LockMutex(SDL_mutex * mutex) SDL_ACQUIRE(mutex);
|
|
||||||
#define SDL_mutexP(m) SDL_LockMutex(m)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Try to lock a mutex without blocking.
|
|
||||||
*
|
|
||||||
* This works just like SDL_LockMutex(), but if the mutex is not available,
|
|
||||||
* this function returns `SDL_MUTEX_TIMEOUT` immediately.
|
|
||||||
*
|
|
||||||
* This technique is useful if you need exclusive access to a resource but
|
|
||||||
* don't want to wait for it, and will return to it to try again later.
|
|
||||||
*
|
|
||||||
* \param mutex the mutex to try to lock.
|
|
||||||
* \returns 0, `SDL_MUTEX_TIMEDOUT`, or -1 on error; call SDL_GetError() for
|
|
||||||
* more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_CreateMutex
|
|
||||||
* \sa SDL_DestroyMutex
|
|
||||||
* \sa SDL_LockMutex
|
|
||||||
* \sa SDL_UnlockMutex
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_TryLockMutex(SDL_mutex * mutex) SDL_TRY_ACQUIRE(0, mutex);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Unlock the mutex.
|
|
||||||
*
|
|
||||||
* It is legal for the owning thread to lock an already-locked mutex. It must
|
|
||||||
* unlock it the same number of times before it is actually made available for
|
|
||||||
* other threads in the system (this is known as a "recursive mutex").
|
|
||||||
*
|
|
||||||
* It is an error to unlock a mutex that has not been locked by the current
|
|
||||||
* thread, and doing so results in undefined behavior.
|
|
||||||
*
|
|
||||||
* It is also an error to unlock a mutex that isn't locked at all.
|
|
||||||
*
|
|
||||||
* \param mutex the mutex to unlock.
|
|
||||||
* \returns 0, or -1 on error.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_UnlockMutex(SDL_mutex * mutex) SDL_RELEASE(mutex);
|
|
||||||
#define SDL_mutexV(m) SDL_UnlockMutex(m)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Destroy a mutex created with SDL_CreateMutex().
|
|
||||||
*
|
|
||||||
* This function must be called on any mutex that is no longer needed. Failure
|
|
||||||
* to destroy a mutex will result in a system memory or resource leak. While
|
|
||||||
* it is safe to destroy a mutex that is _unlocked_, it is not safe to attempt
|
|
||||||
* to destroy a locked mutex, and may result in undefined behavior depending
|
|
||||||
* on the platform.
|
|
||||||
*
|
|
||||||
* \param mutex the mutex to destroy.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_CreateMutex
|
|
||||||
* \sa SDL_LockMutex
|
|
||||||
* \sa SDL_TryLockMutex
|
|
||||||
* \sa SDL_UnlockMutex
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex * mutex);
|
|
||||||
|
|
||||||
/* @} *//* Mutex functions */
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Semaphore functions
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
|
|
||||||
/* The SDL semaphore structure, defined in SDL_syssem.c */
|
|
||||||
struct SDL_semaphore;
|
|
||||||
typedef struct SDL_semaphore SDL_sem;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a semaphore.
|
|
||||||
*
|
|
||||||
* This function creates a new semaphore and initializes it with the value
|
|
||||||
* `initial_value`. Each wait operation on the semaphore will atomically
|
|
||||||
* decrement the semaphore value and potentially block if the semaphore value
|
|
||||||
* is 0. Each post operation will atomically increment the semaphore value and
|
|
||||||
* wake waiting threads and allow them to retry the wait operation.
|
|
||||||
*
|
|
||||||
* \param initial_value the starting value of the semaphore.
|
|
||||||
* \returns a new semaphore or NULL on failure; call SDL_GetError() for more
|
|
||||||
* information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_DestroySemaphore
|
|
||||||
* \sa SDL_SemPost
|
|
||||||
* \sa SDL_SemTryWait
|
|
||||||
* \sa SDL_SemValue
|
|
||||||
* \sa SDL_SemWait
|
|
||||||
* \sa SDL_SemWaitTimeout
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_sem *SDLCALL SDL_CreateSemaphore(Uint32 initial_value);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Destroy a semaphore.
|
|
||||||
*
|
|
||||||
* It is not safe to destroy a semaphore if there are threads currently
|
|
||||||
* waiting on it.
|
|
||||||
*
|
|
||||||
* \param sem the semaphore to destroy.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_CreateSemaphore
|
|
||||||
* \sa SDL_SemPost
|
|
||||||
* \sa SDL_SemTryWait
|
|
||||||
* \sa SDL_SemValue
|
|
||||||
* \sa SDL_SemWait
|
|
||||||
* \sa SDL_SemWaitTimeout
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem * sem);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Wait until a semaphore has a positive value and then decrements it.
|
|
||||||
*
|
|
||||||
* This function suspends the calling thread until either the semaphore
|
|
||||||
* pointed to by `sem` has a positive value or the call is interrupted by a
|
|
||||||
* signal or error. If the call is successful it will atomically decrement the
|
|
||||||
* semaphore value.
|
|
||||||
*
|
|
||||||
* This function is the equivalent of calling SDL_SemWaitTimeout() with a time
|
|
||||||
* length of `SDL_MUTEX_MAXWAIT`.
|
|
||||||
*
|
|
||||||
* \param sem the semaphore wait on.
|
|
||||||
* \returns 0 on success or a negative error code on failure; call
|
|
||||||
* SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_CreateSemaphore
|
|
||||||
* \sa SDL_DestroySemaphore
|
|
||||||
* \sa SDL_SemPost
|
|
||||||
* \sa SDL_SemTryWait
|
|
||||||
* \sa SDL_SemValue
|
|
||||||
* \sa SDL_SemWait
|
|
||||||
* \sa SDL_SemWaitTimeout
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem * sem);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* See if a semaphore has a positive value and decrement it if it does.
|
|
||||||
*
|
|
||||||
* This function checks to see if the semaphore pointed to by `sem` has a
|
|
||||||
* positive value and atomically decrements the semaphore value if it does. If
|
|
||||||
* the semaphore doesn't have a positive value, the function immediately
|
|
||||||
* returns SDL_MUTEX_TIMEDOUT.
|
|
||||||
*
|
|
||||||
* \param sem the semaphore to wait on.
|
|
||||||
* \returns 0 if the wait succeeds, `SDL_MUTEX_TIMEDOUT` if the wait would
|
|
||||||
* block, or a negative error code on failure; call SDL_GetError()
|
|
||||||
* for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_CreateSemaphore
|
|
||||||
* \sa SDL_DestroySemaphore
|
|
||||||
* \sa SDL_SemPost
|
|
||||||
* \sa SDL_SemValue
|
|
||||||
* \sa SDL_SemWait
|
|
||||||
* \sa SDL_SemWaitTimeout
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem * sem);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Wait until a semaphore has a positive value and then decrements it.
|
|
||||||
*
|
|
||||||
* This function suspends the calling thread until either the semaphore
|
|
||||||
* pointed to by `sem` has a positive value, the call is interrupted by a
|
|
||||||
* signal or error, or the specified time has elapsed. If the call is
|
|
||||||
* successful it will atomically decrement the semaphore value.
|
|
||||||
*
|
|
||||||
* \param sem the semaphore to wait on.
|
|
||||||
* \param timeout the length of the timeout, in milliseconds.
|
|
||||||
* \returns 0 if the wait succeeds, `SDL_MUTEX_TIMEDOUT` if the wait does not
|
|
||||||
* succeed in the allotted time, or a negative error code on failure;
|
|
||||||
* call SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_CreateSemaphore
|
|
||||||
* \sa SDL_DestroySemaphore
|
|
||||||
* \sa SDL_SemPost
|
|
||||||
* \sa SDL_SemTryWait
|
|
||||||
* \sa SDL_SemValue
|
|
||||||
* \sa SDL_SemWait
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Atomically increment a semaphore's value and wake waiting threads.
|
|
||||||
*
|
|
||||||
* \param sem the semaphore to increment.
|
|
||||||
* \returns 0 on success or a negative error code on failure; call
|
|
||||||
* SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_CreateSemaphore
|
|
||||||
* \sa SDL_DestroySemaphore
|
|
||||||
* \sa SDL_SemTryWait
|
|
||||||
* \sa SDL_SemValue
|
|
||||||
* \sa SDL_SemWait
|
|
||||||
* \sa SDL_SemWaitTimeout
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem * sem);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the current value of a semaphore.
|
|
||||||
*
|
|
||||||
* \param sem the semaphore to query.
|
|
||||||
* \returns the current value of the semaphore.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_CreateSemaphore
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem * sem);
|
|
||||||
|
|
||||||
/* @} *//* Semaphore functions */
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Condition variable functions
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
|
|
||||||
/* The SDL condition variable structure, defined in SDL_syscond.c */
|
|
||||||
struct SDL_cond;
|
|
||||||
typedef struct SDL_cond SDL_cond;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a condition variable.
|
|
||||||
*
|
|
||||||
* \returns a new condition variable or NULL on failure; call SDL_GetError()
|
|
||||||
* for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_CondBroadcast
|
|
||||||
* \sa SDL_CondSignal
|
|
||||||
* \sa SDL_CondWait
|
|
||||||
* \sa SDL_CondWaitTimeout
|
|
||||||
* \sa SDL_DestroyCond
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_cond *SDLCALL SDL_CreateCond(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Destroy a condition variable.
|
|
||||||
*
|
|
||||||
* \param cond the condition variable to destroy.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_CondBroadcast
|
|
||||||
* \sa SDL_CondSignal
|
|
||||||
* \sa SDL_CondWait
|
|
||||||
* \sa SDL_CondWaitTimeout
|
|
||||||
* \sa SDL_CreateCond
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond * cond);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Restart one of the threads that are waiting on the condition variable.
|
|
||||||
*
|
|
||||||
* \param cond the condition variable to signal.
|
|
||||||
* \returns 0 on success or a negative error code on failure; call
|
|
||||||
* SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_CondBroadcast
|
|
||||||
* \sa SDL_CondWait
|
|
||||||
* \sa SDL_CondWaitTimeout
|
|
||||||
* \sa SDL_CreateCond
|
|
||||||
* \sa SDL_DestroyCond
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond * cond);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Restart all threads that are waiting on the condition variable.
|
|
||||||
*
|
|
||||||
* \param cond the condition variable to signal.
|
|
||||||
* \returns 0 on success or a negative error code on failure; call
|
|
||||||
* SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_CondSignal
|
|
||||||
* \sa SDL_CondWait
|
|
||||||
* \sa SDL_CondWaitTimeout
|
|
||||||
* \sa SDL_CreateCond
|
|
||||||
* \sa SDL_DestroyCond
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond * cond);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Wait until a condition variable is signaled.
|
|
||||||
*
|
|
||||||
* This function unlocks the specified `mutex` and waits for another thread to
|
|
||||||
* call SDL_CondSignal() or SDL_CondBroadcast() on the condition variable
|
|
||||||
* `cond`. Once the condition variable is signaled, the mutex is re-locked and
|
|
||||||
* the function returns.
|
|
||||||
*
|
|
||||||
* The mutex must be locked before calling this function.
|
|
||||||
*
|
|
||||||
* This function is the equivalent of calling SDL_CondWaitTimeout() with a
|
|
||||||
* time length of `SDL_MUTEX_MAXWAIT`.
|
|
||||||
*
|
|
||||||
* \param cond the condition variable to wait on.
|
|
||||||
* \param mutex the mutex used to coordinate thread access.
|
|
||||||
* \returns 0 when it is signaled or a negative error code on failure; call
|
|
||||||
* SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_CondBroadcast
|
|
||||||
* \sa SDL_CondSignal
|
|
||||||
* \sa SDL_CondWaitTimeout
|
|
||||||
* \sa SDL_CreateCond
|
|
||||||
* \sa SDL_DestroyCond
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Wait until a condition variable is signaled or a certain time has passed.
|
|
||||||
*
|
|
||||||
* This function unlocks the specified `mutex` and waits for another thread to
|
|
||||||
* call SDL_CondSignal() or SDL_CondBroadcast() on the condition variable
|
|
||||||
* `cond`, or for the specified time to elapse. Once the condition variable is
|
|
||||||
* signaled or the time elapsed, the mutex is re-locked and the function
|
|
||||||
* returns.
|
|
||||||
*
|
|
||||||
* The mutex must be locked before calling this function.
|
|
||||||
*
|
|
||||||
* \param cond the condition variable to wait on.
|
|
||||||
* \param mutex the mutex used to coordinate thread access.
|
|
||||||
* \param ms the maximum time to wait, in milliseconds, or `SDL_MUTEX_MAXWAIT`
|
|
||||||
* to wait indefinitely.
|
|
||||||
* \returns 0 if the condition variable is signaled, `SDL_MUTEX_TIMEDOUT` if
|
|
||||||
* the condition is not signaled in the allotted time, or a negative
|
|
||||||
* error code on failure; call SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_CondBroadcast
|
|
||||||
* \sa SDL_CondSignal
|
|
||||||
* \sa SDL_CondWait
|
|
||||||
* \sa SDL_CreateCond
|
|
||||||
* \sa SDL_DestroyCond
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond * cond,
|
|
||||||
SDL_mutex * mutex, Uint32 ms);
|
|
||||||
|
|
||||||
/* @} *//* Condition variable functions */
|
|
||||||
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include <SDL2/close_code.h>
|
|
||||||
|
|
||||||
#endif /* SDL_mutex_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
||||||
@@ -1,686 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2025 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* # CategoryPixels
|
|
||||||
*
|
|
||||||
* Header for the enumerated pixel format definitions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_pixels_h_
|
|
||||||
#define SDL_pixels_h_
|
|
||||||
|
|
||||||
#include <SDL2/SDL_stdinc.h>
|
|
||||||
#include <SDL2/SDL_endian.h>
|
|
||||||
|
|
||||||
#include <SDL2/begin_code.h>
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Transparency definitions
|
|
||||||
*
|
|
||||||
* These define alpha as the opacity of a surface.
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
#define SDL_ALPHA_OPAQUE 255
|
|
||||||
#define SDL_ALPHA_TRANSPARENT 0
|
|
||||||
/* @} */
|
|
||||||
|
|
||||||
/** Pixel type. */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_PIXELTYPE_UNKNOWN,
|
|
||||||
SDL_PIXELTYPE_INDEX1,
|
|
||||||
SDL_PIXELTYPE_INDEX4,
|
|
||||||
SDL_PIXELTYPE_INDEX8,
|
|
||||||
SDL_PIXELTYPE_PACKED8,
|
|
||||||
SDL_PIXELTYPE_PACKED16,
|
|
||||||
SDL_PIXELTYPE_PACKED32,
|
|
||||||
SDL_PIXELTYPE_ARRAYU8,
|
|
||||||
SDL_PIXELTYPE_ARRAYU16,
|
|
||||||
SDL_PIXELTYPE_ARRAYU32,
|
|
||||||
SDL_PIXELTYPE_ARRAYF16,
|
|
||||||
SDL_PIXELTYPE_ARRAYF32,
|
|
||||||
|
|
||||||
/* This must be at the end of the list to avoid breaking the existing ABI */
|
|
||||||
SDL_PIXELTYPE_INDEX2
|
|
||||||
} SDL_PixelType;
|
|
||||||
|
|
||||||
/** Bitmap pixel order, high bit -> low bit. */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_BITMAPORDER_NONE,
|
|
||||||
SDL_BITMAPORDER_4321,
|
|
||||||
SDL_BITMAPORDER_1234
|
|
||||||
} SDL_BitmapOrder;
|
|
||||||
|
|
||||||
/** Packed component order, high bit -> low bit. */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_PACKEDORDER_NONE,
|
|
||||||
SDL_PACKEDORDER_XRGB,
|
|
||||||
SDL_PACKEDORDER_RGBX,
|
|
||||||
SDL_PACKEDORDER_ARGB,
|
|
||||||
SDL_PACKEDORDER_RGBA,
|
|
||||||
SDL_PACKEDORDER_XBGR,
|
|
||||||
SDL_PACKEDORDER_BGRX,
|
|
||||||
SDL_PACKEDORDER_ABGR,
|
|
||||||
SDL_PACKEDORDER_BGRA
|
|
||||||
} SDL_PackedOrder;
|
|
||||||
|
|
||||||
/** Array component order, low byte -> high byte. */
|
|
||||||
/* !!! FIXME: in 2.1, make these not overlap differently with
|
|
||||||
!!! FIXME: SDL_PACKEDORDER_*, so we can simplify SDL_ISPIXELFORMAT_ALPHA */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_ARRAYORDER_NONE,
|
|
||||||
SDL_ARRAYORDER_RGB,
|
|
||||||
SDL_ARRAYORDER_RGBA,
|
|
||||||
SDL_ARRAYORDER_ARGB,
|
|
||||||
SDL_ARRAYORDER_BGR,
|
|
||||||
SDL_ARRAYORDER_BGRA,
|
|
||||||
SDL_ARRAYORDER_ABGR
|
|
||||||
} SDL_ArrayOrder;
|
|
||||||
|
|
||||||
/** Packed component layout. */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_PACKEDLAYOUT_NONE,
|
|
||||||
SDL_PACKEDLAYOUT_332,
|
|
||||||
SDL_PACKEDLAYOUT_4444,
|
|
||||||
SDL_PACKEDLAYOUT_1555,
|
|
||||||
SDL_PACKEDLAYOUT_5551,
|
|
||||||
SDL_PACKEDLAYOUT_565,
|
|
||||||
SDL_PACKEDLAYOUT_8888,
|
|
||||||
SDL_PACKEDLAYOUT_2101010,
|
|
||||||
SDL_PACKEDLAYOUT_1010102
|
|
||||||
} SDL_PackedLayout;
|
|
||||||
|
|
||||||
#define SDL_DEFINE_PIXELFOURCC(A, B, C, D) SDL_FOURCC(A, B, C, D)
|
|
||||||
|
|
||||||
#define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes) \
|
|
||||||
((1 << 28) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \
|
|
||||||
((bits) << 8) | ((bytes) << 0))
|
|
||||||
|
|
||||||
#define SDL_PIXELFLAG(X) (((X) >> 28) & 0x0F)
|
|
||||||
#define SDL_PIXELTYPE(X) (((X) >> 24) & 0x0F)
|
|
||||||
#define SDL_PIXELORDER(X) (((X) >> 20) & 0x0F)
|
|
||||||
#define SDL_PIXELLAYOUT(X) (((X) >> 16) & 0x0F)
|
|
||||||
#define SDL_BITSPERPIXEL(X) (((X) >> 8) & 0xFF)
|
|
||||||
#define SDL_BYTESPERPIXEL(X) \
|
|
||||||
(SDL_ISPIXELFORMAT_FOURCC(X) ? \
|
|
||||||
((((X) == SDL_PIXELFORMAT_YUY2) || \
|
|
||||||
((X) == SDL_PIXELFORMAT_UYVY) || \
|
|
||||||
((X) == SDL_PIXELFORMAT_YVYU)) ? 2 : 1) : (((X) >> 0) & 0xFF))
|
|
||||||
|
|
||||||
#define SDL_ISPIXELFORMAT_INDEXED(format) \
|
|
||||||
(!SDL_ISPIXELFORMAT_FOURCC(format) && \
|
|
||||||
((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \
|
|
||||||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX2) || \
|
|
||||||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \
|
|
||||||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8)))
|
|
||||||
|
|
||||||
#define SDL_ISPIXELFORMAT_PACKED(format) \
|
|
||||||
(!SDL_ISPIXELFORMAT_FOURCC(format) && \
|
|
||||||
((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED8) || \
|
|
||||||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED16) || \
|
|
||||||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED32)))
|
|
||||||
|
|
||||||
#define SDL_ISPIXELFORMAT_ARRAY(format) \
|
|
||||||
(!SDL_ISPIXELFORMAT_FOURCC(format) && \
|
|
||||||
((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU8) || \
|
|
||||||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU16) || \
|
|
||||||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU32) || \
|
|
||||||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF16) || \
|
|
||||||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF32)))
|
|
||||||
|
|
||||||
#define SDL_ISPIXELFORMAT_ALPHA(format) \
|
|
||||||
((SDL_ISPIXELFORMAT_PACKED(format) && \
|
|
||||||
((SDL_PIXELORDER(format) == SDL_PACKEDORDER_ARGB) || \
|
|
||||||
(SDL_PIXELORDER(format) == SDL_PACKEDORDER_RGBA) || \
|
|
||||||
(SDL_PIXELORDER(format) == SDL_PACKEDORDER_ABGR) || \
|
|
||||||
(SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA))) || \
|
|
||||||
(SDL_ISPIXELFORMAT_ARRAY(format) && \
|
|
||||||
((SDL_PIXELORDER(format) == SDL_ARRAYORDER_ARGB) || \
|
|
||||||
(SDL_PIXELORDER(format) == SDL_ARRAYORDER_RGBA) || \
|
|
||||||
(SDL_PIXELORDER(format) == SDL_ARRAYORDER_ABGR) || \
|
|
||||||
(SDL_PIXELORDER(format) == SDL_ARRAYORDER_BGRA))))
|
|
||||||
|
|
||||||
/* The flag is set to 1 because 0x1? is not in the printable ASCII range */
|
|
||||||
#define SDL_ISPIXELFORMAT_FOURCC(format) \
|
|
||||||
((format) && (SDL_PIXELFLAG(format) != 1))
|
|
||||||
|
|
||||||
/* Note: If you modify this list, update SDL_GetPixelFormatName() */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_PIXELFORMAT_UNKNOWN,
|
|
||||||
SDL_PIXELFORMAT_INDEX1LSB =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_4321, 0,
|
|
||||||
1, 0),
|
|
||||||
SDL_PIXELFORMAT_INDEX1MSB =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_1234, 0,
|
|
||||||
1, 0),
|
|
||||||
SDL_PIXELFORMAT_INDEX2LSB =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX2, SDL_BITMAPORDER_4321, 0,
|
|
||||||
2, 0),
|
|
||||||
SDL_PIXELFORMAT_INDEX2MSB =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX2, SDL_BITMAPORDER_1234, 0,
|
|
||||||
2, 0),
|
|
||||||
SDL_PIXELFORMAT_INDEX4LSB =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321, 0,
|
|
||||||
4, 0),
|
|
||||||
SDL_PIXELFORMAT_INDEX4MSB =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_1234, 0,
|
|
||||||
4, 0),
|
|
||||||
SDL_PIXELFORMAT_INDEX8 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX8, 0, 0, 8, 1),
|
|
||||||
SDL_PIXELFORMAT_RGB332 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED8, SDL_PACKEDORDER_XRGB,
|
|
||||||
SDL_PACKEDLAYOUT_332, 8, 1),
|
|
||||||
SDL_PIXELFORMAT_XRGB4444 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
|
|
||||||
SDL_PACKEDLAYOUT_4444, 12, 2),
|
|
||||||
SDL_PIXELFORMAT_RGB444 = SDL_PIXELFORMAT_XRGB4444,
|
|
||||||
SDL_PIXELFORMAT_XBGR4444 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR,
|
|
||||||
SDL_PACKEDLAYOUT_4444, 12, 2),
|
|
||||||
SDL_PIXELFORMAT_BGR444 = SDL_PIXELFORMAT_XBGR4444,
|
|
||||||
SDL_PIXELFORMAT_XRGB1555 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
|
|
||||||
SDL_PACKEDLAYOUT_1555, 15, 2),
|
|
||||||
SDL_PIXELFORMAT_RGB555 = SDL_PIXELFORMAT_XRGB1555,
|
|
||||||
SDL_PIXELFORMAT_XBGR1555 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR,
|
|
||||||
SDL_PACKEDLAYOUT_1555, 15, 2),
|
|
||||||
SDL_PIXELFORMAT_BGR555 = SDL_PIXELFORMAT_XBGR1555,
|
|
||||||
SDL_PIXELFORMAT_ARGB4444 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB,
|
|
||||||
SDL_PACKEDLAYOUT_4444, 16, 2),
|
|
||||||
SDL_PIXELFORMAT_RGBA4444 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA,
|
|
||||||
SDL_PACKEDLAYOUT_4444, 16, 2),
|
|
||||||
SDL_PIXELFORMAT_ABGR4444 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR,
|
|
||||||
SDL_PACKEDLAYOUT_4444, 16, 2),
|
|
||||||
SDL_PIXELFORMAT_BGRA4444 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA,
|
|
||||||
SDL_PACKEDLAYOUT_4444, 16, 2),
|
|
||||||
SDL_PIXELFORMAT_ARGB1555 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB,
|
|
||||||
SDL_PACKEDLAYOUT_1555, 16, 2),
|
|
||||||
SDL_PIXELFORMAT_RGBA5551 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA,
|
|
||||||
SDL_PACKEDLAYOUT_5551, 16, 2),
|
|
||||||
SDL_PIXELFORMAT_ABGR1555 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR,
|
|
||||||
SDL_PACKEDLAYOUT_1555, 16, 2),
|
|
||||||
SDL_PIXELFORMAT_BGRA5551 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA,
|
|
||||||
SDL_PACKEDLAYOUT_5551, 16, 2),
|
|
||||||
SDL_PIXELFORMAT_RGB565 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
|
|
||||||
SDL_PACKEDLAYOUT_565, 16, 2),
|
|
||||||
SDL_PIXELFORMAT_BGR565 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR,
|
|
||||||
SDL_PACKEDLAYOUT_565, 16, 2),
|
|
||||||
SDL_PIXELFORMAT_RGB24 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_RGB, 0,
|
|
||||||
24, 3),
|
|
||||||
SDL_PIXELFORMAT_BGR24 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_BGR, 0,
|
|
||||||
24, 3),
|
|
||||||
SDL_PIXELFORMAT_XRGB8888 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB,
|
|
||||||
SDL_PACKEDLAYOUT_8888, 24, 4),
|
|
||||||
SDL_PIXELFORMAT_RGB888 = SDL_PIXELFORMAT_XRGB8888,
|
|
||||||
SDL_PIXELFORMAT_RGBX8888 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBX,
|
|
||||||
SDL_PACKEDLAYOUT_8888, 24, 4),
|
|
||||||
SDL_PIXELFORMAT_XBGR8888 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR,
|
|
||||||
SDL_PACKEDLAYOUT_8888, 24, 4),
|
|
||||||
SDL_PIXELFORMAT_BGR888 = SDL_PIXELFORMAT_XBGR8888,
|
|
||||||
SDL_PIXELFORMAT_BGRX8888 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRX,
|
|
||||||
SDL_PACKEDLAYOUT_8888, 24, 4),
|
|
||||||
SDL_PIXELFORMAT_ARGB8888 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB,
|
|
||||||
SDL_PACKEDLAYOUT_8888, 32, 4),
|
|
||||||
SDL_PIXELFORMAT_RGBA8888 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBA,
|
|
||||||
SDL_PACKEDLAYOUT_8888, 32, 4),
|
|
||||||
SDL_PIXELFORMAT_ABGR8888 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR,
|
|
||||||
SDL_PACKEDLAYOUT_8888, 32, 4),
|
|
||||||
SDL_PIXELFORMAT_BGRA8888 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRA,
|
|
||||||
SDL_PACKEDLAYOUT_8888, 32, 4),
|
|
||||||
SDL_PIXELFORMAT_ARGB2101010 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB,
|
|
||||||
SDL_PACKEDLAYOUT_2101010, 32, 4),
|
|
||||||
|
|
||||||
/* Aliases for RGBA byte arrays of color data, for the current platform */
|
|
||||||
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
|
|
||||||
SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_RGBA8888,
|
|
||||||
SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_ARGB8888,
|
|
||||||
SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_BGRA8888,
|
|
||||||
SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_ABGR8888,
|
|
||||||
SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_RGBX8888,
|
|
||||||
SDL_PIXELFORMAT_XRGB32 = SDL_PIXELFORMAT_XRGB8888,
|
|
||||||
SDL_PIXELFORMAT_BGRX32 = SDL_PIXELFORMAT_BGRX8888,
|
|
||||||
SDL_PIXELFORMAT_XBGR32 = SDL_PIXELFORMAT_XBGR8888,
|
|
||||||
#else
|
|
||||||
SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_ABGR8888,
|
|
||||||
SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_BGRA8888,
|
|
||||||
SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_ARGB8888,
|
|
||||||
SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_RGBA8888,
|
|
||||||
SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_XBGR8888,
|
|
||||||
SDL_PIXELFORMAT_XRGB32 = SDL_PIXELFORMAT_BGRX8888,
|
|
||||||
SDL_PIXELFORMAT_BGRX32 = SDL_PIXELFORMAT_XRGB8888,
|
|
||||||
SDL_PIXELFORMAT_XBGR32 = SDL_PIXELFORMAT_RGBX8888,
|
|
||||||
#endif
|
|
||||||
|
|
||||||
SDL_PIXELFORMAT_YV12 = /**< Planar mode: Y + V + U (3 planes) */
|
|
||||||
SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2'),
|
|
||||||
SDL_PIXELFORMAT_IYUV = /**< Planar mode: Y + U + V (3 planes) */
|
|
||||||
SDL_DEFINE_PIXELFOURCC('I', 'Y', 'U', 'V'),
|
|
||||||
SDL_PIXELFORMAT_YUY2 = /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */
|
|
||||||
SDL_DEFINE_PIXELFOURCC('Y', 'U', 'Y', '2'),
|
|
||||||
SDL_PIXELFORMAT_UYVY = /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */
|
|
||||||
SDL_DEFINE_PIXELFOURCC('U', 'Y', 'V', 'Y'),
|
|
||||||
SDL_PIXELFORMAT_YVYU = /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */
|
|
||||||
SDL_DEFINE_PIXELFOURCC('Y', 'V', 'Y', 'U'),
|
|
||||||
SDL_PIXELFORMAT_NV12 = /**< Planar mode: Y + U/V interleaved (2 planes) */
|
|
||||||
SDL_DEFINE_PIXELFOURCC('N', 'V', '1', '2'),
|
|
||||||
SDL_PIXELFORMAT_NV21 = /**< Planar mode: Y + V/U interleaved (2 planes) */
|
|
||||||
SDL_DEFINE_PIXELFOURCC('N', 'V', '2', '1'),
|
|
||||||
SDL_PIXELFORMAT_EXTERNAL_OES = /**< Android video texture format */
|
|
||||||
SDL_DEFINE_PIXELFOURCC('O', 'E', 'S', ' ')
|
|
||||||
} SDL_PixelFormatEnum;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The bits of this structure can be directly reinterpreted as an
|
|
||||||
* integer-packed color which uses the SDL_PIXELFORMAT_RGBA32 format
|
|
||||||
* (SDL_PIXELFORMAT_ABGR8888 on little-endian systems and
|
|
||||||
* SDL_PIXELFORMAT_RGBA8888 on big-endian systems).
|
|
||||||
*/
|
|
||||||
typedef struct SDL_Color
|
|
||||||
{
|
|
||||||
Uint8 r;
|
|
||||||
Uint8 g;
|
|
||||||
Uint8 b;
|
|
||||||
Uint8 a;
|
|
||||||
} SDL_Color;
|
|
||||||
#define SDL_Colour SDL_Color
|
|
||||||
|
|
||||||
typedef struct SDL_Palette
|
|
||||||
{
|
|
||||||
int ncolors;
|
|
||||||
SDL_Color *colors;
|
|
||||||
Uint32 version;
|
|
||||||
int refcount;
|
|
||||||
} SDL_Palette;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A structure that contains pixel format information.
|
|
||||||
*
|
|
||||||
* Everything in the pixel format structure is read-only.
|
|
||||||
*
|
|
||||||
* A pixel format has either a palette or masks. If a palette is used `Rmask`,
|
|
||||||
* `Gmask`, `Bmask`, and `Amask` will be 0.
|
|
||||||
*
|
|
||||||
* An SDL_PixelFormat describes the format of the pixel data stored at the
|
|
||||||
* `pixels` field of an SDL_Surface. Every surface stores an SDL_PixelFormat
|
|
||||||
* in the `format` field.
|
|
||||||
*
|
|
||||||
* If you wish to do pixel level modifications on a surface, then
|
|
||||||
* understanding how SDL stores its color information is essential.
|
|
||||||
*
|
|
||||||
* For information on modern pixel color spaces, see the following Wikipedia
|
|
||||||
* article: http://en.wikipedia.org/wiki/RGBA_color_space
|
|
||||||
*
|
|
||||||
* \sa SDL_ConvertSurface
|
|
||||||
* \sa SDL_GetRGB
|
|
||||||
* \sa SDL_GetRGBA
|
|
||||||
* \sa SDL_MapRGB
|
|
||||||
* \sa SDL_MapRGBA
|
|
||||||
* \sa SDL_AllocFormat
|
|
||||||
* \sa SDL_FreeFormat
|
|
||||||
*/
|
|
||||||
typedef struct SDL_PixelFormat
|
|
||||||
{
|
|
||||||
Uint32 format;
|
|
||||||
SDL_Palette *palette;
|
|
||||||
Uint8 BitsPerPixel;
|
|
||||||
Uint8 BytesPerPixel;
|
|
||||||
Uint8 padding[2];
|
|
||||||
Uint32 Rmask;
|
|
||||||
Uint32 Gmask;
|
|
||||||
Uint32 Bmask;
|
|
||||||
Uint32 Amask;
|
|
||||||
Uint8 Rloss;
|
|
||||||
Uint8 Gloss;
|
|
||||||
Uint8 Bloss;
|
|
||||||
Uint8 Aloss;
|
|
||||||
Uint8 Rshift;
|
|
||||||
Uint8 Gshift;
|
|
||||||
Uint8 Bshift;
|
|
||||||
Uint8 Ashift;
|
|
||||||
int refcount;
|
|
||||||
struct SDL_PixelFormat *next;
|
|
||||||
} SDL_PixelFormat;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the human readable name of a pixel format.
|
|
||||||
*
|
|
||||||
* \param format the pixel format to query.
|
|
||||||
* \returns the human readable name of the specified pixel format or
|
|
||||||
* `SDL_PIXELFORMAT_UNKNOWN` if the format isn't recognized.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(Uint32 format);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Convert one of the enumerated pixel formats to a bpp value and RGBA masks.
|
|
||||||
*
|
|
||||||
* \param format one of the SDL_PixelFormatEnum values.
|
|
||||||
* \param bpp a bits per pixel value; usually 15, 16, or 32.
|
|
||||||
* \param Rmask a pointer filled in with the red mask for the format.
|
|
||||||
* \param Gmask a pointer filled in with the green mask for the format.
|
|
||||||
* \param Bmask a pointer filled in with the blue mask for the format.
|
|
||||||
* \param Amask a pointer filled in with the alpha mask for the format.
|
|
||||||
* \returns SDL_TRUE on success or SDL_FALSE if the conversion wasn't
|
|
||||||
* possible; call SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_MasksToPixelFormatEnum
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format,
|
|
||||||
int *bpp,
|
|
||||||
Uint32 * Rmask,
|
|
||||||
Uint32 * Gmask,
|
|
||||||
Uint32 * Bmask,
|
|
||||||
Uint32 * Amask);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Convert a bpp value and RGBA masks to an enumerated pixel format.
|
|
||||||
*
|
|
||||||
* This will return `SDL_PIXELFORMAT_UNKNOWN` if the conversion wasn't
|
|
||||||
* possible.
|
|
||||||
*
|
|
||||||
* \param bpp a bits per pixel value; usually 15, 16, or 32.
|
|
||||||
* \param Rmask the red mask for the format.
|
|
||||||
* \param Gmask the green mask for the format.
|
|
||||||
* \param Bmask the blue mask for the format.
|
|
||||||
* \param Amask the alpha mask for the format.
|
|
||||||
* \returns one of the SDL_PixelFormatEnum values.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_PixelFormatEnumToMasks
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp,
|
|
||||||
Uint32 Rmask,
|
|
||||||
Uint32 Gmask,
|
|
||||||
Uint32 Bmask,
|
|
||||||
Uint32 Amask);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create an SDL_PixelFormat structure corresponding to a pixel format.
|
|
||||||
*
|
|
||||||
* Returned structure may come from a shared global cache (i.e. not newly
|
|
||||||
* allocated), and hence should not be modified, especially the palette. Weird
|
|
||||||
* errors such as `Blit combination not supported` may occur.
|
|
||||||
*
|
|
||||||
* \param pixel_format one of the SDL_PixelFormatEnum values.
|
|
||||||
* \returns the new SDL_PixelFormat structure or NULL on failure; call
|
|
||||||
* SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_FreeFormat
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_AllocFormat(Uint32 pixel_format);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Free an SDL_PixelFormat structure allocated by SDL_AllocFormat().
|
|
||||||
*
|
|
||||||
* \param format the SDL_PixelFormat structure to free.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_AllocFormat
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_FreeFormat(SDL_PixelFormat *format);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a palette structure with the specified number of color entries.
|
|
||||||
*
|
|
||||||
* The palette entries are initialized to white.
|
|
||||||
*
|
|
||||||
* \param ncolors represents the number of color entries in the color palette.
|
|
||||||
* \returns a new SDL_Palette structure on success or NULL on failure (e.g. if
|
|
||||||
* there wasn't enough memory); call SDL_GetError() for more
|
|
||||||
* information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_FreePalette
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Palette *SDLCALL SDL_AllocPalette(int ncolors);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the palette for a pixel format structure.
|
|
||||||
*
|
|
||||||
* \param format the SDL_PixelFormat structure that will use the palette.
|
|
||||||
* \param palette the SDL_Palette structure that will be used.
|
|
||||||
* \returns 0 on success or a negative error code on failure; call
|
|
||||||
* SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_AllocPalette
|
|
||||||
* \sa SDL_FreePalette
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat * format,
|
|
||||||
SDL_Palette *palette);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set a range of colors in a palette.
|
|
||||||
*
|
|
||||||
* \param palette the SDL_Palette structure to modify.
|
|
||||||
* \param colors an array of SDL_Color structures to copy into the palette.
|
|
||||||
* \param firstcolor the index of the first palette entry to modify.
|
|
||||||
* \param ncolors the number of entries to modify.
|
|
||||||
* \returns 0 on success or a negative error code if not all of the colors
|
|
||||||
* could be set; call SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_AllocPalette
|
|
||||||
* \sa SDL_CreateRGBSurface
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette,
|
|
||||||
const SDL_Color * colors,
|
|
||||||
int firstcolor, int ncolors);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Free a palette created with SDL_AllocPalette().
|
|
||||||
*
|
|
||||||
* \param palette the SDL_Palette structure to be freed.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_AllocPalette
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_FreePalette(SDL_Palette * palette);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Map an RGB triple to an opaque pixel value for a given pixel format.
|
|
||||||
*
|
|
||||||
* This function maps the RGB color value to the specified pixel format and
|
|
||||||
* returns the pixel value best approximating the given RGB color value for
|
|
||||||
* the given pixel format.
|
|
||||||
*
|
|
||||||
* If the format has a palette (8-bit) the index of the closest matching color
|
|
||||||
* in the palette will be returned.
|
|
||||||
*
|
|
||||||
* If the specified pixel format has an alpha component it will be returned as
|
|
||||||
* all 1 bits (fully opaque).
|
|
||||||
*
|
|
||||||
* If the pixel format bpp (color depth) is less than 32-bpp then the unused
|
|
||||||
* upper bits of the return value can safely be ignored (e.g., with a 16-bpp
|
|
||||||
* format the return value can be assigned to a Uint16, and similarly a Uint8
|
|
||||||
* for an 8-bpp format).
|
|
||||||
*
|
|
||||||
* \param format an SDL_PixelFormat structure describing the pixel format.
|
|
||||||
* \param r the red component of the pixel in the range 0-255.
|
|
||||||
* \param g the green component of the pixel in the range 0-255.
|
|
||||||
* \param b the blue component of the pixel in the range 0-255.
|
|
||||||
* \returns a pixel value.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetRGB
|
|
||||||
* \sa SDL_GetRGBA
|
|
||||||
* \sa SDL_MapRGBA
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format,
|
|
||||||
Uint8 r, Uint8 g, Uint8 b);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Map an RGBA quadruple to a pixel value for a given pixel format.
|
|
||||||
*
|
|
||||||
* This function maps the RGBA color value to the specified pixel format and
|
|
||||||
* returns the pixel value best approximating the given RGBA color value for
|
|
||||||
* the given pixel format.
|
|
||||||
*
|
|
||||||
* If the specified pixel format has no alpha component the alpha value will
|
|
||||||
* be ignored (as it will be in formats with a palette).
|
|
||||||
*
|
|
||||||
* If the format has a palette (8-bit) the index of the closest matching color
|
|
||||||
* in the palette will be returned.
|
|
||||||
*
|
|
||||||
* If the pixel format bpp (color depth) is less than 32-bpp then the unused
|
|
||||||
* upper bits of the return value can safely be ignored (e.g., with a 16-bpp
|
|
||||||
* format the return value can be assigned to a Uint16, and similarly a Uint8
|
|
||||||
* for an 8-bpp format).
|
|
||||||
*
|
|
||||||
* \param format an SDL_PixelFormat structure describing the format of the
|
|
||||||
* pixel.
|
|
||||||
* \param r the red component of the pixel in the range 0-255.
|
|
||||||
* \param g the green component of the pixel in the range 0-255.
|
|
||||||
* \param b the blue component of the pixel in the range 0-255.
|
|
||||||
* \param a the alpha component of the pixel in the range 0-255.
|
|
||||||
* \returns a pixel value.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetRGB
|
|
||||||
* \sa SDL_GetRGBA
|
|
||||||
* \sa SDL_MapRGB
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format,
|
|
||||||
Uint8 r, Uint8 g, Uint8 b,
|
|
||||||
Uint8 a);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get RGB values from a pixel in the specified format.
|
|
||||||
*
|
|
||||||
* This function uses the entire 8-bit [0..255] range when converting color
|
|
||||||
* components from pixel formats with less than 8-bits per RGB component
|
|
||||||
* (e.g., a completely white pixel in 16-bit RGB565 format would return [0xff,
|
|
||||||
* 0xff, 0xff] not [0xf8, 0xfc, 0xf8]).
|
|
||||||
*
|
|
||||||
* \param pixel a pixel value.
|
|
||||||
* \param format an SDL_PixelFormat structure describing the format of the
|
|
||||||
* pixel.
|
|
||||||
* \param r a pointer filled in with the red component.
|
|
||||||
* \param g a pointer filled in with the green component.
|
|
||||||
* \param b a pointer filled in with the blue component.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetRGBA
|
|
||||||
* \sa SDL_MapRGB
|
|
||||||
* \sa SDL_MapRGBA
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel,
|
|
||||||
const SDL_PixelFormat * format,
|
|
||||||
Uint8 * r, Uint8 * g, Uint8 * b);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get RGBA values from a pixel in the specified format.
|
|
||||||
*
|
|
||||||
* This function uses the entire 8-bit [0..255] range when converting color
|
|
||||||
* components from pixel formats with less than 8-bits per RGB component
|
|
||||||
* (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
|
|
||||||
* (100% opaque).
|
|
||||||
*
|
|
||||||
* \param pixel a pixel value.
|
|
||||||
* \param format an SDL_PixelFormat structure describing the format of the
|
|
||||||
* pixel.
|
|
||||||
* \param r a pointer filled in with the red component.
|
|
||||||
* \param g a pointer filled in with the green component.
|
|
||||||
* \param b a pointer filled in with the blue component.
|
|
||||||
* \param a a pointer filled in with the alpha component.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetRGB
|
|
||||||
* \sa SDL_MapRGB
|
|
||||||
* \sa SDL_MapRGBA
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel,
|
|
||||||
const SDL_PixelFormat * format,
|
|
||||||
Uint8 * r, Uint8 * g, Uint8 * b,
|
|
||||||
Uint8 * a);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Calculate a 256 entry gamma ramp for a gamma value.
|
|
||||||
*
|
|
||||||
* \param gamma a gamma value where 0.0 is black and 1.0 is identity.
|
|
||||||
* \param ramp an array of 256 values filled in with the gamma ramp.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_SetWindowGammaRamp
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_CalculateGammaRamp(float gamma, Uint16 * ramp);
|
|
||||||
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include <SDL2/close_code.h>
|
|
||||||
|
|
||||||
#endif /* SDL_pixels_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
||||||
@@ -1,275 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2025 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* # CategoryPlatform
|
|
||||||
*
|
|
||||||
* Try to get a standard set of platform defines.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_platform_h_
|
|
||||||
#define SDL_platform_h_
|
|
||||||
|
|
||||||
#if defined(_AIX)
|
|
||||||
#undef __AIX__
|
|
||||||
#define __AIX__ 1
|
|
||||||
#endif
|
|
||||||
#if defined(__HAIKU__)
|
|
||||||
#undef __HAIKU__
|
|
||||||
#define __HAIKU__ 1
|
|
||||||
#endif
|
|
||||||
#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__)
|
|
||||||
#undef __BSDI__
|
|
||||||
#define __BSDI__ 1
|
|
||||||
#endif
|
|
||||||
#if defined(_arch_dreamcast)
|
|
||||||
#undef __DREAMCAST__
|
|
||||||
#define __DREAMCAST__ 1
|
|
||||||
#endif
|
|
||||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
|
|
||||||
#undef __FREEBSD__
|
|
||||||
#define __FREEBSD__ 1
|
|
||||||
#endif
|
|
||||||
#if defined(hpux) || defined(__hpux) || defined(__hpux__)
|
|
||||||
#undef __HPUX__
|
|
||||||
#define __HPUX__ 1
|
|
||||||
#endif
|
|
||||||
#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE)
|
|
||||||
#undef __IRIX__
|
|
||||||
#define __IRIX__ 1
|
|
||||||
#endif
|
|
||||||
#if (defined(linux) || defined(__linux) || defined(__linux__))
|
|
||||||
#undef __LINUX__
|
|
||||||
#define __LINUX__ 1
|
|
||||||
#endif
|
|
||||||
#if defined(ANDROID) || defined(__ANDROID__)
|
|
||||||
#undef __ANDROID__
|
|
||||||
#undef __LINUX__ /* do we need to do this? */
|
|
||||||
#define __ANDROID__ 1
|
|
||||||
#endif
|
|
||||||
#if defined(__NGAGE__)
|
|
||||||
#undef __NGAGE__
|
|
||||||
#define __NGAGE__ 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__APPLE__)
|
|
||||||
/* lets us know what version of Mac OS X we're compiling on */
|
|
||||||
#include <AvailabilityMacros.h>
|
|
||||||
#ifndef __has_extension /* Older compilers don't support this */
|
|
||||||
#define __has_extension(x) 0
|
|
||||||
#include <TargetConditionals.h>
|
|
||||||
#undef __has_extension
|
|
||||||
#else
|
|
||||||
#include <TargetConditionals.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Fix building with older SDKs that don't define these
|
|
||||||
See this for more information:
|
|
||||||
https://stackoverflow.com/questions/12132933/preprocessor-macro-for-os-x-targets
|
|
||||||
*/
|
|
||||||
#ifndef TARGET_OS_MACCATALYST
|
|
||||||
#define TARGET_OS_MACCATALYST 0
|
|
||||||
#endif
|
|
||||||
#ifndef TARGET_OS_IOS
|
|
||||||
#define TARGET_OS_IOS 0
|
|
||||||
#endif
|
|
||||||
#ifndef TARGET_OS_IPHONE
|
|
||||||
#define TARGET_OS_IPHONE 0
|
|
||||||
#endif
|
|
||||||
#ifndef TARGET_OS_TV
|
|
||||||
#define TARGET_OS_TV 0
|
|
||||||
#endif
|
|
||||||
#ifndef TARGET_OS_SIMULATOR
|
|
||||||
#define TARGET_OS_SIMULATOR 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if TARGET_OS_TV
|
|
||||||
#undef __TVOS__
|
|
||||||
#define __TVOS__ 1
|
|
||||||
#endif
|
|
||||||
#if TARGET_OS_IPHONE
|
|
||||||
/* if compiling for iOS */
|
|
||||||
#undef __IPHONEOS__
|
|
||||||
#define __IPHONEOS__ 1
|
|
||||||
#undef __MACOSX__
|
|
||||||
#else
|
|
||||||
/* if not compiling for iOS */
|
|
||||||
#undef __MACOSX__
|
|
||||||
#define __MACOSX__ 1
|
|
||||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
|
|
||||||
# error SDL for Mac OS X only supports deploying on 10.7 and above.
|
|
||||||
#endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1070 */
|
|
||||||
#endif /* TARGET_OS_IPHONE */
|
|
||||||
#endif /* defined(__APPLE__) */
|
|
||||||
|
|
||||||
#if defined(__NetBSD__)
|
|
||||||
#undef __NETBSD__
|
|
||||||
#define __NETBSD__ 1
|
|
||||||
#endif
|
|
||||||
#if defined(__OpenBSD__)
|
|
||||||
#undef __OPENBSD__
|
|
||||||
#define __OPENBSD__ 1
|
|
||||||
#endif
|
|
||||||
#if defined(__OS2__) || defined(__EMX__)
|
|
||||||
#undef __OS2__
|
|
||||||
#define __OS2__ 1
|
|
||||||
#endif
|
|
||||||
#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE)
|
|
||||||
#undef __OSF__
|
|
||||||
#define __OSF__ 1
|
|
||||||
#endif
|
|
||||||
#if defined(__QNXNTO__)
|
|
||||||
#undef __QNXNTO__
|
|
||||||
#define __QNXNTO__ 1
|
|
||||||
#endif
|
|
||||||
#if defined(riscos) || defined(__riscos) || defined(__riscos__)
|
|
||||||
#undef __RISCOS__
|
|
||||||
#define __RISCOS__ 1
|
|
||||||
#endif
|
|
||||||
#if defined(__sun) && defined(__SVR4)
|
|
||||||
#undef __SOLARIS__
|
|
||||||
#define __SOLARIS__ 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
|
|
||||||
/* Try to find out if we're compiling for WinRT, GDK or non-WinRT/GDK */
|
|
||||||
#if defined(_MSC_VER) && defined(__has_include)
|
|
||||||
#if __has_include(<winapifamily.h>)
|
|
||||||
#define HAVE_WINAPIFAMILY_H 1
|
|
||||||
#else
|
|
||||||
#define HAVE_WINAPIFAMILY_H 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* If _USING_V110_SDK71_ is defined it means we are using the Windows XP toolset. */
|
|
||||||
#elif defined(_MSC_VER) && (_MSC_VER >= 1700 && !_USING_V110_SDK71_) /* _MSC_VER == 1700 for Visual Studio 2012 */
|
|
||||||
#define HAVE_WINAPIFAMILY_H 1
|
|
||||||
#else
|
|
||||||
#define HAVE_WINAPIFAMILY_H 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if HAVE_WINAPIFAMILY_H
|
|
||||||
#include <winapifamily.h>
|
|
||||||
#define WINAPI_FAMILY_WINRT (!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP))
|
|
||||||
#else
|
|
||||||
#define WINAPI_FAMILY_WINRT 0
|
|
||||||
#endif /* HAVE_WINAPIFAMILY_H */
|
|
||||||
|
|
||||||
#if (HAVE_WINAPIFAMILY_H) && defined(WINAPI_FAMILY_PHONE_APP)
|
|
||||||
#define SDL_WINAPI_FAMILY_PHONE (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
|
|
||||||
#else
|
|
||||||
#define SDL_WINAPI_FAMILY_PHONE 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if WINAPI_FAMILY_WINRT
|
|
||||||
#undef __WINRT__
|
|
||||||
#define __WINRT__ 1
|
|
||||||
#elif defined(_GAMING_DESKTOP) /* GDK project configuration always defines _GAMING_XXX */
|
|
||||||
#undef __WINGDK__
|
|
||||||
#define __WINGDK__ 1
|
|
||||||
#elif defined(_GAMING_XBOX_XBOXONE)
|
|
||||||
#undef __XBOXONE__
|
|
||||||
#define __XBOXONE__ 1
|
|
||||||
#elif defined(_GAMING_XBOX_SCARLETT)
|
|
||||||
#undef __XBOXSERIES__
|
|
||||||
#define __XBOXSERIES__ 1
|
|
||||||
#else
|
|
||||||
#undef __WINDOWS__
|
|
||||||
#define __WINDOWS__ 1
|
|
||||||
#endif
|
|
||||||
#endif /* defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) */
|
|
||||||
|
|
||||||
#if defined(__WINDOWS__)
|
|
||||||
#undef __WIN32__
|
|
||||||
#define __WIN32__ 1
|
|
||||||
#endif
|
|
||||||
/* This is to support generic "any GDK" separate from a platform-specific GDK */
|
|
||||||
#if defined(__WINGDK__) || defined(__XBOXONE__) || defined(__XBOXSERIES__)
|
|
||||||
#undef __GDK__
|
|
||||||
#define __GDK__ 1
|
|
||||||
#endif
|
|
||||||
#if defined(__PSP__) || defined(__psp__)
|
|
||||||
#ifdef __PSP__
|
|
||||||
#undef __PSP__
|
|
||||||
#endif
|
|
||||||
#define __PSP__ 1
|
|
||||||
#endif
|
|
||||||
#if defined(PS2)
|
|
||||||
#define __PS2__ 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* The NACL compiler defines __native_client__ and __pnacl__
|
|
||||||
* Ref: http://www.chromium.org/nativeclient/pnacl/stability-of-the-pnacl-bitcode-abi
|
|
||||||
*/
|
|
||||||
#if defined(__native_client__)
|
|
||||||
#undef __LINUX__
|
|
||||||
#undef __NACL__
|
|
||||||
#define __NACL__ 1
|
|
||||||
#endif
|
|
||||||
#if defined(__pnacl__)
|
|
||||||
#undef __LINUX__
|
|
||||||
#undef __PNACL__
|
|
||||||
#define __PNACL__ 1
|
|
||||||
/* PNACL with newlib supports static linking only */
|
|
||||||
#define __SDL_NOGETPROCADDR__
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__vita__)
|
|
||||||
#define __VITA__ 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__3DS__)
|
|
||||||
#undef __3DS__
|
|
||||||
#define __3DS__ 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <SDL2/begin_code.h>
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the name of the platform.
|
|
||||||
*
|
|
||||||
* Here are the names returned for some (but not all) supported platforms:
|
|
||||||
*
|
|
||||||
* - "Windows"
|
|
||||||
* - "Mac OS X"
|
|
||||||
* - "Linux"
|
|
||||||
* - "iOS"
|
|
||||||
* - "Android"
|
|
||||||
*
|
|
||||||
* \returns the name of the platform. If the correct platform name is not
|
|
||||||
* available, returns a string beginning with the text "Unknown".
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void);
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include <SDL2/close_code.h>
|
|
||||||
|
|
||||||
#endif /* SDL_platform_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2025 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* # CategoryQuit
|
|
||||||
*
|
|
||||||
* An SDL_QUIT event is generated when the user tries to close the application
|
|
||||||
* window. If it is ignored or filtered out, the window will remain open. If
|
|
||||||
* it is not ignored or filtered, it is queued normally and the window is
|
|
||||||
* allowed to close. When the window is closed, screen updates will complete,
|
|
||||||
* but have no effect.
|
|
||||||
*
|
|
||||||
* SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) and
|
|
||||||
* SIGTERM (system termination request), if handlers do not already exist,
|
|
||||||
* that generate SDL_QUIT events as well. There is no way to determine the
|
|
||||||
* cause of an SDL_QUIT event, but setting a signal handler in your
|
|
||||||
* application will override the default generation of quit events for that
|
|
||||||
* signal.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_quit_h_
|
|
||||||
#define SDL_quit_h_
|
|
||||||
|
|
||||||
#include <SDL2/SDL_stdinc.h>
|
|
||||||
#include <SDL2/SDL_error.h>
|
|
||||||
|
|
||||||
/* There are no functions directly affecting the quit event */
|
|
||||||
|
|
||||||
#define SDL_QuitRequested() \
|
|
||||||
(SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0))
|
|
||||||
|
|
||||||
#endif /* SDL_quit_h_ */
|
|
||||||
@@ -1,376 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2025 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* # CategoryRect
|
|
||||||
*
|
|
||||||
* Header file for SDL_rect definition and management functions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_rect_h_
|
|
||||||
#define SDL_rect_h_
|
|
||||||
|
|
||||||
#include <SDL2/SDL_stdinc.h>
|
|
||||||
#include <SDL2/SDL_error.h>
|
|
||||||
#include <SDL2/SDL_pixels.h>
|
|
||||||
#include <SDL2/SDL_rwops.h>
|
|
||||||
|
|
||||||
#include <SDL2/begin_code.h>
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The structure that defines a point (integer)
|
|
||||||
*
|
|
||||||
* \sa SDL_EnclosePoints
|
|
||||||
* \sa SDL_PointInRect
|
|
||||||
*/
|
|
||||||
typedef struct SDL_Point
|
|
||||||
{
|
|
||||||
int x;
|
|
||||||
int y;
|
|
||||||
} SDL_Point;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The structure that defines a point (floating point)
|
|
||||||
*
|
|
||||||
* \sa SDL_EncloseFPoints
|
|
||||||
* \sa SDL_PointInFRect
|
|
||||||
*/
|
|
||||||
typedef struct SDL_FPoint
|
|
||||||
{
|
|
||||||
float x;
|
|
||||||
float y;
|
|
||||||
} SDL_FPoint;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A rectangle, with the origin at the upper left (integer).
|
|
||||||
*
|
|
||||||
* \sa SDL_RectEmpty
|
|
||||||
* \sa SDL_RectEquals
|
|
||||||
* \sa SDL_HasIntersection
|
|
||||||
* \sa SDL_IntersectRect
|
|
||||||
* \sa SDL_IntersectRectAndLine
|
|
||||||
* \sa SDL_UnionRect
|
|
||||||
* \sa SDL_EnclosePoints
|
|
||||||
*/
|
|
||||||
typedef struct SDL_Rect
|
|
||||||
{
|
|
||||||
int x, y;
|
|
||||||
int w, h;
|
|
||||||
} SDL_Rect;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A rectangle, with the origin at the upper left (floating point).
|
|
||||||
*
|
|
||||||
* \sa SDL_FRectEmpty
|
|
||||||
* \sa SDL_FRectEquals
|
|
||||||
* \sa SDL_FRectEqualsEpsilon
|
|
||||||
* \sa SDL_HasIntersectionF
|
|
||||||
* \sa SDL_IntersectFRect
|
|
||||||
* \sa SDL_IntersectFRectAndLine
|
|
||||||
* \sa SDL_UnionFRect
|
|
||||||
* \sa SDL_EncloseFPoints
|
|
||||||
* \sa SDL_PointInFRect
|
|
||||||
*/
|
|
||||||
typedef struct SDL_FRect
|
|
||||||
{
|
|
||||||
float x;
|
|
||||||
float y;
|
|
||||||
float w;
|
|
||||||
float h;
|
|
||||||
} SDL_FRect;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if point resides inside a rectangle.
|
|
||||||
*/
|
|
||||||
SDL_FORCE_INLINE SDL_bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r)
|
|
||||||
{
|
|
||||||
return ( (p->x >= r->x) && (p->x < (r->x + r->w)) &&
|
|
||||||
(p->y >= r->y) && (p->y < (r->y + r->h)) ) ? SDL_TRUE : SDL_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the rectangle has no area.
|
|
||||||
*/
|
|
||||||
SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r)
|
|
||||||
{
|
|
||||||
return ((!r) || (r->w <= 0) || (r->h <= 0)) ? SDL_TRUE : SDL_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the two rectangles are equal.
|
|
||||||
*/
|
|
||||||
SDL_FORCE_INLINE SDL_bool SDL_RectEquals(const SDL_Rect *a, const SDL_Rect *b)
|
|
||||||
{
|
|
||||||
return (a && b && (a->x == b->x) && (a->y == b->y) &&
|
|
||||||
(a->w == b->w) && (a->h == b->h)) ? SDL_TRUE : SDL_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine whether two rectangles intersect.
|
|
||||||
*
|
|
||||||
* If either pointer is NULL the function will return SDL_FALSE.
|
|
||||||
*
|
|
||||||
* \param A an SDL_Rect structure representing the first rectangle.
|
|
||||||
* \param B an SDL_Rect structure representing the second rectangle.
|
|
||||||
* \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_IntersectRect
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersection(const SDL_Rect * A,
|
|
||||||
const SDL_Rect * B);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Calculate the intersection of two rectangles.
|
|
||||||
*
|
|
||||||
* If `result` is NULL then this function will return SDL_FALSE.
|
|
||||||
*
|
|
||||||
* \param A an SDL_Rect structure representing the first rectangle.
|
|
||||||
* \param B an SDL_Rect structure representing the second rectangle.
|
|
||||||
* \param result an SDL_Rect structure filled in with the intersection of
|
|
||||||
* rectangles `A` and `B`.
|
|
||||||
* \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_HasIntersection
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect * A,
|
|
||||||
const SDL_Rect * B,
|
|
||||||
SDL_Rect * result);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Calculate the union of two rectangles.
|
|
||||||
*
|
|
||||||
* \param A an SDL_Rect structure representing the first rectangle.
|
|
||||||
* \param B an SDL_Rect structure representing the second rectangle.
|
|
||||||
* \param result an SDL_Rect structure filled in with the union of rectangles
|
|
||||||
* `A` and `B`.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_UnionRect(const SDL_Rect * A,
|
|
||||||
const SDL_Rect * B,
|
|
||||||
SDL_Rect * result);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Calculate a minimal rectangle enclosing a set of points.
|
|
||||||
*
|
|
||||||
* If `clip` is not NULL then only points inside of the clipping rectangle are
|
|
||||||
* considered.
|
|
||||||
*
|
|
||||||
* \param points an array of SDL_Point structures representing points to be
|
|
||||||
* enclosed.
|
|
||||||
* \param count the number of structures in the `points` array.
|
|
||||||
* \param clip an SDL_Rect used for clipping or NULL to enclose all points.
|
|
||||||
* \param result an SDL_Rect structure filled in with the minimal enclosing
|
|
||||||
* rectangle.
|
|
||||||
* \returns SDL_TRUE if any points were enclosed or SDL_FALSE if all the
|
|
||||||
* points were outside of the clipping rectangle.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_EnclosePoints(const SDL_Point * points,
|
|
||||||
int count,
|
|
||||||
const SDL_Rect * clip,
|
|
||||||
SDL_Rect * result);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Calculate the intersection of a rectangle and line segment.
|
|
||||||
*
|
|
||||||
* This function is used to clip a line segment to a rectangle. A line segment
|
|
||||||
* contained entirely within the rectangle or that does not intersect will
|
|
||||||
* remain unchanged. A line segment that crosses the rectangle at either or
|
|
||||||
* both ends will be clipped to the boundary of the rectangle and the new
|
|
||||||
* coordinates saved in `X1`, `Y1`, `X2`, and/or `Y2` as necessary.
|
|
||||||
*
|
|
||||||
* \param rect an SDL_Rect structure representing the rectangle to intersect.
|
|
||||||
* \param X1 a pointer to the starting X-coordinate of the line.
|
|
||||||
* \param Y1 a pointer to the starting Y-coordinate of the line.
|
|
||||||
* \param X2 a pointer to the ending X-coordinate of the line.
|
|
||||||
* \param Y2 a pointer to the ending Y-coordinate of the line.
|
|
||||||
* \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRectAndLine(const SDL_Rect *
|
|
||||||
rect, int *X1,
|
|
||||||
int *Y1, int *X2,
|
|
||||||
int *Y2);
|
|
||||||
|
|
||||||
|
|
||||||
/* SDL_FRect versions... */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if point resides inside a rectangle.
|
|
||||||
*/
|
|
||||||
SDL_FORCE_INLINE SDL_bool SDL_PointInFRect(const SDL_FPoint *p, const SDL_FRect *r)
|
|
||||||
{
|
|
||||||
return ( (p->x >= r->x) && (p->x < (r->x + r->w)) &&
|
|
||||||
(p->y >= r->y) && (p->y < (r->y + r->h)) ) ? SDL_TRUE : SDL_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the rectangle has no area.
|
|
||||||
*/
|
|
||||||
SDL_FORCE_INLINE SDL_bool SDL_FRectEmpty(const SDL_FRect *r)
|
|
||||||
{
|
|
||||||
return ((!r) || (r->w <= 0.0f) || (r->h <= 0.0f)) ? SDL_TRUE : SDL_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the two rectangles are equal, within some given epsilon.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.22.
|
|
||||||
*/
|
|
||||||
SDL_FORCE_INLINE SDL_bool SDL_FRectEqualsEpsilon(const SDL_FRect *a, const SDL_FRect *b, const float epsilon)
|
|
||||||
{
|
|
||||||
return (a && b && ((a == b) ||
|
|
||||||
((SDL_fabsf(a->x - b->x) <= epsilon) &&
|
|
||||||
(SDL_fabsf(a->y - b->y) <= epsilon) &&
|
|
||||||
(SDL_fabsf(a->w - b->w) <= epsilon) &&
|
|
||||||
(SDL_fabsf(a->h - b->h) <= epsilon))))
|
|
||||||
? SDL_TRUE : SDL_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the two rectangles are equal, using a default epsilon.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.22.
|
|
||||||
*/
|
|
||||||
SDL_FORCE_INLINE SDL_bool SDL_FRectEquals(const SDL_FRect *a, const SDL_FRect *b)
|
|
||||||
{
|
|
||||||
return SDL_FRectEqualsEpsilon(a, b, SDL_FLT_EPSILON);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine whether two rectangles intersect with float precision.
|
|
||||||
*
|
|
||||||
* If either pointer is NULL the function will return SDL_FALSE.
|
|
||||||
*
|
|
||||||
* \param A an SDL_FRect structure representing the first rectangle.
|
|
||||||
* \param B an SDL_FRect structure representing the second rectangle.
|
|
||||||
* \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.22.
|
|
||||||
*
|
|
||||||
* \sa SDL_IntersectRect
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersectionF(const SDL_FRect * A,
|
|
||||||
const SDL_FRect * B);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Calculate the intersection of two rectangles with float precision.
|
|
||||||
*
|
|
||||||
* If `result` is NULL then this function will return SDL_FALSE.
|
|
||||||
*
|
|
||||||
* \param A an SDL_FRect structure representing the first rectangle.
|
|
||||||
* \param B an SDL_FRect structure representing the second rectangle.
|
|
||||||
* \param result an SDL_FRect structure filled in with the intersection of
|
|
||||||
* rectangles `A` and `B`.
|
|
||||||
* \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.22.
|
|
||||||
*
|
|
||||||
* \sa SDL_HasIntersectionF
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_IntersectFRect(const SDL_FRect * A,
|
|
||||||
const SDL_FRect * B,
|
|
||||||
SDL_FRect * result);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Calculate the union of two rectangles with float precision.
|
|
||||||
*
|
|
||||||
* \param A an SDL_FRect structure representing the first rectangle.
|
|
||||||
* \param B an SDL_FRect structure representing the second rectangle.
|
|
||||||
* \param result an SDL_FRect structure filled in with the union of rectangles
|
|
||||||
* `A` and `B`.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.22.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_UnionFRect(const SDL_FRect * A,
|
|
||||||
const SDL_FRect * B,
|
|
||||||
SDL_FRect * result);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Calculate a minimal rectangle enclosing a set of points with float
|
|
||||||
* precision.
|
|
||||||
*
|
|
||||||
* If `clip` is not NULL then only points inside of the clipping rectangle are
|
|
||||||
* considered.
|
|
||||||
*
|
|
||||||
* \param points an array of SDL_FPoint structures representing points to be
|
|
||||||
* enclosed.
|
|
||||||
* \param count the number of structures in the `points` array.
|
|
||||||
* \param clip an SDL_FRect used for clipping or NULL to enclose all points.
|
|
||||||
* \param result an SDL_FRect structure filled in with the minimal enclosing
|
|
||||||
* rectangle.
|
|
||||||
* \returns SDL_TRUE if any points were enclosed or SDL_FALSE if all the
|
|
||||||
* points were outside of the clipping rectangle.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.22.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_EncloseFPoints(const SDL_FPoint * points,
|
|
||||||
int count,
|
|
||||||
const SDL_FRect * clip,
|
|
||||||
SDL_FRect * result);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Calculate the intersection of a rectangle and line segment with float
|
|
||||||
* precision.
|
|
||||||
*
|
|
||||||
* This function is used to clip a line segment to a rectangle. A line segment
|
|
||||||
* contained entirely within the rectangle or that does not intersect will
|
|
||||||
* remain unchanged. A line segment that crosses the rectangle at either or
|
|
||||||
* both ends will be clipped to the boundary of the rectangle and the new
|
|
||||||
* coordinates saved in `X1`, `Y1`, `X2`, and/or `Y2` as necessary.
|
|
||||||
*
|
|
||||||
* \param rect an SDL_FRect structure representing the rectangle to intersect.
|
|
||||||
* \param X1 a pointer to the starting X-coordinate of the line.
|
|
||||||
* \param Y1 a pointer to the starting Y-coordinate of the line.
|
|
||||||
* \param X2 a pointer to the ending X-coordinate of the line.
|
|
||||||
* \param Y2 a pointer to the ending Y-coordinate of the line.
|
|
||||||
* \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.22.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_IntersectFRectAndLine(const SDL_FRect *
|
|
||||||
rect, float *X1,
|
|
||||||
float *Y1, float *X2,
|
|
||||||
float *Y2);
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include <SDL2/close_code.h>
|
|
||||||
|
|
||||||
#endif /* SDL_rect_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +0,0 @@
|
|||||||
#ifdef SDL_VENDOR_INFO
|
|
||||||
#define SDL_REVISION SDL_VENDOR_INFO
|
|
||||||
#else
|
|
||||||
#define SDL_REVISION ""
|
|
||||||
#endif
|
|
||||||
#define SDL_REVISION_NUMBER 0
|
|
||||||
@@ -1,844 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2025 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* WIKI CATEGORY: RWOPS */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* # CategoryRWOPS
|
|
||||||
*
|
|
||||||
* This file provides a general interface for SDL to read and write data
|
|
||||||
* streams. It can easily be extended to files, memory, etc.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_rwops_h_
|
|
||||||
#define SDL_rwops_h_
|
|
||||||
|
|
||||||
#include <SDL2/SDL_stdinc.h>
|
|
||||||
#include <SDL2/SDL_error.h>
|
|
||||||
|
|
||||||
#include <SDL2/begin_code.h>
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* RWops Types */
|
|
||||||
#define SDL_RWOPS_UNKNOWN 0U /**< Unknown stream type */
|
|
||||||
#define SDL_RWOPS_WINFILE 1U /**< Win32 file */
|
|
||||||
#define SDL_RWOPS_STDFILE 2U /**< Stdio file */
|
|
||||||
#define SDL_RWOPS_JNIFILE 3U /**< Android asset */
|
|
||||||
#define SDL_RWOPS_MEMORY 4U /**< Memory stream */
|
|
||||||
#define SDL_RWOPS_MEMORY_RO 5U /**< Read-Only memory stream */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is the read/write operation structure -- very basic.
|
|
||||||
*/
|
|
||||||
typedef struct SDL_RWops
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Return the size of the file in this rwops, or -1 if unknown
|
|
||||||
*/
|
|
||||||
Sint64 (SDLCALL * size) (struct SDL_RWops * context);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Seek to `offset` relative to `whence`, one of stdio's whence values:
|
|
||||||
* RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END
|
|
||||||
*
|
|
||||||
* \return the final offset in the data stream, or -1 on error.
|
|
||||||
*/
|
|
||||||
Sint64 (SDLCALL * seek) (struct SDL_RWops * context, Sint64 offset,
|
|
||||||
int whence);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Read up to `maxnum` objects each of size `size` from the data
|
|
||||||
* stream to the area pointed at by `ptr`.
|
|
||||||
*
|
|
||||||
* \return the number of objects read, or 0 at error or end of file.
|
|
||||||
*/
|
|
||||||
size_t (SDLCALL * read) (struct SDL_RWops * context, void *ptr,
|
|
||||||
size_t size, size_t maxnum);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Write exactly `num` objects each of size `size` from the area
|
|
||||||
* pointed at by `ptr` to data stream.
|
|
||||||
*
|
|
||||||
* \return the number of objects written, or 0 at error or end of file.
|
|
||||||
*/
|
|
||||||
size_t (SDLCALL * write) (struct SDL_RWops * context, const void *ptr,
|
|
||||||
size_t size, size_t num);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Close and free an allocated SDL_RWops structure.
|
|
||||||
*
|
|
||||||
* \return 0 if successful or -1 on write error when flushing data.
|
|
||||||
*/
|
|
||||||
int (SDLCALL * close) (struct SDL_RWops * context);
|
|
||||||
|
|
||||||
Uint32 type;
|
|
||||||
union
|
|
||||||
{
|
|
||||||
#if defined(__ANDROID__)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
void *asset;
|
|
||||||
} androidio;
|
|
||||||
#elif defined(__WIN32__) || defined(__GDK__)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
SDL_bool append;
|
|
||||||
void *h;
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
void *data;
|
|
||||||
size_t size;
|
|
||||||
size_t left;
|
|
||||||
} buffer;
|
|
||||||
} windowsio;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_STDIO_H
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
SDL_bool autoclose;
|
|
||||||
FILE *fp;
|
|
||||||
} stdio;
|
|
||||||
#endif
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
Uint8 *base;
|
|
||||||
Uint8 *here;
|
|
||||||
Uint8 *stop;
|
|
||||||
} mem;
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
void *data1;
|
|
||||||
void *data2;
|
|
||||||
} unknown;
|
|
||||||
} hidden;
|
|
||||||
|
|
||||||
} SDL_RWops;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name RWFrom functions
|
|
||||||
*
|
|
||||||
* Functions to create SDL_RWops structures from various data streams.
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Use this function to create a new SDL_RWops structure for reading from
|
|
||||||
* and/or writing to a named file.
|
|
||||||
*
|
|
||||||
* The `mode` string is treated roughly the same as in a call to the C
|
|
||||||
* library's fopen(), even if SDL doesn't happen to use fopen() behind the
|
|
||||||
* scenes.
|
|
||||||
*
|
|
||||||
* Available `mode` strings:
|
|
||||||
*
|
|
||||||
* - "r": Open a file for reading. The file must exist.
|
|
||||||
* - "w": Create an empty file for writing. If a file with the same name
|
|
||||||
* already exists its content is erased and the file is treated as a new
|
|
||||||
* empty file.
|
|
||||||
* - "a": Append to a file. Writing operations append data at the end of the
|
|
||||||
* file. The file is created if it does not exist.
|
|
||||||
* - "r+": Open a file for update both reading and writing. The file must
|
|
||||||
* exist.
|
|
||||||
* - "w+": Create an empty file for both reading and writing. If a file with
|
|
||||||
* the same name already exists its content is erased and the file is
|
|
||||||
* treated as a new empty file.
|
|
||||||
* - "a+": Open a file for reading and appending. All writing operations are
|
|
||||||
* performed at the end of the file, protecting the previous content to be
|
|
||||||
* overwritten. You can reposition (fseek, rewind) the internal pointer to
|
|
||||||
* anywhere in the file for reading, but writing operations will move it
|
|
||||||
* back to the end of file. The file is created if it does not exist.
|
|
||||||
*
|
|
||||||
* **NOTE**: In order to open a file as a binary file, a "b" character has to
|
|
||||||
* be included in the `mode` string. This additional "b" character can either
|
|
||||||
* be appended at the end of the string (thus making the following compound
|
|
||||||
* modes: "rb", "wb", "ab", "r+b", "w+b", "a+b") or be inserted between the
|
|
||||||
* letter and the "+" sign for the mixed modes ("rb+", "wb+", "ab+").
|
|
||||||
* Additional characters may follow the sequence, although they should have no
|
|
||||||
* effect. For example, "t" is sometimes appended to make explicit the file is
|
|
||||||
* a text file.
|
|
||||||
*
|
|
||||||
* This function supports Unicode filenames, but they must be encoded in UTF-8
|
|
||||||
* format, regardless of the underlying operating system.
|
|
||||||
*
|
|
||||||
* As a fallback, SDL_RWFromFile() will transparently open a matching filename
|
|
||||||
* in an Android app's `assets`.
|
|
||||||
*
|
|
||||||
* Closing the SDL_RWops will close the file handle SDL is holding internally.
|
|
||||||
*
|
|
||||||
* \param file a UTF-8 string representing the filename to open.
|
|
||||||
* \param mode an ASCII string representing the mode to be used for opening
|
|
||||||
* the file.
|
|
||||||
* \returns a pointer to the SDL_RWops structure that is created, or NULL on
|
|
||||||
* failure; call SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_RWclose
|
|
||||||
* \sa SDL_RWFromConstMem
|
|
||||||
* \sa SDL_RWFromFP
|
|
||||||
* \sa SDL_RWFromMem
|
|
||||||
* \sa SDL_RWread
|
|
||||||
* \sa SDL_RWseek
|
|
||||||
* \sa SDL_RWtell
|
|
||||||
* \sa SDL_RWwrite
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFile(const char *file,
|
|
||||||
const char *mode);
|
|
||||||
|
|
||||||
#ifdef HAVE_STDIO_H
|
|
||||||
|
|
||||||
extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(FILE * fp, SDL_bool autoclose);
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Use this function to create an SDL_RWops structure from a standard I/O file
|
|
||||||
* pointer (stdio.h's `FILE*`).
|
|
||||||
*
|
|
||||||
* This function is not available on Windows, since files opened in an
|
|
||||||
* application on that platform cannot be used by a dynamically linked
|
|
||||||
* library.
|
|
||||||
*
|
|
||||||
* On some platforms, the first parameter is a `void*`, on others, it's a
|
|
||||||
* `FILE*`, depending on what system headers are available to SDL. It is
|
|
||||||
* always intended to be the `FILE*` type from the C runtime's stdio.h.
|
|
||||||
*
|
|
||||||
* \param fp the `FILE*` that feeds the SDL_RWops stream.
|
|
||||||
* \param autoclose SDL_TRUE to close the `FILE*` when closing the SDL_RWops,
|
|
||||||
* SDL_FALSE to leave the `FILE*` open when the RWops is
|
|
||||||
* closed.
|
|
||||||
* \returns a pointer to the SDL_RWops structure that is created, or NULL on
|
|
||||||
* failure; call SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_RWclose
|
|
||||||
* \sa SDL_RWFromConstMem
|
|
||||||
* \sa SDL_RWFromFile
|
|
||||||
* \sa SDL_RWFromMem
|
|
||||||
* \sa SDL_RWread
|
|
||||||
* \sa SDL_RWseek
|
|
||||||
* \sa SDL_RWtell
|
|
||||||
* \sa SDL_RWwrite
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(void * fp,
|
|
||||||
SDL_bool autoclose);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Use this function to prepare a read-write memory buffer for use with
|
|
||||||
* SDL_RWops.
|
|
||||||
*
|
|
||||||
* This function sets up an SDL_RWops struct based on a memory area of a
|
|
||||||
* certain size, for both read and write access.
|
|
||||||
*
|
|
||||||
* This memory buffer is not copied by the RWops; the pointer you provide must
|
|
||||||
* remain valid until you close the stream. Closing the stream will not free
|
|
||||||
* the original buffer.
|
|
||||||
*
|
|
||||||
* If you need to make sure the RWops never writes to the memory buffer, you
|
|
||||||
* should use SDL_RWFromConstMem() with a read-only buffer of memory instead.
|
|
||||||
*
|
|
||||||
* \param mem a pointer to a buffer to feed an SDL_RWops stream.
|
|
||||||
* \param size the buffer size, in bytes.
|
|
||||||
* \returns a pointer to a new SDL_RWops structure, or NULL if it fails; call
|
|
||||||
* SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_RWclose
|
|
||||||
* \sa SDL_RWFromConstMem
|
|
||||||
* \sa SDL_RWFromFile
|
|
||||||
* \sa SDL_RWFromFP
|
|
||||||
* \sa SDL_RWFromMem
|
|
||||||
* \sa SDL_RWread
|
|
||||||
* \sa SDL_RWseek
|
|
||||||
* \sa SDL_RWtell
|
|
||||||
* \sa SDL_RWwrite
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromMem(void *mem, int size);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Use this function to prepare a read-only memory buffer for use with RWops.
|
|
||||||
*
|
|
||||||
* This function sets up an SDL_RWops struct based on a memory area of a
|
|
||||||
* certain size. It assumes the memory area is not writable.
|
|
||||||
*
|
|
||||||
* Attempting to write to this RWops stream will report an error without
|
|
||||||
* writing to the memory buffer.
|
|
||||||
*
|
|
||||||
* This memory buffer is not copied by the RWops; the pointer you provide must
|
|
||||||
* remain valid until you close the stream. Closing the stream will not free
|
|
||||||
* the original buffer.
|
|
||||||
*
|
|
||||||
* If you need to write to a memory buffer, you should use SDL_RWFromMem()
|
|
||||||
* with a writable buffer of memory instead.
|
|
||||||
*
|
|
||||||
* \param mem a pointer to a read-only buffer to feed an SDL_RWops stream.
|
|
||||||
* \param size the buffer size, in bytes.
|
|
||||||
* \returns a pointer to a new SDL_RWops structure, or NULL if it fails; call
|
|
||||||
* SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_RWclose
|
|
||||||
* \sa SDL_RWFromConstMem
|
|
||||||
* \sa SDL_RWFromFile
|
|
||||||
* \sa SDL_RWFromFP
|
|
||||||
* \sa SDL_RWFromMem
|
|
||||||
* \sa SDL_RWread
|
|
||||||
* \sa SDL_RWseek
|
|
||||||
* \sa SDL_RWtell
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromConstMem(const void *mem,
|
|
||||||
int size);
|
|
||||||
|
|
||||||
/* @} *//* RWFrom functions */
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Use this function to allocate an empty, unpopulated SDL_RWops structure.
|
|
||||||
*
|
|
||||||
* Applications do not need to use this function unless they are providing
|
|
||||||
* their own SDL_RWops implementation. If you just need a SDL_RWops to
|
|
||||||
* read/write a common data source, you should use the built-in
|
|
||||||
* implementations in SDL, like SDL_RWFromFile() or SDL_RWFromMem(), etc.
|
|
||||||
*
|
|
||||||
* You must free the returned pointer with SDL_FreeRW(). Depending on your
|
|
||||||
* operating system and compiler, there may be a difference between the
|
|
||||||
* malloc() and free() your program uses and the versions SDL calls
|
|
||||||
* internally. Trying to mix the two can cause crashing such as segmentation
|
|
||||||
* faults. Since all SDL_RWops must free themselves when their **close**
|
|
||||||
* method is called, all SDL_RWops must be allocated through this function, so
|
|
||||||
* they can all be freed correctly with SDL_FreeRW().
|
|
||||||
*
|
|
||||||
* \returns a pointer to the allocated memory on success, or NULL on failure;
|
|
||||||
* call SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_FreeRW
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_RWops *SDLCALL SDL_AllocRW(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Use this function to free an SDL_RWops structure allocated by
|
|
||||||
* SDL_AllocRW().
|
|
||||||
*
|
|
||||||
* Applications do not need to use this function unless they are providing
|
|
||||||
* their own SDL_RWops implementation. If you just need a SDL_RWops to
|
|
||||||
* read/write a common data source, you should use the built-in
|
|
||||||
* implementations in SDL, like SDL_RWFromFile() or SDL_RWFromMem(), etc, and
|
|
||||||
* call the **close** method on those SDL_RWops pointers when you are done
|
|
||||||
* with them.
|
|
||||||
*
|
|
||||||
* Only use SDL_FreeRW() on pointers returned by SDL_AllocRW(). The pointer is
|
|
||||||
* invalid as soon as this function returns. Any extra memory allocated during
|
|
||||||
* creation of the SDL_RWops is not freed by SDL_FreeRW(); the programmer must
|
|
||||||
* be responsible for managing that memory in their **close** method.
|
|
||||||
*
|
|
||||||
* \param area the SDL_RWops structure to be freed.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_AllocRW
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops * area);
|
|
||||||
|
|
||||||
/* Possible `whence` values for SDL_RWops seeking... */
|
|
||||||
#define RW_SEEK_SET 0 /**< Seek from the beginning of data */
|
|
||||||
#define RW_SEEK_CUR 1 /**< Seek relative to current read point */
|
|
||||||
#define RW_SEEK_END 2 /**< Seek relative to the end of data */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Use this function to get the size of the data stream in an SDL_RWops.
|
|
||||||
*
|
|
||||||
* Prior to SDL 2.0.10, this function was a macro.
|
|
||||||
*
|
|
||||||
* \param context the SDL_RWops to get the size of the data stream from.
|
|
||||||
* \returns the size of the data stream in the SDL_RWops on success, -1 if
|
|
||||||
* unknown or a negative error code on failure; call SDL_GetError()
|
|
||||||
* for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.10.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Sint64 SDLCALL SDL_RWsize(SDL_RWops *context);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Seek within an SDL_RWops data stream.
|
|
||||||
*
|
|
||||||
* This function seeks to byte `offset`, relative to `whence`.
|
|
||||||
*
|
|
||||||
* `whence` may be any of the following values:
|
|
||||||
*
|
|
||||||
* - `RW_SEEK_SET`: seek from the beginning of data
|
|
||||||
* - `RW_SEEK_CUR`: seek relative to current read point
|
|
||||||
* - `RW_SEEK_END`: seek relative to the end of data
|
|
||||||
*
|
|
||||||
* If this stream can not seek, it will return -1.
|
|
||||||
*
|
|
||||||
* SDL_RWseek() is actually a wrapper function that calls the SDL_RWops's
|
|
||||||
* `seek` method appropriately, to simplify application development.
|
|
||||||
*
|
|
||||||
* Prior to SDL 2.0.10, this function was a macro.
|
|
||||||
*
|
|
||||||
* \param context a pointer to an SDL_RWops structure.
|
|
||||||
* \param offset an offset in bytes, relative to **whence** location; can be
|
|
||||||
* negative.
|
|
||||||
* \param whence any of `RW_SEEK_SET`, `RW_SEEK_CUR`, `RW_SEEK_END`.
|
|
||||||
* \returns the final offset in the data stream after the seek or -1 on error.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.10.
|
|
||||||
*
|
|
||||||
* \sa SDL_RWclose
|
|
||||||
* \sa SDL_RWFromConstMem
|
|
||||||
* \sa SDL_RWFromFile
|
|
||||||
* \sa SDL_RWFromFP
|
|
||||||
* \sa SDL_RWFromMem
|
|
||||||
* \sa SDL_RWread
|
|
||||||
* \sa SDL_RWtell
|
|
||||||
* \sa SDL_RWwrite
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Sint64 SDLCALL SDL_RWseek(SDL_RWops *context,
|
|
||||||
Sint64 offset, int whence);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine the current read/write offset in an SDL_RWops data stream.
|
|
||||||
*
|
|
||||||
* SDL_RWtell is actually a wrapper function that calls the SDL_RWops's `seek`
|
|
||||||
* method, with an offset of 0 bytes from `RW_SEEK_CUR`, to simplify
|
|
||||||
* application development.
|
|
||||||
*
|
|
||||||
* Prior to SDL 2.0.10, this function was a macro.
|
|
||||||
*
|
|
||||||
* \param context a SDL_RWops data stream object from which to get the current
|
|
||||||
* offset.
|
|
||||||
* \returns the current offset in the stream, or -1 if the information can not
|
|
||||||
* be determined.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.10.
|
|
||||||
*
|
|
||||||
* \sa SDL_RWclose
|
|
||||||
* \sa SDL_RWFromConstMem
|
|
||||||
* \sa SDL_RWFromFile
|
|
||||||
* \sa SDL_RWFromFP
|
|
||||||
* \sa SDL_RWFromMem
|
|
||||||
* \sa SDL_RWread
|
|
||||||
* \sa SDL_RWseek
|
|
||||||
* \sa SDL_RWwrite
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Sint64 SDLCALL SDL_RWtell(SDL_RWops *context);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Read from a data source.
|
|
||||||
*
|
|
||||||
* This function reads up to `maxnum` objects each of size `size` from the
|
|
||||||
* data source to the area pointed at by `ptr`. This function may read less
|
|
||||||
* objects than requested. It will return zero when there has been an error or
|
|
||||||
* the data stream is completely read.
|
|
||||||
*
|
|
||||||
* SDL_RWread() is actually a function wrapper that calls the SDL_RWops's
|
|
||||||
* `read` method appropriately, to simplify application development.
|
|
||||||
*
|
|
||||||
* Prior to SDL 2.0.10, this function was a macro.
|
|
||||||
*
|
|
||||||
* \param context a pointer to an SDL_RWops structure.
|
|
||||||
* \param ptr a pointer to a buffer to read data into.
|
|
||||||
* \param size the size of each object to read, in bytes.
|
|
||||||
* \param maxnum the maximum number of objects to be read.
|
|
||||||
* \returns the number of objects read, or 0 at error or end of file; call
|
|
||||||
* SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.10.
|
|
||||||
*
|
|
||||||
* \sa SDL_RWclose
|
|
||||||
* \sa SDL_RWFromConstMem
|
|
||||||
* \sa SDL_RWFromFile
|
|
||||||
* \sa SDL_RWFromFP
|
|
||||||
* \sa SDL_RWFromMem
|
|
||||||
* \sa SDL_RWseek
|
|
||||||
* \sa SDL_RWwrite
|
|
||||||
*/
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_RWread(SDL_RWops *context,
|
|
||||||
void *ptr, size_t size,
|
|
||||||
size_t maxnum);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Write to an SDL_RWops data stream.
|
|
||||||
*
|
|
||||||
* This function writes exactly `num` objects each of size `size` from the
|
|
||||||
* area pointed at by `ptr` to the stream. If this fails for any reason, it'll
|
|
||||||
* return less than `num` to demonstrate how far the write progressed. On
|
|
||||||
* success, it returns `num`.
|
|
||||||
*
|
|
||||||
* SDL_RWwrite is actually a function wrapper that calls the SDL_RWops's
|
|
||||||
* `write` method appropriately, to simplify application development.
|
|
||||||
*
|
|
||||||
* Prior to SDL 2.0.10, this function was a macro.
|
|
||||||
*
|
|
||||||
* \param context a pointer to an SDL_RWops structure.
|
|
||||||
* \param ptr a pointer to a buffer containing data to write.
|
|
||||||
* \param size the size of an object to write, in bytes.
|
|
||||||
* \param num the number of objects to write.
|
|
||||||
* \returns the number of objects written, which will be less than **num** on
|
|
||||||
* error; call SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.10.
|
|
||||||
*
|
|
||||||
* \sa SDL_RWclose
|
|
||||||
* \sa SDL_RWFromConstMem
|
|
||||||
* \sa SDL_RWFromFile
|
|
||||||
* \sa SDL_RWFromFP
|
|
||||||
* \sa SDL_RWFromMem
|
|
||||||
* \sa SDL_RWread
|
|
||||||
* \sa SDL_RWseek
|
|
||||||
*/
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_RWwrite(SDL_RWops *context,
|
|
||||||
const void *ptr, size_t size,
|
|
||||||
size_t num);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Close and free an allocated SDL_RWops structure.
|
|
||||||
*
|
|
||||||
* SDL_RWclose() closes and cleans up the SDL_RWops stream. It releases any
|
|
||||||
* resources used by the stream and frees the SDL_RWops itself with
|
|
||||||
* SDL_FreeRW(). This returns 0 on success, or -1 if the stream failed to
|
|
||||||
* flush to its output (e.g. to disk).
|
|
||||||
*
|
|
||||||
* Note that if this fails to flush the stream to disk, this function reports
|
|
||||||
* an error, but the SDL_RWops is still invalid once this function returns.
|
|
||||||
*
|
|
||||||
* Prior to SDL 2.0.10, this function was a macro.
|
|
||||||
*
|
|
||||||
* \param context SDL_RWops structure to close.
|
|
||||||
* \returns 0 on success or a negative error code on failure; call
|
|
||||||
* SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.10.
|
|
||||||
*
|
|
||||||
* \sa SDL_RWFromConstMem
|
|
||||||
* \sa SDL_RWFromFile
|
|
||||||
* \sa SDL_RWFromFP
|
|
||||||
* \sa SDL_RWFromMem
|
|
||||||
* \sa SDL_RWread
|
|
||||||
* \sa SDL_RWseek
|
|
||||||
* \sa SDL_RWwrite
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_RWclose(SDL_RWops *context);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Load all the data from an SDL data stream.
|
|
||||||
*
|
|
||||||
* The data is allocated with a zero byte at the end (null terminated) for
|
|
||||||
* convenience. This extra byte is not included in the value reported via
|
|
||||||
* `datasize`.
|
|
||||||
*
|
|
||||||
* The data should be freed with SDL_free().
|
|
||||||
*
|
|
||||||
* \param src the SDL_RWops to read all available data from.
|
|
||||||
* \param datasize if not NULL, will store the number of bytes read.
|
|
||||||
* \param freesrc if non-zero, calls SDL_RWclose() on `src` before returning.
|
|
||||||
* \returns the data, or NULL if there was an error.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.6.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void *SDLCALL SDL_LoadFile_RW(SDL_RWops *src,
|
|
||||||
size_t *datasize,
|
|
||||||
int freesrc);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Load all the data from a file path.
|
|
||||||
*
|
|
||||||
* The data is allocated with a zero byte at the end (null terminated) for
|
|
||||||
* convenience. This extra byte is not included in the value reported via
|
|
||||||
* `datasize`.
|
|
||||||
*
|
|
||||||
* The data should be freed with SDL_free().
|
|
||||||
*
|
|
||||||
* Prior to SDL 2.0.10, this function was a macro wrapping around
|
|
||||||
* SDL_LoadFile_RW.
|
|
||||||
*
|
|
||||||
* \param file the path to read all available data from.
|
|
||||||
* \param datasize if not NULL, will store the number of bytes read.
|
|
||||||
* \returns the data, or NULL if there was an error.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.10.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void *SDLCALL SDL_LoadFile(const char *file, size_t *datasize);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Read endian functions
|
|
||||||
*
|
|
||||||
* Read an item of the specified endianness and return in native format.
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Use this function to read a byte from an SDL_RWops.
|
|
||||||
*
|
|
||||||
* \param src the SDL_RWops to read from.
|
|
||||||
* \returns the read byte on success or 0 on failure; call SDL_GetError() for
|
|
||||||
* more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_WriteU8
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint8 SDLCALL SDL_ReadU8(SDL_RWops * src);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Use this function to read 16 bits of little-endian data from an SDL_RWops
|
|
||||||
* and return in native format.
|
|
||||||
*
|
|
||||||
* SDL byteswaps the data only if necessary, so the data returned will be in
|
|
||||||
* the native byte order.
|
|
||||||
*
|
|
||||||
* \param src the stream from which to read data.
|
|
||||||
* \returns 16 bits of data in the native byte order of the platform.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_ReadBE16
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops * src);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Use this function to read 16 bits of big-endian data from an SDL_RWops and
|
|
||||||
* return in native format.
|
|
||||||
*
|
|
||||||
* SDL byteswaps the data only if necessary, so the data returned will be in
|
|
||||||
* the native byte order.
|
|
||||||
*
|
|
||||||
* \param src the stream from which to read data.
|
|
||||||
* \returns 16 bits of data in the native byte order of the platform.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_ReadLE16
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops * src);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Use this function to read 32 bits of little-endian data from an SDL_RWops
|
|
||||||
* and return in native format.
|
|
||||||
*
|
|
||||||
* SDL byteswaps the data only if necessary, so the data returned will be in
|
|
||||||
* the native byte order.
|
|
||||||
*
|
|
||||||
* \param src the stream from which to read data.
|
|
||||||
* \returns 32 bits of data in the native byte order of the platform.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_ReadBE32
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops * src);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Use this function to read 32 bits of big-endian data from an SDL_RWops and
|
|
||||||
* return in native format.
|
|
||||||
*
|
|
||||||
* SDL byteswaps the data only if necessary, so the data returned will be in
|
|
||||||
* the native byte order.
|
|
||||||
*
|
|
||||||
* \param src the stream from which to read data.
|
|
||||||
* \returns 32 bits of data in the native byte order of the platform.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_ReadLE32
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops * src);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Use this function to read 64 bits of little-endian data from an SDL_RWops
|
|
||||||
* and return in native format.
|
|
||||||
*
|
|
||||||
* SDL byteswaps the data only if necessary, so the data returned will be in
|
|
||||||
* the native byte order.
|
|
||||||
*
|
|
||||||
* \param src the stream from which to read data.
|
|
||||||
* \returns 64 bits of data in the native byte order of the platform.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_ReadBE64
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops * src);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Use this function to read 64 bits of big-endian data from an SDL_RWops and
|
|
||||||
* return in native format.
|
|
||||||
*
|
|
||||||
* SDL byteswaps the data only if necessary, so the data returned will be in
|
|
||||||
* the native byte order.
|
|
||||||
*
|
|
||||||
* \param src the stream from which to read data.
|
|
||||||
* \returns 64 bits of data in the native byte order of the platform.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_ReadLE64
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops * src);
|
|
||||||
/* @} *//* Read endian functions */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Write endian functions
|
|
||||||
*
|
|
||||||
* Write an item of native format to the specified endianness.
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Use this function to write a byte to an SDL_RWops.
|
|
||||||
*
|
|
||||||
* \param dst the SDL_RWops to write to.
|
|
||||||
* \param value the byte value to write.
|
|
||||||
* \returns 1 on success or 0 on failure; call SDL_GetError() for more
|
|
||||||
* information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_ReadU8
|
|
||||||
*/
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_WriteU8(SDL_RWops * dst, Uint8 value);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Use this function to write 16 bits in native format to a SDL_RWops as
|
|
||||||
* little-endian data.
|
|
||||||
*
|
|
||||||
* SDL byteswaps the data only if necessary, so the application always
|
|
||||||
* specifies native format, and the data written will be in little-endian
|
|
||||||
* format.
|
|
||||||
*
|
|
||||||
* \param dst the stream to which data will be written.
|
|
||||||
* \param value the data to be written, in native format.
|
|
||||||
* \returns 1 on successful write, 0 on error.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_WriteBE16
|
|
||||||
*/
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_WriteLE16(SDL_RWops * dst, Uint16 value);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Use this function to write 16 bits in native format to a SDL_RWops as
|
|
||||||
* big-endian data.
|
|
||||||
*
|
|
||||||
* SDL byteswaps the data only if necessary, so the application always
|
|
||||||
* specifies native format, and the data written will be in big-endian format.
|
|
||||||
*
|
|
||||||
* \param dst the stream to which data will be written.
|
|
||||||
* \param value the data to be written, in native format.
|
|
||||||
* \returns 1 on successful write, 0 on error.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_WriteLE16
|
|
||||||
*/
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_WriteBE16(SDL_RWops * dst, Uint16 value);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Use this function to write 32 bits in native format to a SDL_RWops as
|
|
||||||
* little-endian data.
|
|
||||||
*
|
|
||||||
* SDL byteswaps the data only if necessary, so the application always
|
|
||||||
* specifies native format, and the data written will be in little-endian
|
|
||||||
* format.
|
|
||||||
*
|
|
||||||
* \param dst the stream to which data will be written.
|
|
||||||
* \param value the data to be written, in native format.
|
|
||||||
* \returns 1 on successful write, 0 on error.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_WriteBE32
|
|
||||||
*/
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_WriteLE32(SDL_RWops * dst, Uint32 value);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Use this function to write 32 bits in native format to a SDL_RWops as
|
|
||||||
* big-endian data.
|
|
||||||
*
|
|
||||||
* SDL byteswaps the data only if necessary, so the application always
|
|
||||||
* specifies native format, and the data written will be in big-endian format.
|
|
||||||
*
|
|
||||||
* \param dst the stream to which data will be written.
|
|
||||||
* \param value the data to be written, in native format.
|
|
||||||
* \returns 1 on successful write, 0 on error.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_WriteLE32
|
|
||||||
*/
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_WriteBE32(SDL_RWops * dst, Uint32 value);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Use this function to write 64 bits in native format to a SDL_RWops as
|
|
||||||
* little-endian data.
|
|
||||||
*
|
|
||||||
* SDL byteswaps the data only if necessary, so the application always
|
|
||||||
* specifies native format, and the data written will be in little-endian
|
|
||||||
* format.
|
|
||||||
*
|
|
||||||
* \param dst the stream to which data will be written.
|
|
||||||
* \param value the data to be written, in native format.
|
|
||||||
* \returns 1 on successful write, 0 on error.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_WriteBE64
|
|
||||||
*/
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_WriteLE64(SDL_RWops * dst, Uint64 value);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Use this function to write 64 bits in native format to a SDL_RWops as
|
|
||||||
* big-endian data.
|
|
||||||
*
|
|
||||||
* SDL byteswaps the data only if necessary, so the application always
|
|
||||||
* specifies native format, and the data written will be in big-endian format.
|
|
||||||
*
|
|
||||||
* \param dst the stream to which data will be written.
|
|
||||||
* \param value the data to be written, in native format.
|
|
||||||
* \returns 1 on successful write, 0 on error.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_WriteLE64
|
|
||||||
*/
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_WriteBE64(SDL_RWops * dst, Uint64 value);
|
|
||||||
/* @} *//* Write endian functions */
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include <SDL2/close_code.h>
|
|
||||||
|
|
||||||
#endif /* SDL_rwops_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
||||||
@@ -1,155 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2025 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_shape_h_
|
|
||||||
#define SDL_shape_h_
|
|
||||||
|
|
||||||
#include <SDL2/SDL_stdinc.h>
|
|
||||||
#include <SDL2/SDL_pixels.h>
|
|
||||||
#include <SDL2/SDL_rect.h>
|
|
||||||
#include <SDL2/SDL_surface.h>
|
|
||||||
#include <SDL2/SDL_video.h>
|
|
||||||
|
|
||||||
#include <SDL2/begin_code.h>
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** \file SDL_shape.h
|
|
||||||
*
|
|
||||||
* Header file for the shaped window API.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define SDL_NONSHAPEABLE_WINDOW -1
|
|
||||||
#define SDL_INVALID_SHAPE_ARGUMENT -2
|
|
||||||
#define SDL_WINDOW_LACKS_SHAPE -3
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a window that can be shaped with the specified position, dimensions,
|
|
||||||
* and flags.
|
|
||||||
*
|
|
||||||
* \param title The title of the window, in UTF-8 encoding.
|
|
||||||
* \param x The x position of the window, SDL_WINDOWPOS_CENTERED, or
|
|
||||||
* SDL_WINDOWPOS_UNDEFINED.
|
|
||||||
* \param y The y position of the window, SDL_WINDOWPOS_CENTERED, or
|
|
||||||
* SDL_WINDOWPOS_UNDEFINED.
|
|
||||||
* \param w The width of the window.
|
|
||||||
* \param h The height of the window.
|
|
||||||
* \param flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with
|
|
||||||
* any of the following: SDL_WINDOW_OPENGL,
|
|
||||||
* SDL_WINDOW_INPUT_GRABBED, SDL_WINDOW_HIDDEN,
|
|
||||||
* SDL_WINDOW_RESIZABLE, SDL_WINDOW_MAXIMIZED,
|
|
||||||
* SDL_WINDOW_MINIMIZED, SDL_WINDOW_BORDERLESS is always set, and
|
|
||||||
* SDL_WINDOW_FULLSCREEN is always unset.
|
|
||||||
* \return the window created, or NULL if window creation failed.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_DestroyWindow
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Window * SDLCALL SDL_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return whether the given window is a shaped window.
|
|
||||||
*
|
|
||||||
* \param window The window to query for being shaped.
|
|
||||||
* \return SDL_TRUE if the window is a window that can be shaped, SDL_FALSE if
|
|
||||||
* the window is unshaped or NULL.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_CreateShapedWindow
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_IsShapedWindow(const SDL_Window *window);
|
|
||||||
|
|
||||||
/** \brief An enum denoting the specific type of contents present in an SDL_WindowShapeParams union. */
|
|
||||||
typedef enum {
|
|
||||||
/** \brief The default mode, a binarized alpha cutoff of 1. */
|
|
||||||
ShapeModeDefault,
|
|
||||||
/** \brief A binarized alpha cutoff with a given integer value. */
|
|
||||||
ShapeModeBinarizeAlpha,
|
|
||||||
/** \brief A binarized alpha cutoff with a given integer value, but with the opposite comparison. */
|
|
||||||
ShapeModeReverseBinarizeAlpha,
|
|
||||||
/** \brief A color key is applied. */
|
|
||||||
ShapeModeColorKey
|
|
||||||
} WindowShapeMode;
|
|
||||||
|
|
||||||
#define SDL_SHAPEMODEALPHA(mode) (mode == ShapeModeDefault || mode == ShapeModeBinarizeAlpha || mode == ShapeModeReverseBinarizeAlpha)
|
|
||||||
|
|
||||||
/** \brief A union containing parameters for shaped windows. */
|
|
||||||
typedef union {
|
|
||||||
/** \brief A cutoff alpha value for binarization of the window shape's alpha channel. */
|
|
||||||
Uint8 binarizationCutoff;
|
|
||||||
SDL_Color colorKey;
|
|
||||||
} SDL_WindowShapeParams;
|
|
||||||
|
|
||||||
/** \brief A struct that tags the SDL_WindowShapeParams union with an enum describing the type of its contents. */
|
|
||||||
typedef struct SDL_WindowShapeMode {
|
|
||||||
/** \brief The mode of these window-shape parameters. */
|
|
||||||
WindowShapeMode mode;
|
|
||||||
/** \brief Window-shape parameters. */
|
|
||||||
SDL_WindowShapeParams parameters;
|
|
||||||
} SDL_WindowShapeMode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the shape and parameters of a shaped window.
|
|
||||||
*
|
|
||||||
* \param window The shaped window whose parameters should be set.
|
|
||||||
* \param shape A surface encoding the desired shape for the window.
|
|
||||||
* \param shape_mode The parameters to set for the shaped window.
|
|
||||||
* \return 0 on success, SDL_INVALID_SHAPE_ARGUMENT on an invalid shape
|
|
||||||
* argument, or SDL_NONSHAPEABLE_WINDOW if the SDL_Window given does
|
|
||||||
* not reference a valid shaped window.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_WindowShapeMode
|
|
||||||
* \sa SDL_GetShapedWindowMode
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the shape parameters of a shaped window.
|
|
||||||
*
|
|
||||||
* \param window The shaped window whose parameters should be retrieved.
|
|
||||||
* \param shape_mode An empty shape-mode structure to fill, or NULL to check
|
|
||||||
* whether the window has a shape.
|
|
||||||
* \return 0 if the window has a shape and, provided shape_mode was not NULL,
|
|
||||||
* shape_mode has been filled with the mode data,
|
|
||||||
* SDL_NONSHAPEABLE_WINDOW if the SDL_Window given is not a shaped
|
|
||||||
* window, or SDL_WINDOW_LACKS_SHAPE if the SDL_Window given is a
|
|
||||||
* shapeable window currently lacking a shape.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_WindowShapeMode
|
|
||||||
* \sa SDL_SetWindowShape
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GetShapedWindowMode(SDL_Window *window,SDL_WindowShapeMode *shape_mode);
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include <SDL2/close_code.h>
|
|
||||||
|
|
||||||
#endif /* SDL_shape_h_ */
|
|
||||||
@@ -1,869 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2025 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* WIKI CATEGORY: StdInc */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* # CategoryStdInc
|
|
||||||
*
|
|
||||||
* This is a general header that includes C language support.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_stdinc_h_
|
|
||||||
#define SDL_stdinc_h_
|
|
||||||
|
|
||||||
#include <SDL2/SDL_config.h>
|
|
||||||
|
|
||||||
#ifdef HAVE_SYS_TYPES_H
|
|
||||||
#include <sys/types.h>
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_STDIO_H
|
|
||||||
#include <stdio.h>
|
|
||||||
#endif
|
|
||||||
#if defined(STDC_HEADERS)
|
|
||||||
# include <stdlib.h>
|
|
||||||
# include <stddef.h>
|
|
||||||
# include <stdarg.h>
|
|
||||||
#else
|
|
||||||
# if defined(HAVE_STDLIB_H)
|
|
||||||
# include <stdlib.h>
|
|
||||||
# elif defined(HAVE_MALLOC_H)
|
|
||||||
# include <malloc.h>
|
|
||||||
# endif
|
|
||||||
# if defined(HAVE_STDDEF_H)
|
|
||||||
# include <stddef.h>
|
|
||||||
# endif
|
|
||||||
# if defined(HAVE_STDARG_H)
|
|
||||||
# include <stdarg.h>
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_STRING_H
|
|
||||||
# if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
|
|
||||||
# include <memory.h>
|
|
||||||
# endif
|
|
||||||
# include <string.h>
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_STRINGS_H
|
|
||||||
# include <strings.h>
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_WCHAR_H
|
|
||||||
# include <wchar.h>
|
|
||||||
#endif
|
|
||||||
#if defined(HAVE_INTTYPES_H)
|
|
||||||
# include <inttypes.h>
|
|
||||||
#elif defined(HAVE_STDINT_H)
|
|
||||||
# include <stdint.h>
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_CTYPE_H
|
|
||||||
# include <ctype.h>
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_MATH_H
|
|
||||||
# if defined(_MSC_VER)
|
|
||||||
/* Defining _USE_MATH_DEFINES is required to get M_PI to be defined on
|
|
||||||
Visual Studio. See http://msdn.microsoft.com/en-us/library/4hwaceh6.aspx
|
|
||||||
for more information.
|
|
||||||
*/
|
|
||||||
# ifndef _USE_MATH_DEFINES
|
|
||||||
# define _USE_MATH_DEFINES
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
# include <math.h>
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_FLOAT_H
|
|
||||||
# include <float.h>
|
|
||||||
#endif
|
|
||||||
#if defined(HAVE_ALLOCA) && !defined(alloca)
|
|
||||||
# if defined(HAVE_ALLOCA_H)
|
|
||||||
# include <alloca.h>
|
|
||||||
# elif defined(__GNUC__)
|
|
||||||
# define alloca __builtin_alloca
|
|
||||||
# elif defined(_MSC_VER)
|
|
||||||
# include <malloc.h>
|
|
||||||
# define alloca _alloca
|
|
||||||
# elif defined(__WATCOMC__)
|
|
||||||
# include <malloc.h>
|
|
||||||
# elif defined(__BORLANDC__)
|
|
||||||
# include <malloc.h>
|
|
||||||
# elif defined(__DMC__)
|
|
||||||
# include <stdlib.h>
|
|
||||||
# elif defined(__AIX__)
|
|
||||||
#pragma alloca
|
|
||||||
# elif defined(__MRC__)
|
|
||||||
void *alloca(unsigned);
|
|
||||||
# else
|
|
||||||
void *alloca(size_t);
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef SIZE_MAX
|
|
||||||
# define SDL_SIZE_MAX SIZE_MAX
|
|
||||||
#else
|
|
||||||
# define SDL_SIZE_MAX ((size_t) -1)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check if the compiler supports a given builtin.
|
|
||||||
* Supported by virtually all clang versions and recent gcc. Use this
|
|
||||||
* instead of checking the clang version if possible.
|
|
||||||
*/
|
|
||||||
#ifdef __has_builtin
|
|
||||||
#define _SDL_HAS_BUILTIN(x) __has_builtin(x)
|
|
||||||
#else
|
|
||||||
#define _SDL_HAS_BUILTIN(x) 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The number of elements in an array.
|
|
||||||
*/
|
|
||||||
#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0]))
|
|
||||||
#define SDL_TABLESIZE(table) SDL_arraysize(table)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Macro useful for building other macros with strings in them
|
|
||||||
*
|
|
||||||
* e.g:
|
|
||||||
*
|
|
||||||
* ```c
|
|
||||||
* #define LOG_ERROR(X) OutputDebugString(SDL_STRINGIFY_ARG(__FUNCTION__) ": " X "\n")
|
|
||||||
* ```
|
|
||||||
*/
|
|
||||||
#define SDL_STRINGIFY_ARG(arg) #arg
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Cast operators
|
|
||||||
*
|
|
||||||
* Use proper C++ casts when compiled as C++ to be compatible with the option
|
|
||||||
* -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above).
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
#define SDL_reinterpret_cast(type, expression) reinterpret_cast<type>(expression)
|
|
||||||
#define SDL_static_cast(type, expression) static_cast<type>(expression)
|
|
||||||
#define SDL_const_cast(type, expression) const_cast<type>(expression)
|
|
||||||
#else
|
|
||||||
#define SDL_reinterpret_cast(type, expression) ((type)(expression))
|
|
||||||
#define SDL_static_cast(type, expression) ((type)(expression))
|
|
||||||
#define SDL_const_cast(type, expression) ((type)(expression))
|
|
||||||
#endif
|
|
||||||
/* @} *//* Cast operators */
|
|
||||||
|
|
||||||
/* Define a four character code as a Uint32 */
|
|
||||||
#define SDL_FOURCC(A, B, C, D) \
|
|
||||||
((SDL_static_cast(Uint32, SDL_static_cast(Uint8, (A))) << 0) | \
|
|
||||||
(SDL_static_cast(Uint32, SDL_static_cast(Uint8, (B))) << 8) | \
|
|
||||||
(SDL_static_cast(Uint32, SDL_static_cast(Uint8, (C))) << 16) | \
|
|
||||||
(SDL_static_cast(Uint32, SDL_static_cast(Uint8, (D))) << 24))
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Basic data types
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
|
|
||||||
#ifdef __CC_ARM
|
|
||||||
/* ARM's compiler throws warnings if we use an enum: like "SDL_bool x = a < b;" */
|
|
||||||
#define SDL_FALSE 0
|
|
||||||
#define SDL_TRUE 1
|
|
||||||
typedef int SDL_bool;
|
|
||||||
#else
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_FALSE = 0,
|
|
||||||
SDL_TRUE = 1
|
|
||||||
} SDL_bool;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A signed 8-bit integer type.
|
|
||||||
*/
|
|
||||||
typedef int8_t Sint8;
|
|
||||||
#define SDL_MAX_SINT8 ((Sint8)0x7F) /* 127 */
|
|
||||||
#define SDL_MIN_SINT8 ((Sint8)(~0x7F)) /* -128 */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* An unsigned 8-bit integer type.
|
|
||||||
*/
|
|
||||||
typedef uint8_t Uint8;
|
|
||||||
#define SDL_MAX_UINT8 ((Uint8)0xFF) /* 255 */
|
|
||||||
#define SDL_MIN_UINT8 ((Uint8)0x00) /* 0 */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A signed 16-bit integer type.
|
|
||||||
*/
|
|
||||||
typedef int16_t Sint16;
|
|
||||||
#define SDL_MAX_SINT16 ((Sint16)0x7FFF) /* 32767 */
|
|
||||||
#define SDL_MIN_SINT16 ((Sint16)(~0x7FFF)) /* -32768 */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* An unsigned 16-bit integer type.
|
|
||||||
*/
|
|
||||||
typedef uint16_t Uint16;
|
|
||||||
#define SDL_MAX_UINT16 ((Uint16)0xFFFF) /* 65535 */
|
|
||||||
#define SDL_MIN_UINT16 ((Uint16)0x0000) /* 0 */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A signed 32-bit integer type.
|
|
||||||
*/
|
|
||||||
typedef int32_t Sint32;
|
|
||||||
#define SDL_MAX_SINT32 ((Sint32)0x7FFFFFFF) /* 2147483647 */
|
|
||||||
#define SDL_MIN_SINT32 ((Sint32)(~0x7FFFFFFF)) /* -2147483648 */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* An unsigned 32-bit integer type.
|
|
||||||
*/
|
|
||||||
typedef uint32_t Uint32;
|
|
||||||
#define SDL_MAX_UINT32 ((Uint32)0xFFFFFFFFu) /* 4294967295 */
|
|
||||||
#define SDL_MIN_UINT32 ((Uint32)0x00000000) /* 0 */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A signed 64-bit integer type.
|
|
||||||
*/
|
|
||||||
typedef int64_t Sint64;
|
|
||||||
#define SDL_MAX_SINT64 ((Sint64)0x7FFFFFFFFFFFFFFFll) /* 9223372036854775807 */
|
|
||||||
#define SDL_MIN_SINT64 ((Sint64)(~0x7FFFFFFFFFFFFFFFll)) /* -9223372036854775808 */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* An unsigned 64-bit integer type.
|
|
||||||
*/
|
|
||||||
typedef uint64_t Uint64;
|
|
||||||
#define SDL_MAX_UINT64 ((Uint64)0xFFFFFFFFFFFFFFFFull) /* 18446744073709551615 */
|
|
||||||
#define SDL_MIN_UINT64 ((Uint64)(0x0000000000000000ull)) /* 0 */
|
|
||||||
|
|
||||||
|
|
||||||
/* @} *//* Basic data types */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Floating-point constants
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
|
|
||||||
#ifdef FLT_EPSILON
|
|
||||||
#define SDL_FLT_EPSILON FLT_EPSILON
|
|
||||||
#else
|
|
||||||
#define SDL_FLT_EPSILON 1.1920928955078125e-07F /* 0x0.000002p0 */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* @} *//* Floating-point constants */
|
|
||||||
|
|
||||||
/* Make sure we have macros for printing width-based integers.
|
|
||||||
* <stdint.h> should define these but this is not true all platforms.
|
|
||||||
* (for example win32) */
|
|
||||||
#ifndef SDL_PRIs64
|
|
||||||
#if defined(__WIN32__) || defined(__GDK__)
|
|
||||||
#define SDL_PRIs64 "I64d"
|
|
||||||
#elif defined(PRId64)
|
|
||||||
#define SDL_PRIs64 PRId64
|
|
||||||
#elif defined(__LP64__) && !defined(__APPLE__) && !defined(__EMSCRIPTEN__)
|
|
||||||
#define SDL_PRIs64 "ld"
|
|
||||||
#else
|
|
||||||
#define SDL_PRIs64 "lld"
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_PRIu64
|
|
||||||
#if defined(__WIN32__) || defined(__GDK__)
|
|
||||||
#define SDL_PRIu64 "I64u"
|
|
||||||
#elif defined(PRIu64)
|
|
||||||
#define SDL_PRIu64 PRIu64
|
|
||||||
#elif defined(__LP64__) && !defined(__APPLE__)
|
|
||||||
#define SDL_PRIu64 "lu"
|
|
||||||
#else
|
|
||||||
#define SDL_PRIu64 "llu"
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_PRIx64
|
|
||||||
#if defined(__WIN32__) || defined(__GDK__)
|
|
||||||
#define SDL_PRIx64 "I64x"
|
|
||||||
#elif defined(PRIx64)
|
|
||||||
#define SDL_PRIx64 PRIx64
|
|
||||||
#elif defined(__LP64__) && !defined(__APPLE__)
|
|
||||||
#define SDL_PRIx64 "lx"
|
|
||||||
#else
|
|
||||||
#define SDL_PRIx64 "llx"
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_PRIX64
|
|
||||||
#if defined(__WIN32__) || defined(__GDK__)
|
|
||||||
#define SDL_PRIX64 "I64X"
|
|
||||||
#elif defined(PRIX64)
|
|
||||||
#define SDL_PRIX64 PRIX64
|
|
||||||
#elif defined(__LP64__) && !defined(__APPLE__)
|
|
||||||
#define SDL_PRIX64 "lX"
|
|
||||||
#else
|
|
||||||
#define SDL_PRIX64 "llX"
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_PRIs32
|
|
||||||
#ifdef PRId32
|
|
||||||
#define SDL_PRIs32 PRId32
|
|
||||||
#else
|
|
||||||
#define SDL_PRIs32 "d"
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_PRIu32
|
|
||||||
#ifdef PRIu32
|
|
||||||
#define SDL_PRIu32 PRIu32
|
|
||||||
#else
|
|
||||||
#define SDL_PRIu32 "u"
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_PRIx32
|
|
||||||
#ifdef PRIx32
|
|
||||||
#define SDL_PRIx32 PRIx32
|
|
||||||
#else
|
|
||||||
#define SDL_PRIx32 "x"
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_PRIX32
|
|
||||||
#ifdef PRIX32
|
|
||||||
#define SDL_PRIX32 PRIX32
|
|
||||||
#else
|
|
||||||
#define SDL_PRIX32 "X"
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Annotations to help code analysis tools */
|
|
||||||
#ifdef SDL_DISABLE_ANALYZE_MACROS
|
|
||||||
#define SDL_IN_BYTECAP(x)
|
|
||||||
#define SDL_INOUT_Z_CAP(x)
|
|
||||||
#define SDL_OUT_Z_CAP(x)
|
|
||||||
#define SDL_OUT_CAP(x)
|
|
||||||
#define SDL_OUT_BYTECAP(x)
|
|
||||||
#define SDL_OUT_Z_BYTECAP(x)
|
|
||||||
#define SDL_PRINTF_FORMAT_STRING
|
|
||||||
#define SDL_SCANF_FORMAT_STRING
|
|
||||||
#define SDL_PRINTF_VARARG_FUNC( fmtargnumber )
|
|
||||||
#define SDL_PRINTF_VARARG_FUNCV( fmtargnumber )
|
|
||||||
#define SDL_SCANF_VARARG_FUNC( fmtargnumber )
|
|
||||||
#define SDL_SCANF_VARARG_FUNCV( fmtargnumber )
|
|
||||||
#else
|
|
||||||
#if defined(_MSC_VER) && (_MSC_VER >= 1600) /* VS 2010 and above */
|
|
||||||
#include <sal.h>
|
|
||||||
|
|
||||||
#define SDL_IN_BYTECAP(x) _In_bytecount_(x)
|
|
||||||
#define SDL_INOUT_Z_CAP(x) _Inout_z_cap_(x)
|
|
||||||
#define SDL_OUT_Z_CAP(x) _Out_z_cap_(x)
|
|
||||||
#define SDL_OUT_CAP(x) _Out_cap_(x)
|
|
||||||
#define SDL_OUT_BYTECAP(x) _Out_bytecap_(x)
|
|
||||||
#define SDL_OUT_Z_BYTECAP(x) _Out_z_bytecap_(x)
|
|
||||||
|
|
||||||
#define SDL_PRINTF_FORMAT_STRING _Printf_format_string_
|
|
||||||
#define SDL_SCANF_FORMAT_STRING _Scanf_format_string_impl_
|
|
||||||
#else
|
|
||||||
#define SDL_IN_BYTECAP(x)
|
|
||||||
#define SDL_INOUT_Z_CAP(x)
|
|
||||||
#define SDL_OUT_Z_CAP(x)
|
|
||||||
#define SDL_OUT_CAP(x)
|
|
||||||
#define SDL_OUT_BYTECAP(x)
|
|
||||||
#define SDL_OUT_Z_BYTECAP(x)
|
|
||||||
#define SDL_PRINTF_FORMAT_STRING
|
|
||||||
#define SDL_SCANF_FORMAT_STRING
|
|
||||||
#endif
|
|
||||||
#if defined(__GNUC__)
|
|
||||||
#define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __printf__, fmtargnumber, fmtargnumber+1 )))
|
|
||||||
#define SDL_PRINTF_VARARG_FUNCV( fmtargnumber ) __attribute__(( format( __printf__, fmtargnumber, 0 )))
|
|
||||||
#define SDL_SCANF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __scanf__, fmtargnumber, fmtargnumber+1 )))
|
|
||||||
#define SDL_SCANF_VARARG_FUNCV( fmtargnumber ) __attribute__(( format( __scanf__, fmtargnumber, 0 )))
|
|
||||||
#else
|
|
||||||
#define SDL_PRINTF_VARARG_FUNC( fmtargnumber )
|
|
||||||
#define SDL_PRINTF_VARARG_FUNCV( fmtargnumber )
|
|
||||||
#define SDL_SCANF_VARARG_FUNC( fmtargnumber )
|
|
||||||
#define SDL_SCANF_VARARG_FUNCV( fmtargnumber )
|
|
||||||
#endif
|
|
||||||
#endif /* SDL_DISABLE_ANALYZE_MACROS */
|
|
||||||
|
|
||||||
#ifndef SDL_COMPILE_TIME_ASSERT
|
|
||||||
#if defined(__cplusplus)
|
|
||||||
/* Keep C++ case alone: Some versions of gcc will define __STDC_VERSION__ even when compiling in C++ mode. */
|
|
||||||
#if (__cplusplus >= 201103L)
|
|
||||||
#define SDL_COMPILE_TIME_ASSERT(name, x) static_assert(x, #x)
|
|
||||||
#endif
|
|
||||||
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202311L)
|
|
||||||
#define SDL_COMPILE_TIME_ASSERT(name, x) static_assert(x, #x)
|
|
||||||
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
|
|
||||||
#define SDL_COMPILE_TIME_ASSERT(name, x) _Static_assert(x, #x)
|
|
||||||
#endif
|
|
||||||
#endif /* !SDL_COMPILE_TIME_ASSERT */
|
|
||||||
|
|
||||||
#ifndef SDL_COMPILE_TIME_ASSERT
|
|
||||||
/* universal, but may trigger -Wunused-local-typedefs */
|
|
||||||
#define SDL_COMPILE_TIME_ASSERT(name, x) \
|
|
||||||
typedef int SDL_compile_time_assert_ ## name[(x) * 2 - 1]
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** \cond */
|
|
||||||
#ifndef DOXYGEN_SHOULD_IGNORE_THIS
|
|
||||||
SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1);
|
|
||||||
SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1);
|
|
||||||
SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2);
|
|
||||||
SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2);
|
|
||||||
SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4);
|
|
||||||
SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4);
|
|
||||||
SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8);
|
|
||||||
SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
|
|
||||||
#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
|
|
||||||
/** \endcond */
|
|
||||||
|
|
||||||
/* Check to make sure enums are the size of ints, for structure packing.
|
|
||||||
For both Watcom C/C++ and Borland C/C++ the compiler option that makes
|
|
||||||
enums having the size of an int must be enabled.
|
|
||||||
This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11).
|
|
||||||
*/
|
|
||||||
|
|
||||||
/** \cond */
|
|
||||||
#ifndef DOXYGEN_SHOULD_IGNORE_THIS
|
|
||||||
#if !defined(__VITA__) && !defined(__3DS__)
|
|
||||||
/* TODO: include/SDL_stdinc.h:422: error: size of array 'SDL_dummy_enum' is negative */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
DUMMY_ENUM_VALUE
|
|
||||||
} SDL_DUMMY_ENUM;
|
|
||||||
|
|
||||||
SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int));
|
|
||||||
#endif
|
|
||||||
#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
|
|
||||||
/** \endcond */
|
|
||||||
|
|
||||||
#include <SDL2/begin_code.h>
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_ALLOCA
|
|
||||||
#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*(count))
|
|
||||||
#define SDL_stack_free(data)
|
|
||||||
#else
|
|
||||||
#define SDL_stack_alloc(type, count) (type*)SDL_malloc(sizeof(type)*(count))
|
|
||||||
#define SDL_stack_free(data) SDL_free(data)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern DECLSPEC void *SDLCALL SDL_malloc(size_t size);
|
|
||||||
extern DECLSPEC void *SDLCALL SDL_calloc(size_t nmemb, size_t size);
|
|
||||||
extern DECLSPEC void *SDLCALL SDL_realloc(void *mem, size_t size);
|
|
||||||
extern DECLSPEC void SDLCALL SDL_free(void *mem);
|
|
||||||
|
|
||||||
typedef void *(SDLCALL *SDL_malloc_func)(size_t size);
|
|
||||||
typedef void *(SDLCALL *SDL_calloc_func)(size_t nmemb, size_t size);
|
|
||||||
typedef void *(SDLCALL *SDL_realloc_func)(void *mem, size_t size);
|
|
||||||
typedef void (SDLCALL *SDL_free_func)(void *mem);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the original set of SDL memory functions
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.24.0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_GetOriginalMemoryFunctions(SDL_malloc_func *malloc_func,
|
|
||||||
SDL_calloc_func *calloc_func,
|
|
||||||
SDL_realloc_func *realloc_func,
|
|
||||||
SDL_free_func *free_func);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the current set of SDL memory functions
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.7.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_GetMemoryFunctions(SDL_malloc_func *malloc_func,
|
|
||||||
SDL_calloc_func *calloc_func,
|
|
||||||
SDL_realloc_func *realloc_func,
|
|
||||||
SDL_free_func *free_func);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Replace SDL's memory allocation functions with a custom set
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.7.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SetMemoryFunctions(SDL_malloc_func malloc_func,
|
|
||||||
SDL_calloc_func calloc_func,
|
|
||||||
SDL_realloc_func realloc_func,
|
|
||||||
SDL_free_func free_func);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the number of outstanding (unfreed) allocations
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.7.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GetNumAllocations(void);
|
|
||||||
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_getenv(const char *name);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_setenv(const char *name, const char *value, int overwrite);
|
|
||||||
|
|
||||||
typedef int (SDLCALL *SDL_CompareCallback)(const void *, const void *);
|
|
||||||
extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, SDL_CompareCallback compare);
|
|
||||||
extern DECLSPEC void * SDLCALL SDL_bsearch(const void *key, const void *base, size_t nmemb, size_t size, SDL_CompareCallback compare);
|
|
||||||
|
|
||||||
extern DECLSPEC int SDLCALL SDL_abs(int x);
|
|
||||||
|
|
||||||
/* NOTE: these double-evaluate their arguments, so you should never have side effects in the parameters */
|
|
||||||
#define SDL_min(x, y) (((x) < (y)) ? (x) : (y))
|
|
||||||
#define SDL_max(x, y) (((x) > (y)) ? (x) : (y))
|
|
||||||
#define SDL_clamp(x, a, b) (((x) < (a)) ? (a) : (((x) > (b)) ? (b) : (x)))
|
|
||||||
|
|
||||||
extern DECLSPEC int SDLCALL SDL_isalpha(int x);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_isalnum(int x);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_isblank(int x);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_iscntrl(int x);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_isdigit(int x);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_isxdigit(int x);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_ispunct(int x);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_isspace(int x);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_isupper(int x);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_islower(int x);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_isprint(int x);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_isgraph(int x);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_toupper(int x);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_tolower(int x);
|
|
||||||
|
|
||||||
extern DECLSPEC Uint16 SDLCALL SDL_crc16(Uint16 crc, const void *data, size_t len);
|
|
||||||
extern DECLSPEC Uint32 SDLCALL SDL_crc32(Uint32 crc, const void *data, size_t len);
|
|
||||||
|
|
||||||
extern DECLSPEC void *SDLCALL SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len);
|
|
||||||
|
|
||||||
/* Some safe(r) macros for zero'ing structures... */
|
|
||||||
#define SDL_zero(x) SDL_memset(&(x), 0, sizeof((x)))
|
|
||||||
#define SDL_zerop(x) SDL_memset((x), 0, sizeof(*(x)))
|
|
||||||
#define SDL_zeroa(x) SDL_memset((x), 0, sizeof((x)))
|
|
||||||
|
|
||||||
#define SDL_copyp(dst, src) \
|
|
||||||
{ SDL_COMPILE_TIME_ASSERT(SDL_copyp, sizeof (*(dst)) == sizeof (*(src))); } \
|
|
||||||
SDL_memcpy((dst), (src), sizeof (*(src)))
|
|
||||||
|
|
||||||
|
|
||||||
/* Note that memset() is a byte assignment and this is a 32-bit assignment, so they're not directly equivalent. */
|
|
||||||
SDL_FORCE_INLINE void SDL_memset4(void *dst, Uint32 val, size_t dwords)
|
|
||||||
{
|
|
||||||
#if defined(__GNUC__) && defined(__i386__)
|
|
||||||
int u0, u1, u2;
|
|
||||||
__asm__ __volatile__ (
|
|
||||||
"cld \n\t"
|
|
||||||
"rep ; stosl \n\t"
|
|
||||||
: "=&D" (u0), "=&a" (u1), "=&c" (u2)
|
|
||||||
: "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, dwords))
|
|
||||||
: "memory"
|
|
||||||
);
|
|
||||||
#else
|
|
||||||
size_t _n = (dwords + 3) / 4;
|
|
||||||
Uint32 *_p = SDL_static_cast(Uint32 *, dst);
|
|
||||||
Uint32 _val = (val);
|
|
||||||
if (dwords == 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
switch (dwords % 4) {
|
|
||||||
case 0: do { *_p++ = _val; SDL_FALLTHROUGH;
|
|
||||||
case 3: *_p++ = _val; SDL_FALLTHROUGH;
|
|
||||||
case 2: *_p++ = _val; SDL_FALLTHROUGH;
|
|
||||||
case 1: *_p++ = _val;
|
|
||||||
} while ( --_n );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
extern DECLSPEC void *SDLCALL SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len);
|
|
||||||
|
|
||||||
extern DECLSPEC void *SDLCALL SDL_memmove(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len);
|
|
||||||
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_wcslen(const wchar_t *wstr);
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_wcslcpy(SDL_OUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen);
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_wcslcat(SDL_INOUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen);
|
|
||||||
extern DECLSPEC wchar_t *SDLCALL SDL_wcsdup(const wchar_t *wstr);
|
|
||||||
extern DECLSPEC wchar_t *SDLCALL SDL_wcsstr(const wchar_t *haystack, const wchar_t *needle);
|
|
||||||
|
|
||||||
extern DECLSPEC int SDLCALL SDL_wcscmp(const wchar_t *str1, const wchar_t *str2);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_wcsncmp(const wchar_t *str1, const wchar_t *str2, size_t maxlen);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_wcscasecmp(const wchar_t *str1, const wchar_t *str2);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_wcsncasecmp(const wchar_t *str1, const wchar_t *str2, size_t len);
|
|
||||||
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_strlen(const char *str);
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_strlcpy(SDL_OUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen);
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_utf8strlcpy(SDL_OUT_Z_CAP(dst_bytes) char *dst, const char *src, size_t dst_bytes);
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_strlcat(SDL_INOUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen);
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_strdup(const char *str);
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_strrev(char *str);
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_strupr(char *str);
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_strlwr(char *str);
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_strchr(const char *str, int c);
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_strrchr(const char *str, int c);
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_strstr(const char *haystack, const char *needle);
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_strcasestr(const char *haystack, const char *needle);
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_strtokr(char *s1, const char *s2, char **saveptr);
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_utf8strlen(const char *str);
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_utf8strnlen(const char *str, size_t bytes);
|
|
||||||
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_itoa(int value, char *str, int radix);
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_uitoa(unsigned int value, char *str, int radix);
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_ltoa(long value, char *str, int radix);
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_ultoa(unsigned long value, char *str, int radix);
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_lltoa(Sint64 value, char *str, int radix);
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_ulltoa(Uint64 value, char *str, int radix);
|
|
||||||
|
|
||||||
extern DECLSPEC int SDLCALL SDL_atoi(const char *str);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_atof(const char *str);
|
|
||||||
extern DECLSPEC long SDLCALL SDL_strtol(const char *str, char **endp, int base);
|
|
||||||
extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *str, char **endp, int base);
|
|
||||||
extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *str, char **endp, int base);
|
|
||||||
extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *str, char **endp, int base);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_strtod(const char *str, char **endp);
|
|
||||||
|
|
||||||
extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t len);
|
|
||||||
|
|
||||||
extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, ...) SDL_SCANF_VARARG_FUNC(2);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_vsscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, va_list ap) SDL_SCANF_VARARG_FUNCV(2);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_snprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, ... ) SDL_PRINTF_VARARG_FUNC(3);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap) SDL_PRINTF_VARARG_FUNCV(3);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_asprintf(char **strp, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_vasprintf(char **strp, SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap) SDL_PRINTF_VARARG_FUNCV(2);
|
|
||||||
|
|
||||||
#ifndef HAVE_M_PI
|
|
||||||
#ifndef M_PI
|
|
||||||
#define M_PI 3.14159265358979323846264338327950288 /**< pi */
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Use this function to compute arc cosine of `x`.
|
|
||||||
*
|
|
||||||
* The definition of `y = acos(x)` is `x = cos(y)`.
|
|
||||||
*
|
|
||||||
* Domain: `-1 <= x <= 1`
|
|
||||||
*
|
|
||||||
* Range: `0 <= y <= Pi`
|
|
||||||
*
|
|
||||||
* \param x floating point value, in radians.
|
|
||||||
* \returns arc cosine of `x`.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.2.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC double SDLCALL SDL_acos(double x);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_acosf(float x);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_asin(double x);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_asinf(float x);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_atan(double x);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_atanf(float x);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_atan2(double y, double x);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_atan2f(float y, float x);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_ceil(double x);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_ceilf(float x);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_copysign(double x, double y);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_copysignf(float x, float y);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_cos(double x);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_cosf(float x);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_exp(double x);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_expf(float x);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_fabs(double x);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_fabsf(float x);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_floor(double x);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_floorf(float x);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_trunc(double x);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_truncf(float x);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_fmod(double x, double y);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_fmodf(float x, float y);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_log(double x);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_logf(float x);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_log10(double x);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_log10f(float x);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_pow(double x, double y);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_powf(float x, float y);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_round(double x);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_roundf(float x);
|
|
||||||
extern DECLSPEC long SDLCALL SDL_lround(double x);
|
|
||||||
extern DECLSPEC long SDLCALL SDL_lroundf(float x);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_scalbn(double x, int n);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_scalbnf(float x, int n);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_sin(double x);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_sinf(float x);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_sqrt(double x);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_sqrtf(float x);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_tan(double x);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_tanf(float x);
|
|
||||||
|
|
||||||
/* The SDL implementation of iconv() returns these error codes */
|
|
||||||
#define SDL_ICONV_ERROR (size_t)-1
|
|
||||||
#define SDL_ICONV_E2BIG (size_t)-2
|
|
||||||
#define SDL_ICONV_EILSEQ (size_t)-3
|
|
||||||
#define SDL_ICONV_EINVAL (size_t)-4
|
|
||||||
|
|
||||||
/* SDL_iconv_* are now always real symbols/types, not macros or inlined. */
|
|
||||||
typedef struct _SDL_iconv_t *SDL_iconv_t;
|
|
||||||
extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode,
|
|
||||||
const char *fromcode);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd);
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf,
|
|
||||||
size_t * inbytesleft, char **outbuf,
|
|
||||||
size_t * outbytesleft);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function converts a buffer or string between encodings in one pass,
|
|
||||||
* returning a string that must be freed with SDL_free() or NULL on error.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode,
|
|
||||||
const char *fromcode,
|
|
||||||
const char *inbuf,
|
|
||||||
size_t inbytesleft);
|
|
||||||
|
|
||||||
/* Some helper macros for common cases... */
|
|
||||||
#define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1)
|
|
||||||
#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1)
|
|
||||||
#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1)
|
|
||||||
#define SDL_iconv_wchar_utf8(S) SDL_iconv_string("UTF-8", "WCHAR_T", (char *)S, (SDL_wcslen(S)+1)*sizeof(wchar_t))
|
|
||||||
|
|
||||||
/* force builds using Clang's static analysis tools to use literal C runtime
|
|
||||||
here, since there are possibly tests that are ineffective otherwise. */
|
|
||||||
#if defined(__clang_analyzer__) && !defined(SDL_DISABLE_ANALYZE_MACROS)
|
|
||||||
|
|
||||||
/* The analyzer knows about strlcpy even when the system doesn't provide it */
|
|
||||||
#ifndef HAVE_STRLCPY
|
|
||||||
size_t strlcpy(char* dst, const char* src, size_t size);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* The analyzer knows about strlcat even when the system doesn't provide it */
|
|
||||||
#ifndef HAVE_STRLCAT
|
|
||||||
size_t strlcat(char* dst, const char* src, size_t size);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef HAVE_WCSLCPY
|
|
||||||
size_t wcslcpy(wchar_t *dst, const wchar_t *src, size_t size);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef HAVE_WCSLCAT
|
|
||||||
size_t wcslcat(wchar_t *dst, const wchar_t *src, size_t size);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* strdup is not ANSI but POSIX, and its prototype might be hidden... */
|
|
||||||
char *strdup(const char *str);
|
|
||||||
|
|
||||||
/* Starting LLVM 16, the analyser errors out if these functions do not have
|
|
||||||
their prototype defined (clang-diagnostic-implicit-function-declaration) */
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#define SDL_malloc malloc
|
|
||||||
#define SDL_calloc calloc
|
|
||||||
#define SDL_realloc realloc
|
|
||||||
#define SDL_free free
|
|
||||||
#define SDL_memset memset
|
|
||||||
#define SDL_memcpy memcpy
|
|
||||||
#define SDL_memmove memmove
|
|
||||||
#define SDL_memcmp memcmp
|
|
||||||
#define SDL_strlcpy strlcpy
|
|
||||||
#define SDL_strlcat strlcat
|
|
||||||
#define SDL_strlen strlen
|
|
||||||
#define SDL_wcslen wcslen
|
|
||||||
#define SDL_wcslcpy wcslcpy
|
|
||||||
#define SDL_wcslcat wcslcat
|
|
||||||
#define SDL_strdup strdup
|
|
||||||
#define SDL_wcsdup wcsdup
|
|
||||||
#define SDL_strchr strchr
|
|
||||||
#define SDL_strrchr strrchr
|
|
||||||
#define SDL_strstr strstr
|
|
||||||
#define SDL_wcsstr wcsstr
|
|
||||||
#define SDL_strtokr strtok_r
|
|
||||||
#define SDL_strcmp strcmp
|
|
||||||
#define SDL_wcscmp wcscmp
|
|
||||||
#define SDL_strncmp strncmp
|
|
||||||
#define SDL_wcsncmp wcsncmp
|
|
||||||
#define SDL_strcasecmp strcasecmp
|
|
||||||
#define SDL_strncasecmp strncasecmp
|
|
||||||
#define SDL_sscanf sscanf
|
|
||||||
#define SDL_vsscanf vsscanf
|
|
||||||
#define SDL_snprintf snprintf
|
|
||||||
#define SDL_vsnprintf vsnprintf
|
|
||||||
#endif
|
|
||||||
|
|
||||||
SDL_FORCE_INLINE void *SDL_memcpy4(SDL_OUT_BYTECAP(dwords*4) void *dst, SDL_IN_BYTECAP(dwords*4) const void *src, size_t dwords)
|
|
||||||
{
|
|
||||||
return SDL_memcpy(dst, src, dwords * 4);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* If a * b would overflow, return -1.
|
|
||||||
*
|
|
||||||
* Otherwise store a * b via ret and return 0.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.24.0.
|
|
||||||
*/
|
|
||||||
SDL_FORCE_INLINE int SDL_size_mul_overflow (size_t a,
|
|
||||||
size_t b,
|
|
||||||
size_t *ret)
|
|
||||||
{
|
|
||||||
if (a != 0 && b > SDL_SIZE_MAX / a) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
*ret = a * b;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if _SDL_HAS_BUILTIN(__builtin_mul_overflow)
|
|
||||||
/* This needs to be wrapped in an inline rather than being a direct #define,
|
|
||||||
* because __builtin_mul_overflow() is type-generic, but we want to be
|
|
||||||
* consistent about interpreting a and b as size_t. */
|
|
||||||
SDL_FORCE_INLINE int _SDL_size_mul_overflow_builtin (size_t a,
|
|
||||||
size_t b,
|
|
||||||
size_t *ret)
|
|
||||||
{
|
|
||||||
return __builtin_mul_overflow(a, b, ret) == 0 ? 0 : -1;
|
|
||||||
}
|
|
||||||
#define SDL_size_mul_overflow(a, b, ret) (_SDL_size_mul_overflow_builtin(a, b, ret))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* If a + b would overflow, return -1.
|
|
||||||
*
|
|
||||||
* Otherwise store a + b via ret and return 0.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.24.0.
|
|
||||||
*/
|
|
||||||
SDL_FORCE_INLINE int SDL_size_add_overflow (size_t a,
|
|
||||||
size_t b,
|
|
||||||
size_t *ret)
|
|
||||||
{
|
|
||||||
if (b > SDL_SIZE_MAX - a) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
*ret = a + b;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if _SDL_HAS_BUILTIN(__builtin_add_overflow)
|
|
||||||
/* This needs to be wrapped in an inline rather than being a direct #define,
|
|
||||||
* the same as the call to __builtin_mul_overflow() above. */
|
|
||||||
SDL_FORCE_INLINE int _SDL_size_add_overflow_builtin (size_t a,
|
|
||||||
size_t b,
|
|
||||||
size_t *ret)
|
|
||||||
{
|
|
||||||
return __builtin_add_overflow(a, b, ret) == 0 ? 0 : -1;
|
|
||||||
}
|
|
||||||
#define SDL_size_add_overflow(a, b, ret) (_SDL_size_add_overflow_builtin(a, b, ret))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include <SDL2/close_code.h>
|
|
||||||
|
|
||||||
#endif /* SDL_stdinc_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,642 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2025 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* # CategorySystem
|
|
||||||
*
|
|
||||||
* Include file for platform specific SDL API functions
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_system_h_
|
|
||||||
#define SDL_system_h_
|
|
||||||
|
|
||||||
#include <SDL2/SDL_stdinc.h>
|
|
||||||
#include <SDL2/SDL_keyboard.h>
|
|
||||||
#include <SDL2/SDL_render.h>
|
|
||||||
#include <SDL2/SDL_video.h>
|
|
||||||
|
|
||||||
#include <SDL2/begin_code.h>
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* Platform specific functions for Windows */
|
|
||||||
#if defined(__WIN32__) || defined(__GDK__)
|
|
||||||
|
|
||||||
typedef void (SDLCALL * SDL_WindowsMessageHook)(void *userdata, void *hWnd, unsigned int message, Uint64 wParam, Sint64 lParam);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set a callback for every Windows message, run before TranslateMessage().
|
|
||||||
*
|
|
||||||
* \param callback The SDL_WindowsMessageHook function to call.
|
|
||||||
* \param userdata a pointer to pass to every iteration of `callback`.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.4.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata);
|
|
||||||
|
|
||||||
#endif /* defined(__WIN32__) || defined(__GDK__) */
|
|
||||||
|
|
||||||
#if defined(__WIN32__) || defined(__WINGDK__)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the D3D9 adapter index that matches the specified display index.
|
|
||||||
*
|
|
||||||
* The returned adapter index can be passed to `IDirect3D9::CreateDevice` and
|
|
||||||
* controls on which monitor a full screen application will appear.
|
|
||||||
*
|
|
||||||
* \param displayIndex the display index for which to get the D3D9 adapter
|
|
||||||
* index.
|
|
||||||
* \returns the D3D9 adapter index on success or a negative error code on
|
|
||||||
* failure; call SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.1.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex( int displayIndex );
|
|
||||||
|
|
||||||
typedef struct IDirect3DDevice9 IDirect3DDevice9;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the D3D9 device associated with a renderer.
|
|
||||||
*
|
|
||||||
* Once you are done using the device, you should release it to avoid a
|
|
||||||
* resource leak.
|
|
||||||
*
|
|
||||||
* \param renderer the renderer from which to get the associated D3D device.
|
|
||||||
* \returns the D3D9 device associated with given renderer or NULL if it is
|
|
||||||
* not a D3D9 renderer; call SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.1.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC IDirect3DDevice9* SDLCALL SDL_RenderGetD3D9Device(SDL_Renderer * renderer);
|
|
||||||
|
|
||||||
typedef struct ID3D11Device ID3D11Device;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the D3D11 device associated with a renderer.
|
|
||||||
*
|
|
||||||
* Once you are done using the device, you should release it to avoid a
|
|
||||||
* resource leak.
|
|
||||||
*
|
|
||||||
* \param renderer the renderer from which to get the associated D3D11 device.
|
|
||||||
* \returns the D3D11 device associated with given renderer or NULL if it is
|
|
||||||
* not a D3D11 renderer; call SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.16.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC ID3D11Device* SDLCALL SDL_RenderGetD3D11Device(SDL_Renderer * renderer);
|
|
||||||
|
|
||||||
#endif /* defined(__WIN32__) || defined(__WINGDK__) */
|
|
||||||
|
|
||||||
#if defined(__WIN32__) || defined(__GDK__)
|
|
||||||
|
|
||||||
typedef struct ID3D12Device ID3D12Device;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the D3D12 device associated with a renderer.
|
|
||||||
*
|
|
||||||
* Once you are done using the device, you should release it to avoid a
|
|
||||||
* resource leak.
|
|
||||||
*
|
|
||||||
* \param renderer the renderer from which to get the associated D3D12 device.
|
|
||||||
* \returns the D3D12 device associated with given renderer or NULL if it is
|
|
||||||
* not a D3D12 renderer; call SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.24.0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC ID3D12Device* SDLCALL SDL_RenderGetD3D12Device(SDL_Renderer* renderer);
|
|
||||||
|
|
||||||
#endif /* defined(__WIN32__) || defined(__GDK__) */
|
|
||||||
|
|
||||||
#if defined(__WIN32__) || defined(__WINGDK__)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the DXGI Adapter and Output indices for the specified display index.
|
|
||||||
*
|
|
||||||
* The DXGI Adapter and Output indices can be passed to `EnumAdapters` and
|
|
||||||
* `EnumOutputs` respectively to get the objects required to create a DX10 or
|
|
||||||
* DX11 device and swap chain.
|
|
||||||
*
|
|
||||||
* Before SDL 2.0.4 this function did not return a value. Since SDL 2.0.4 it
|
|
||||||
* returns an SDL_bool.
|
|
||||||
*
|
|
||||||
* \param displayIndex the display index for which to get both indices.
|
|
||||||
* \param adapterIndex a pointer to be filled in with the adapter index.
|
|
||||||
* \param outputIndex a pointer to be filled in with the output index.
|
|
||||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
|
||||||
* for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.2.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo( int displayIndex, int *adapterIndex, int *outputIndex );
|
|
||||||
|
|
||||||
#endif /* defined(__WIN32__) || defined(__WINGDK__) */
|
|
||||||
|
|
||||||
/* Platform specific functions for Linux */
|
|
||||||
#ifdef __LINUX__
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the UNIX nice value for a thread.
|
|
||||||
*
|
|
||||||
* This uses setpriority() if possible, and RealtimeKit if available.
|
|
||||||
*
|
|
||||||
* \param threadID the Unix thread ID to change priority of.
|
|
||||||
* \param priority The new, Unix-specific, priority value.
|
|
||||||
* \returns 0 on success, or -1 on error.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.9.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int priority);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the priority (not nice level) and scheduling policy for a thread.
|
|
||||||
*
|
|
||||||
* This uses setpriority() if possible, and RealtimeKit if available.
|
|
||||||
*
|
|
||||||
* \param threadID The Unix thread ID to change priority of.
|
|
||||||
* \param sdlPriority The new SDL_ThreadPriority value.
|
|
||||||
* \param schedPolicy The new scheduling policy (SCHED_FIFO, SCHED_RR,
|
|
||||||
* SCHED_OTHER, etc...).
|
|
||||||
* \returns 0 on success, or -1 on error.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.18.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy);
|
|
||||||
|
|
||||||
#endif /* __LINUX__ */
|
|
||||||
|
|
||||||
/* Platform specific functions for iOS */
|
|
||||||
#ifdef __IPHONEOS__
|
|
||||||
|
|
||||||
typedef void (SDLCALL *SDL_iOSAnimationCallback)(void*);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Use this function to set the animation callback on Apple iOS.
|
|
||||||
*
|
|
||||||
* The function prototype for `callback` is:
|
|
||||||
*
|
|
||||||
* ```c
|
|
||||||
* void callback(void* callbackParam);
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* Where its parameter, `callbackParam`, is what was passed as `callbackParam`
|
|
||||||
* to SDL_iPhoneSetAnimationCallback().
|
|
||||||
*
|
|
||||||
* This function is only available on Apple iOS.
|
|
||||||
*
|
|
||||||
* For more information see:
|
|
||||||
* https://github.com/libsdl-org/SDL/blob/main/docs/README-ios.md
|
|
||||||
*
|
|
||||||
* This functions is also accessible using the macro
|
|
||||||
* SDL_iOSSetAnimationCallback() since SDL 2.0.4.
|
|
||||||
*
|
|
||||||
* \param window the window for which the animation callback should be set.
|
|
||||||
* \param interval the number of frames after which **callback** will be
|
|
||||||
* called.
|
|
||||||
* \param callback the function to call for every frame.
|
|
||||||
* \param callbackParam a pointer that is passed to `callback`.
|
|
||||||
* \returns 0 on success or a negative error code on failure; call
|
|
||||||
* SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_iPhoneSetEventPump
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam);
|
|
||||||
|
|
||||||
#define SDL_iOSSetAnimationCallback(window, interval, callback, callbackParam) SDL_iPhoneSetAnimationCallback(window, interval, callback, callbackParam)
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Use this function to enable or disable the SDL event pump on Apple iOS.
|
|
||||||
*
|
|
||||||
* This function is only available on Apple iOS.
|
|
||||||
*
|
|
||||||
* This functions is also accessible using the macro SDL_iOSSetEventPump()
|
|
||||||
* since SDL 2.0.4.
|
|
||||||
*
|
|
||||||
* \param enabled SDL_TRUE to enable the event pump, SDL_FALSE to disable it.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_iPhoneSetAnimationCallback
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled);
|
|
||||||
|
|
||||||
#define SDL_iOSSetEventPump(enabled) SDL_iPhoneSetEventPump(enabled)
|
|
||||||
|
|
||||||
/* end of iOS-specific functions. */
|
|
||||||
#endif /* __IPHONEOS__ */
|
|
||||||
|
|
||||||
|
|
||||||
/* Platform specific functions for Android */
|
|
||||||
#ifdef __ANDROID__
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the Android Java Native Interface Environment of the current thread.
|
|
||||||
*
|
|
||||||
* This is the JNIEnv one needs to access the Java virtual machine from native
|
|
||||||
* code, and is needed for many Android APIs to be usable from C.
|
|
||||||
*
|
|
||||||
* The prototype of the function in SDL's code actually declare a void* return
|
|
||||||
* type, even if the implementation returns a pointer to a JNIEnv. The
|
|
||||||
* rationale being that the SDL headers can avoid including jni.h.
|
|
||||||
*
|
|
||||||
* \returns a pointer to Java native interface object (JNIEnv) to which the
|
|
||||||
* current thread is attached, or 0 on error.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_AndroidGetActivity
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve the Java instance of the Android activity class.
|
|
||||||
*
|
|
||||||
* The prototype of the function in SDL's code actually declares a void*
|
|
||||||
* return type, even if the implementation returns a jobject. The rationale
|
|
||||||
* being that the SDL headers can avoid including jni.h.
|
|
||||||
*
|
|
||||||
* The jobject returned by the function is a local reference and must be
|
|
||||||
* released by the caller. See the PushLocalFrame() and PopLocalFrame() or
|
|
||||||
* DeleteLocalRef() functions of the Java native interface:
|
|
||||||
*
|
|
||||||
* https://docs.oracle.com/javase/1.5.0/docs/guide/jni/spec/functions.html
|
|
||||||
*
|
|
||||||
* \returns the jobject representing the instance of the Activity class of the
|
|
||||||
* Android application, or NULL on error.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_AndroidGetJNIEnv
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Query Android API level of the current device.
|
|
||||||
*
|
|
||||||
* - API level 31: Android 12
|
|
||||||
* - API level 30: Android 11
|
|
||||||
* - API level 29: Android 10
|
|
||||||
* - API level 28: Android 9
|
|
||||||
* - API level 27: Android 8.1
|
|
||||||
* - API level 26: Android 8.0
|
|
||||||
* - API level 25: Android 7.1
|
|
||||||
* - API level 24: Android 7.0
|
|
||||||
* - API level 23: Android 6.0
|
|
||||||
* - API level 22: Android 5.1
|
|
||||||
* - API level 21: Android 5.0
|
|
||||||
* - API level 20: Android 4.4W
|
|
||||||
* - API level 19: Android 4.4
|
|
||||||
* - API level 18: Android 4.3
|
|
||||||
* - API level 17: Android 4.2
|
|
||||||
* - API level 16: Android 4.1
|
|
||||||
* - API level 15: Android 4.0.3
|
|
||||||
* - API level 14: Android 4.0
|
|
||||||
* - API level 13: Android 3.2
|
|
||||||
* - API level 12: Android 3.1
|
|
||||||
* - API level 11: Android 3.0
|
|
||||||
* - API level 10: Android 2.3.3
|
|
||||||
*
|
|
||||||
* \returns the Android API level.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.12.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GetAndroidSDKVersion(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Query if the application is running on Android TV.
|
|
||||||
*
|
|
||||||
* \returns SDL_TRUE if this is Android TV, SDL_FALSE otherwise.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.8.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_IsAndroidTV(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Query if the application is running on a Chromebook.
|
|
||||||
*
|
|
||||||
* \returns SDL_TRUE if this is a Chromebook, SDL_FALSE otherwise.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.9.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_IsChromebook(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Query if the application is running on a Samsung DeX docking station.
|
|
||||||
*
|
|
||||||
* \returns SDL_TRUE if this is a DeX docking station, SDL_FALSE otherwise.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.9.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Trigger the Android system back button behavior.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.9.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_AndroidBackButton(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* See the official Android developer guide for more information:
|
|
||||||
* http://developer.android.com/guide/topics/data/data-storage.html
|
|
||||||
*/
|
|
||||||
#define SDL_ANDROID_EXTERNAL_STORAGE_READ 0x01
|
|
||||||
#define SDL_ANDROID_EXTERNAL_STORAGE_WRITE 0x02
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the path used for internal storage for this application.
|
|
||||||
*
|
|
||||||
* This path is unique to your application and cannot be written to by other
|
|
||||||
* applications.
|
|
||||||
*
|
|
||||||
* Your internal storage path is typically:
|
|
||||||
* `/data/data/your.app.package/files`.
|
|
||||||
*
|
|
||||||
* \returns the path used for internal storage or NULL on failure; call
|
|
||||||
* SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_AndroidGetExternalStorageState
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the current state of external storage.
|
|
||||||
*
|
|
||||||
* The current state of external storage, a bitmask of these values:
|
|
||||||
* `SDL_ANDROID_EXTERNAL_STORAGE_READ`, `SDL_ANDROID_EXTERNAL_STORAGE_WRITE`.
|
|
||||||
*
|
|
||||||
* If external storage is currently unavailable, this will return 0.
|
|
||||||
*
|
|
||||||
* \returns the current state of external storage on success or 0 on failure;
|
|
||||||
* call SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_AndroidGetExternalStoragePath
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the path used for external storage for this application.
|
|
||||||
*
|
|
||||||
* This path is unique to your application, but is public and can be written
|
|
||||||
* to by other applications.
|
|
||||||
*
|
|
||||||
* Your external storage path is typically:
|
|
||||||
* `/storage/sdcard0/Android/data/your.app.package/files`.
|
|
||||||
*
|
|
||||||
* \returns the path used for external storage for this application on success
|
|
||||||
* or NULL on failure; call SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_AndroidGetExternalStorageState
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Request permissions at runtime.
|
|
||||||
*
|
|
||||||
* This blocks the calling thread until the permission is granted or denied.
|
|
||||||
*
|
|
||||||
* \param permission The permission to request.
|
|
||||||
* \returns SDL_TRUE if the permission was granted, SDL_FALSE otherwise.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.14.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_AndroidRequestPermission(const char *permission);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Shows an Android toast notification.
|
|
||||||
*
|
|
||||||
* Toasts are a sort of lightweight notification that are unique to Android.
|
|
||||||
*
|
|
||||||
* https://developer.android.com/guide/topics/ui/notifiers/toasts
|
|
||||||
*
|
|
||||||
* Shows toast in UI thread.
|
|
||||||
*
|
|
||||||
* For the `gravity` parameter, choose a value from here, or -1 if you don't
|
|
||||||
* have a preference:
|
|
||||||
*
|
|
||||||
* https://developer.android.com/reference/android/view/Gravity
|
|
||||||
*
|
|
||||||
* \param message text message to be shown.
|
|
||||||
* \param duration 0=short, 1=long.
|
|
||||||
* \param gravity where the notification should appear on the screen.
|
|
||||||
* \param xoffset set this parameter only when gravity >=0.
|
|
||||||
* \param yoffset set this parameter only when gravity >=0.
|
|
||||||
* \returns 0 if success, -1 if any error occurs.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.16.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_AndroidShowToast(const char* message, int duration, int gravity, int xoffset, int yoffset);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Send a user command to SDLActivity.
|
|
||||||
*
|
|
||||||
* Override "boolean onUnhandledMessage(Message msg)" to handle the message.
|
|
||||||
*
|
|
||||||
* \param command user command that must be greater or equal to 0x8000.
|
|
||||||
* \param param user parameter.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.22.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_AndroidSendMessage(Uint32 command, int param);
|
|
||||||
|
|
||||||
#endif /* __ANDROID__ */
|
|
||||||
|
|
||||||
/* Platform specific functions for WinRT */
|
|
||||||
#ifdef __WINRT__
|
|
||||||
|
|
||||||
/**
|
|
||||||
* WinRT / Windows Phone path types
|
|
||||||
*/
|
|
||||||
typedef enum SDL_WinRT_Path
|
|
||||||
{
|
|
||||||
/** \brief The installed app's root directory.
|
|
||||||
Files here are likely to be read-only. */
|
|
||||||
SDL_WINRT_PATH_INSTALLED_LOCATION,
|
|
||||||
|
|
||||||
/** \brief The app's local data store. Files may be written here */
|
|
||||||
SDL_WINRT_PATH_LOCAL_FOLDER,
|
|
||||||
|
|
||||||
/** \brief The app's roaming data store. Unsupported on Windows Phone.
|
|
||||||
Files written here may be copied to other machines via a network
|
|
||||||
connection.
|
|
||||||
*/
|
|
||||||
SDL_WINRT_PATH_ROAMING_FOLDER,
|
|
||||||
|
|
||||||
/** \brief The app's temporary data store. Unsupported on Windows Phone.
|
|
||||||
Files written here may be deleted at any time. */
|
|
||||||
SDL_WINRT_PATH_TEMP_FOLDER
|
|
||||||
} SDL_WinRT_Path;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* WinRT Device Family
|
|
||||||
*/
|
|
||||||
typedef enum SDL_WinRT_DeviceFamily
|
|
||||||
{
|
|
||||||
/** \brief Unknown family */
|
|
||||||
SDL_WINRT_DEVICEFAMILY_UNKNOWN,
|
|
||||||
|
|
||||||
/** \brief Desktop family*/
|
|
||||||
SDL_WINRT_DEVICEFAMILY_DESKTOP,
|
|
||||||
|
|
||||||
/** \brief Mobile family (for example smartphone) */
|
|
||||||
SDL_WINRT_DEVICEFAMILY_MOBILE,
|
|
||||||
|
|
||||||
/** \brief XBox family */
|
|
||||||
SDL_WINRT_DEVICEFAMILY_XBOX,
|
|
||||||
} SDL_WinRT_DeviceFamily;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve a WinRT defined path on the local file system.
|
|
||||||
*
|
|
||||||
* Not all paths are available on all versions of Windows. This is especially
|
|
||||||
* true on Windows Phone. Check the documentation for the given SDL_WinRT_Path
|
|
||||||
* for more information on which path types are supported where.
|
|
||||||
*
|
|
||||||
* Documentation on most app-specific path types on WinRT can be found on
|
|
||||||
* MSDN, at the URL:
|
|
||||||
*
|
|
||||||
* https://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
|
|
||||||
*
|
|
||||||
* \param pathType the type of path to retrieve, one of SDL_WinRT_Path.
|
|
||||||
* \returns a UCS-2 string (16-bit, wide-char) containing the path, or NULL if
|
|
||||||
* the path is not available for any reason; call SDL_GetError() for
|
|
||||||
* more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.3.
|
|
||||||
*
|
|
||||||
* \sa SDL_WinRTGetFSPathUTF8
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path pathType);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve a WinRT defined path on the local file system.
|
|
||||||
*
|
|
||||||
* Not all paths are available on all versions of Windows. This is especially
|
|
||||||
* true on Windows Phone. Check the documentation for the given SDL_WinRT_Path
|
|
||||||
* for more information on which path types are supported where.
|
|
||||||
*
|
|
||||||
* Documentation on most app-specific path types on WinRT can be found on
|
|
||||||
* MSDN, at the URL:
|
|
||||||
*
|
|
||||||
* https://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
|
|
||||||
*
|
|
||||||
* \param pathType the type of path to retrieve, one of SDL_WinRT_Path.
|
|
||||||
* \returns a UTF-8 string (8-bit, multi-byte) containing the path, or NULL if
|
|
||||||
* the path is not available for any reason; call SDL_GetError() for
|
|
||||||
* more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.3.
|
|
||||||
*
|
|
||||||
* \sa SDL_WinRTGetFSPathUNICODE
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Detects the device family of WinRT platform at runtime.
|
|
||||||
*
|
|
||||||
* \returns a value from the SDL_WinRT_DeviceFamily enum.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.8.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_WinRT_DeviceFamily SDLCALL SDL_WinRTGetDeviceFamily();
|
|
||||||
|
|
||||||
#endif /* __WINRT__ */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Query if the current device is a tablet.
|
|
||||||
*
|
|
||||||
* If SDL can't determine this, it will return SDL_FALSE.
|
|
||||||
*
|
|
||||||
* \returns SDL_TRUE if the device is a tablet, SDL_FALSE otherwise.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.9.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_IsTablet(void);
|
|
||||||
|
|
||||||
/* Functions used by iOS application delegates to notify SDL about state changes */
|
|
||||||
extern DECLSPEC void SDLCALL SDL_OnApplicationWillTerminate(void);
|
|
||||||
extern DECLSPEC void SDLCALL SDL_OnApplicationDidReceiveMemoryWarning(void);
|
|
||||||
extern DECLSPEC void SDLCALL SDL_OnApplicationWillResignActive(void);
|
|
||||||
extern DECLSPEC void SDLCALL SDL_OnApplicationDidEnterBackground(void);
|
|
||||||
extern DECLSPEC void SDLCALL SDL_OnApplicationWillEnterForeground(void);
|
|
||||||
extern DECLSPEC void SDLCALL SDL_OnApplicationDidBecomeActive(void);
|
|
||||||
#ifdef __IPHONEOS__
|
|
||||||
extern DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Functions used only by GDK */
|
|
||||||
#if defined(__GDK__)
|
|
||||||
typedef struct XTaskQueueObject *XTaskQueueHandle;
|
|
||||||
typedef struct XUser *XUserHandle;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets a reference to the global async task queue handle for GDK,
|
|
||||||
* initializing if needed.
|
|
||||||
*
|
|
||||||
* Once you are done with the task queue, you should call
|
|
||||||
* XTaskQueueCloseHandle to reduce the reference count to avoid a resource
|
|
||||||
* leak.
|
|
||||||
*
|
|
||||||
* \param outTaskQueue a pointer to be filled in with task queue handle.
|
|
||||||
* \returns 0 if success, -1 if any error occurs.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.24.0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GDKGetTaskQueue(XTaskQueueHandle * outTaskQueue);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets a reference to the default user handle for GDK.
|
|
||||||
*
|
|
||||||
* This is effectively a synchronous version of XUserAddAsync, which always
|
|
||||||
* prefers the default user and allows a sign-in UI.
|
|
||||||
*
|
|
||||||
* \param outUserHandle a pointer to be filled in with the default user
|
|
||||||
* handle.
|
|
||||||
* \returns 0 if success, -1 if any error occurs.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.28.0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GDKGetDefaultUser(XUserHandle * outUserHandle);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include <SDL2/close_code.h>
|
|
||||||
|
|
||||||
#endif /* SDL_system_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
||||||
@@ -1,386 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2025 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* WIKI CATEGORY: SYSWM */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* # CategorySYSWM
|
|
||||||
*
|
|
||||||
* Include file for SDL custom system window manager hooks.
|
|
||||||
*
|
|
||||||
* Your application has access to a special type of event SDL_SYSWMEVENT,
|
|
||||||
* which contains window-manager specific information and arrives whenever
|
|
||||||
* an unhandled window event occurs. This event is ignored by default, but
|
|
||||||
* you can enable it with SDL_EventState().
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_syswm_h_
|
|
||||||
#define SDL_syswm_h_
|
|
||||||
|
|
||||||
#include <SDL2/SDL_stdinc.h>
|
|
||||||
#include <SDL2/SDL_error.h>
|
|
||||||
#include <SDL2/SDL_video.h>
|
|
||||||
#include <SDL2/SDL_version.h>
|
|
||||||
|
|
||||||
struct SDL_SysWMinfo;
|
|
||||||
|
|
||||||
#if !defined(SDL_PROTOTYPES_ONLY)
|
|
||||||
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_WINDOWS)
|
|
||||||
#ifndef WIN32_LEAN_AND_MEAN
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#endif
|
|
||||||
#ifndef NOMINMAX /* don't define min() and max(). */
|
|
||||||
#define NOMINMAX
|
|
||||||
#endif
|
|
||||||
#include <windows.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_WINRT)
|
|
||||||
#include <Inspectable.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* This is the structure for custom window manager events */
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_X11)
|
|
||||||
#if defined(__APPLE__) && defined(__MACH__)
|
|
||||||
/* conflicts with Quickdraw.h */
|
|
||||||
#define Cursor X11Cursor
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <X11/Xlib.h>
|
|
||||||
#include <X11/Xatom.h>
|
|
||||||
|
|
||||||
#if defined(__APPLE__) && defined(__MACH__)
|
|
||||||
/* matches the re-define above */
|
|
||||||
#undef Cursor
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* defined(SDL_VIDEO_DRIVER_X11) */
|
|
||||||
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_DIRECTFB)
|
|
||||||
#include <directfb.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_COCOA)
|
|
||||||
#ifdef __OBJC__
|
|
||||||
@class NSWindow;
|
|
||||||
#else
|
|
||||||
typedef struct _NSWindow NSWindow;
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_UIKIT)
|
|
||||||
#ifdef __OBJC__
|
|
||||||
#include <UIKit/UIKit.h>
|
|
||||||
#else
|
|
||||||
typedef struct _UIWindow UIWindow;
|
|
||||||
typedef struct _UIViewController UIViewController;
|
|
||||||
#endif
|
|
||||||
typedef Uint32 GLuint;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(SDL_VIDEO_VULKAN) || defined(SDL_VIDEO_METAL)
|
|
||||||
#define SDL_METALVIEW_TAG 255
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_ANDROID)
|
|
||||||
typedef struct ANativeWindow ANativeWindow;
|
|
||||||
typedef void *EGLSurface;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_VIVANTE)
|
|
||||||
#include <SDL2/SDL_egl.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_OS2)
|
|
||||||
#define INCL_WIN
|
|
||||||
#include <os2.h>
|
|
||||||
#endif
|
|
||||||
#endif /* SDL_PROTOTYPES_ONLY */
|
|
||||||
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_KMSDRM)
|
|
||||||
struct gbm_device;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#include <SDL2/begin_code.h>
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(SDL_PROTOTYPES_ONLY)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* These are the various supported windowing subsystems
|
|
||||||
*/
|
|
||||||
typedef enum SDL_SYSWM_TYPE
|
|
||||||
{
|
|
||||||
SDL_SYSWM_UNKNOWN,
|
|
||||||
SDL_SYSWM_WINDOWS,
|
|
||||||
SDL_SYSWM_X11,
|
|
||||||
SDL_SYSWM_DIRECTFB,
|
|
||||||
SDL_SYSWM_COCOA,
|
|
||||||
SDL_SYSWM_UIKIT,
|
|
||||||
SDL_SYSWM_WAYLAND,
|
|
||||||
SDL_SYSWM_MIR, /* no longer available, left for API/ABI compatibility. Remove in 2.1! */
|
|
||||||
SDL_SYSWM_WINRT,
|
|
||||||
SDL_SYSWM_ANDROID,
|
|
||||||
SDL_SYSWM_VIVANTE,
|
|
||||||
SDL_SYSWM_OS2,
|
|
||||||
SDL_SYSWM_HAIKU,
|
|
||||||
SDL_SYSWM_KMSDRM,
|
|
||||||
SDL_SYSWM_RISCOS
|
|
||||||
} SDL_SYSWM_TYPE;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The custom event structure.
|
|
||||||
*/
|
|
||||||
struct SDL_SysWMmsg
|
|
||||||
{
|
|
||||||
SDL_version version;
|
|
||||||
SDL_SYSWM_TYPE subsystem;
|
|
||||||
union
|
|
||||||
{
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_WINDOWS)
|
|
||||||
struct {
|
|
||||||
HWND hwnd; /**< The window for the message */
|
|
||||||
UINT msg; /**< The type of message */
|
|
||||||
WPARAM wParam; /**< WORD message parameter */
|
|
||||||
LPARAM lParam; /**< LONG message parameter */
|
|
||||||
} win;
|
|
||||||
#endif
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_X11)
|
|
||||||
struct {
|
|
||||||
XEvent event;
|
|
||||||
} x11;
|
|
||||||
#endif
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_DIRECTFB)
|
|
||||||
struct {
|
|
||||||
DFBEvent event;
|
|
||||||
} dfb;
|
|
||||||
#endif
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_COCOA)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
/* Latest version of Xcode clang complains about empty structs in C v. C++:
|
|
||||||
error: empty struct has size 0 in C, size 1 in C++
|
|
||||||
*/
|
|
||||||
int dummy;
|
|
||||||
/* No Cocoa window events yet */
|
|
||||||
} cocoa;
|
|
||||||
#endif
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_UIKIT)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
int dummy;
|
|
||||||
/* No UIKit window events yet */
|
|
||||||
} uikit;
|
|
||||||
#endif
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_VIVANTE)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
int dummy;
|
|
||||||
/* No Vivante window events yet */
|
|
||||||
} vivante;
|
|
||||||
#endif
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_OS2)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
BOOL fFrame; /**< TRUE if hwnd is a frame window */
|
|
||||||
HWND hwnd; /**< The window receiving the message */
|
|
||||||
ULONG msg; /**< The message identifier */
|
|
||||||
MPARAM mp1; /**< The first first message parameter */
|
|
||||||
MPARAM mp2; /**< The second first message parameter */
|
|
||||||
} os2;
|
|
||||||
#endif
|
|
||||||
/* Can't have an empty union */
|
|
||||||
int dummy;
|
|
||||||
} msg;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The custom window manager information structure.
|
|
||||||
*
|
|
||||||
* When this structure is returned, it holds information about which low level
|
|
||||||
* system it is using, and will be one of SDL_SYSWM_TYPE.
|
|
||||||
*/
|
|
||||||
struct SDL_SysWMinfo
|
|
||||||
{
|
|
||||||
SDL_version version;
|
|
||||||
SDL_SYSWM_TYPE subsystem;
|
|
||||||
union
|
|
||||||
{
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_WINDOWS)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
HWND window; /**< The window handle */
|
|
||||||
HDC hdc; /**< The window device context */
|
|
||||||
HINSTANCE hinstance; /**< The instance handle */
|
|
||||||
} win;
|
|
||||||
#endif
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_WINRT)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
IInspectable * window; /**< The WinRT CoreWindow */
|
|
||||||
} winrt;
|
|
||||||
#endif
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_X11)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
Display *display; /**< The X11 display */
|
|
||||||
Window window; /**< The X11 window */
|
|
||||||
} x11;
|
|
||||||
#endif
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_DIRECTFB)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
IDirectFB *dfb; /**< The directfb main interface */
|
|
||||||
IDirectFBWindow *window; /**< The directfb window handle */
|
|
||||||
IDirectFBSurface *surface; /**< The directfb client surface */
|
|
||||||
} dfb;
|
|
||||||
#endif
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_COCOA)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
#if defined(__OBJC__) && defined(__has_feature)
|
|
||||||
#if __has_feature(objc_arc)
|
|
||||||
NSWindow __unsafe_unretained *window; /**< The Cocoa window */
|
|
||||||
#else
|
|
||||||
NSWindow *window; /**< The Cocoa window */
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
NSWindow *window; /**< The Cocoa window */
|
|
||||||
#endif
|
|
||||||
} cocoa;
|
|
||||||
#endif
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_UIKIT)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
#if defined(__OBJC__) && defined(__has_feature)
|
|
||||||
#if __has_feature(objc_arc)
|
|
||||||
UIWindow __unsafe_unretained *window; /**< The UIKit window */
|
|
||||||
#else
|
|
||||||
UIWindow *window; /**< The UIKit window */
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
UIWindow *window; /**< The UIKit window */
|
|
||||||
#endif
|
|
||||||
GLuint framebuffer; /**< The GL view's Framebuffer Object. It must be bound when rendering to the screen using GL. */
|
|
||||||
GLuint colorbuffer; /**< The GL view's color Renderbuffer Object. It must be bound when SDL_GL_SwapWindow is called. */
|
|
||||||
GLuint resolveFramebuffer; /**< The Framebuffer Object which holds the resolve color Renderbuffer, when MSAA is used. */
|
|
||||||
} uikit;
|
|
||||||
#endif
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_WAYLAND)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
struct wl_display *display; /**< Wayland display */
|
|
||||||
struct wl_surface *surface; /**< Wayland surface */
|
|
||||||
void *shell_surface; /**< DEPRECATED Wayland shell_surface (window manager handle) */
|
|
||||||
struct wl_egl_window *egl_window; /**< Wayland EGL window (native window) */
|
|
||||||
struct xdg_surface *xdg_surface; /**< Wayland xdg surface (window manager handle) */
|
|
||||||
struct xdg_toplevel *xdg_toplevel; /**< Wayland xdg toplevel role */
|
|
||||||
struct xdg_popup *xdg_popup; /**< Wayland xdg popup role */
|
|
||||||
struct xdg_positioner *xdg_positioner; /**< Wayland xdg positioner, for popup */
|
|
||||||
} wl;
|
|
||||||
#endif
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_MIR) /* no longer available, left for API/ABI compatibility. Remove in 2.1! */
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
void *connection; /**< Mir display server connection */
|
|
||||||
void *surface; /**< Mir surface */
|
|
||||||
} mir;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_ANDROID)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
ANativeWindow *window;
|
|
||||||
EGLSurface surface;
|
|
||||||
} android;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_OS2)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
HWND hwnd; /**< The window handle */
|
|
||||||
HWND hwndFrame; /**< The frame window handle */
|
|
||||||
} os2;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_VIVANTE)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
EGLNativeDisplayType display;
|
|
||||||
EGLNativeWindowType window;
|
|
||||||
} vivante;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_KMSDRM)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
int dev_index; /**< Device index (ex: the X in /dev/dri/cardX) */
|
|
||||||
int drm_fd; /**< DRM FD (unavailable on Vulkan windows) */
|
|
||||||
struct gbm_device *gbm_dev; /**< GBM device (unavailable on Vulkan windows) */
|
|
||||||
} kmsdrm;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Make sure this union is always 64 bytes (8 64-bit pointers). */
|
|
||||||
/* Be careful not to overflow this if you add a new target! */
|
|
||||||
Uint8 dummy[64];
|
|
||||||
} info;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* SDL_PROTOTYPES_ONLY */
|
|
||||||
|
|
||||||
typedef struct SDL_SysWMinfo SDL_SysWMinfo;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get driver-specific information about a window.
|
|
||||||
*
|
|
||||||
* You must include SDL_syswm.h for the declaration of SDL_SysWMinfo.
|
|
||||||
*
|
|
||||||
* The caller must initialize the `info` structure's version by using
|
|
||||||
* `SDL_VERSION(&info.version)`, and then this function will fill in the rest
|
|
||||||
* of the structure with information about the given window.
|
|
||||||
*
|
|
||||||
* \param window the window about which information is being requested.
|
|
||||||
* \param info an SDL_SysWMinfo structure filled in with window information.
|
|
||||||
* \returns SDL_TRUE if the function is implemented and the `version` member
|
|
||||||
* of the `info` struct is valid, or SDL_FALSE if the information
|
|
||||||
* could not be retrieved; call SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_Window * window,
|
|
||||||
SDL_SysWMinfo * info);
|
|
||||||
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include <SDL2/close_code.h>
|
|
||||||
|
|
||||||
#endif /* SDL_syswm_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
||||||
@@ -1,468 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2025 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_thread_h_
|
|
||||||
#define SDL_thread_h_
|
|
||||||
|
|
||||||
/**
|
|
||||||
* # CategoryThread
|
|
||||||
*
|
|
||||||
* Header for the SDL thread management routines.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <SDL2/SDL_stdinc.h>
|
|
||||||
#include <SDL2/SDL_error.h>
|
|
||||||
|
|
||||||
/* Thread synchronization primitives */
|
|
||||||
#include <SDL2/SDL_atomic.h>
|
|
||||||
#include <SDL2/SDL_mutex.h>
|
|
||||||
|
|
||||||
#if (defined(__WIN32__) || defined(__GDK__)) && !defined(__WINRT__)
|
|
||||||
#include <process.h> /* _beginthreadex() and _endthreadex() */
|
|
||||||
#endif
|
|
||||||
#if defined(__OS2__) /* for _beginthread() and _endthread() */
|
|
||||||
#ifndef __EMX__
|
|
||||||
#include <process.h>
|
|
||||||
#else
|
|
||||||
#include <stdlib.h>
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <SDL2/begin_code.h>
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* The SDL thread structure, defined in SDL_thread.c */
|
|
||||||
struct SDL_Thread;
|
|
||||||
typedef struct SDL_Thread SDL_Thread;
|
|
||||||
|
|
||||||
/* The SDL thread ID */
|
|
||||||
typedef unsigned long SDL_threadID;
|
|
||||||
|
|
||||||
/* Thread local storage ID, 0 is the invalid ID */
|
|
||||||
typedef unsigned int SDL_TLSID;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The SDL thread priority.
|
|
||||||
*
|
|
||||||
* SDL will make system changes as necessary in order to apply the thread
|
|
||||||
* priority. Code which attempts to control thread state related to priority
|
|
||||||
* should be aware that calling SDL_SetThreadPriority may alter such state.
|
|
||||||
* SDL_HINT_THREAD_PRIORITY_POLICY can be used to control aspects of this
|
|
||||||
* behavior.
|
|
||||||
*
|
|
||||||
* On many systems you require special privileges to set high or time critical
|
|
||||||
* priority.
|
|
||||||
*/
|
|
||||||
typedef enum SDL_ThreadPriority {
|
|
||||||
SDL_THREAD_PRIORITY_LOW,
|
|
||||||
SDL_THREAD_PRIORITY_NORMAL,
|
|
||||||
SDL_THREAD_PRIORITY_HIGH,
|
|
||||||
SDL_THREAD_PRIORITY_TIME_CRITICAL
|
|
||||||
} SDL_ThreadPriority;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The function passed to SDL_CreateThread().
|
|
||||||
*
|
|
||||||
* \param data what was passed as `data` to SDL_CreateThread().
|
|
||||||
* \returns a value that can be reported through SDL_WaitThread().
|
|
||||||
*/
|
|
||||||
typedef int (SDLCALL * SDL_ThreadFunction) (void *data);
|
|
||||||
|
|
||||||
|
|
||||||
#if (defined(__WIN32__) || defined(__GDK__)) && !defined(__WINRT__)
|
|
||||||
/**
|
|
||||||
* \file SDL_thread.h
|
|
||||||
*
|
|
||||||
* We compile SDL into a DLL. This means, that it's the DLL which
|
|
||||||
* creates a new thread for the calling process with the SDL_CreateThread()
|
|
||||||
* API. There is a problem with this, that only the RTL of the SDL2.DLL will
|
|
||||||
* be initialized for those threads, and not the RTL of the calling
|
|
||||||
* application!
|
|
||||||
*
|
|
||||||
* To solve this, we make a little hack here.
|
|
||||||
*
|
|
||||||
* We'll always use the caller's _beginthread() and _endthread() APIs to
|
|
||||||
* start a new thread. This way, if it's the SDL2.DLL which uses this API,
|
|
||||||
* then the RTL of SDL2.DLL will be used to create the new thread, and if it's
|
|
||||||
* the application, then the RTL of the application will be used.
|
|
||||||
*
|
|
||||||
* So, in short:
|
|
||||||
* Always use the _beginthread() and _endthread() of the calling runtime
|
|
||||||
* library!
|
|
||||||
*/
|
|
||||||
#define SDL_PASSED_BEGINTHREAD_ENDTHREAD
|
|
||||||
|
|
||||||
typedef uintptr_t (__cdecl * pfnSDL_CurrentBeginThread)
|
|
||||||
(void *, unsigned, unsigned (__stdcall *func)(void *),
|
|
||||||
void * /*arg*/, unsigned, unsigned * /* threadID */);
|
|
||||||
typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code);
|
|
||||||
|
|
||||||
#ifndef SDL_beginthread
|
|
||||||
#define SDL_beginthread _beginthreadex
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_endthread
|
|
||||||
#define SDL_endthread _endthreadex
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern DECLSPEC SDL_Thread *SDLCALL
|
|
||||||
SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data,
|
|
||||||
pfnSDL_CurrentBeginThread pfnBeginThread,
|
|
||||||
pfnSDL_CurrentEndThread pfnEndThread);
|
|
||||||
|
|
||||||
extern DECLSPEC SDL_Thread *SDLCALL
|
|
||||||
SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn,
|
|
||||||
const char *name, const size_t stacksize, void *data,
|
|
||||||
pfnSDL_CurrentBeginThread pfnBeginThread,
|
|
||||||
pfnSDL_CurrentEndThread pfnEndThread);
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(SDL_CreateThread) && SDL_DYNAMIC_API
|
|
||||||
#undef SDL_CreateThread
|
|
||||||
#define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
|
|
||||||
#undef SDL_CreateThreadWithStackSize
|
|
||||||
#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
|
|
||||||
#else
|
|
||||||
#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
|
|
||||||
#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#elif defined(__OS2__)
|
|
||||||
/*
|
|
||||||
* just like the windows case above: We compile SDL2
|
|
||||||
* into a dll with Watcom's runtime statically linked.
|
|
||||||
*/
|
|
||||||
#define SDL_PASSED_BEGINTHREAD_ENDTHREAD
|
|
||||||
|
|
||||||
typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void * /*arg*/);
|
|
||||||
typedef void (*pfnSDL_CurrentEndThread)(void);
|
|
||||||
|
|
||||||
#ifndef SDL_beginthread
|
|
||||||
#define SDL_beginthread _beginthread
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_endthread
|
|
||||||
#define SDL_endthread _endthread
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern DECLSPEC SDL_Thread *SDLCALL
|
|
||||||
SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data,
|
|
||||||
pfnSDL_CurrentBeginThread pfnBeginThread,
|
|
||||||
pfnSDL_CurrentEndThread pfnEndThread);
|
|
||||||
extern DECLSPEC SDL_Thread *SDLCALL
|
|
||||||
SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data,
|
|
||||||
pfnSDL_CurrentBeginThread pfnBeginThread,
|
|
||||||
pfnSDL_CurrentEndThread pfnEndThread);
|
|
||||||
|
|
||||||
#if defined(SDL_CreateThread) && SDL_DYNAMIC_API
|
|
||||||
#undef SDL_CreateThread
|
|
||||||
#define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
|
|
||||||
#undef SDL_CreateThreadWithStackSize
|
|
||||||
#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
|
|
||||||
#else
|
|
||||||
#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
|
|
||||||
#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new thread with a default stack size.
|
|
||||||
*
|
|
||||||
* This is equivalent to calling:
|
|
||||||
*
|
|
||||||
* ```c
|
|
||||||
* SDL_CreateThreadWithStackSize(fn, name, 0, data);
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* \param fn the SDL_ThreadFunction function to call in the new thread.
|
|
||||||
* \param name the name of the thread.
|
|
||||||
* \param data a pointer that is passed to `fn`.
|
|
||||||
* \returns an opaque pointer to the new thread object on success, NULL if the
|
|
||||||
* new thread could not be created; call SDL_GetError() for more
|
|
||||||
* information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_CreateThreadWithStackSize
|
|
||||||
* \sa SDL_WaitThread
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Thread *SDLCALL
|
|
||||||
SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new thread with a specific stack size.
|
|
||||||
*
|
|
||||||
* SDL makes an attempt to report `name` to the system, so that debuggers can
|
|
||||||
* display it. Not all platforms support this.
|
|
||||||
*
|
|
||||||
* Thread naming is a little complicated: Most systems have very small limits
|
|
||||||
* for the string length (Haiku has 32 bytes, Linux currently has 16, Visual
|
|
||||||
* C++ 6.0 has _nine_!), and possibly other arbitrary rules. You'll have to
|
|
||||||
* see what happens with your system's debugger. The name should be UTF-8 (but
|
|
||||||
* using the naming limits of C identifiers is a better bet). There are no
|
|
||||||
* requirements for thread naming conventions, so long as the string is
|
|
||||||
* null-terminated UTF-8, but these guidelines are helpful in choosing a name:
|
|
||||||
*
|
|
||||||
* https://stackoverflow.com/questions/149932/naming-conventions-for-threads
|
|
||||||
*
|
|
||||||
* If a system imposes requirements, SDL will try to munge the string for it
|
|
||||||
* (truncate, etc), but the original string contents will be available from
|
|
||||||
* SDL_GetThreadName().
|
|
||||||
*
|
|
||||||
* The size (in bytes) of the new stack can be specified. Zero means "use the
|
|
||||||
* system default" which might be wildly different between platforms. x86
|
|
||||||
* Linux generally defaults to eight megabytes, an embedded device might be a
|
|
||||||
* few kilobytes instead. You generally need to specify a stack that is a
|
|
||||||
* multiple of the system's page size (in many cases, this is 4 kilobytes, but
|
|
||||||
* check your system documentation).
|
|
||||||
*
|
|
||||||
* In SDL 2.1, stack size will be folded into the original SDL_CreateThread
|
|
||||||
* function, but for backwards compatibility, this is currently a separate
|
|
||||||
* function.
|
|
||||||
*
|
|
||||||
* \param fn the SDL_ThreadFunction function to call in the new thread.
|
|
||||||
* \param name the name of the thread.
|
|
||||||
* \param stacksize the size, in bytes, to allocate for the new thread stack.
|
|
||||||
* \param data a pointer that is passed to `fn`.
|
|
||||||
* \returns an opaque pointer to the new thread object on success, NULL if the
|
|
||||||
* new thread could not be created; call SDL_GetError() for more
|
|
||||||
* information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.9.
|
|
||||||
*
|
|
||||||
* \sa SDL_WaitThread
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Thread *SDLCALL
|
|
||||||
SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the thread name as it was specified in SDL_CreateThread().
|
|
||||||
*
|
|
||||||
* This is internal memory, not to be freed by the caller, and remains valid
|
|
||||||
* until the specified thread is cleaned up by SDL_WaitThread().
|
|
||||||
*
|
|
||||||
* \param thread the thread to query.
|
|
||||||
* \returns a pointer to a UTF-8 string that names the specified thread, or
|
|
||||||
* NULL if it doesn't have a name.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_CreateThread
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const char *SDLCALL SDL_GetThreadName(SDL_Thread *thread);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the thread identifier for the current thread.
|
|
||||||
*
|
|
||||||
* This thread identifier is as reported by the underlying operating system.
|
|
||||||
* If SDL is running on a platform that does not support threads the return
|
|
||||||
* value will always be zero.
|
|
||||||
*
|
|
||||||
* This function also returns a valid thread ID when called from the main
|
|
||||||
* thread.
|
|
||||||
*
|
|
||||||
* \returns the ID of the current thread.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetThreadID
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_threadID SDLCALL SDL_ThreadID(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the thread identifier for the specified thread.
|
|
||||||
*
|
|
||||||
* This thread identifier is as reported by the underlying operating system.
|
|
||||||
* If SDL is running on a platform that does not support threads the return
|
|
||||||
* value will always be zero.
|
|
||||||
*
|
|
||||||
* \param thread the thread to query.
|
|
||||||
* \returns the ID of the specified thread, or the ID of the current thread if
|
|
||||||
* `thread` is NULL.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_ThreadID
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_threadID SDLCALL SDL_GetThreadID(SDL_Thread * thread);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the priority for the current thread.
|
|
||||||
*
|
|
||||||
* Note that some platforms will not let you alter the priority (or at least,
|
|
||||||
* promote the thread to a higher priority) at all, and some require you to be
|
|
||||||
* an administrator account. Be prepared for this to fail.
|
|
||||||
*
|
|
||||||
* \param priority the SDL_ThreadPriority to set.
|
|
||||||
* \returns 0 on success or a negative error code on failure; call
|
|
||||||
* SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priority);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Wait for a thread to finish.
|
|
||||||
*
|
|
||||||
* Threads that haven't been detached will remain (as a "zombie") until this
|
|
||||||
* function cleans them up. Not doing so is a resource leak.
|
|
||||||
*
|
|
||||||
* Once a thread has been cleaned up through this function, the SDL_Thread
|
|
||||||
* that references it becomes invalid and should not be referenced again. As
|
|
||||||
* such, only one thread may call SDL_WaitThread() on another.
|
|
||||||
*
|
|
||||||
* The return code for the thread function is placed in the area pointed to by
|
|
||||||
* `status`, if `status` is not NULL.
|
|
||||||
*
|
|
||||||
* You may not wait on a thread that has been used in a call to
|
|
||||||
* SDL_DetachThread(). Use either that function or this one, but not both, or
|
|
||||||
* behavior is undefined.
|
|
||||||
*
|
|
||||||
* It is safe to pass a NULL thread to this function; it is a no-op.
|
|
||||||
*
|
|
||||||
* Note that the thread pointer is freed by this function and is not valid
|
|
||||||
* afterward.
|
|
||||||
*
|
|
||||||
* \param thread the SDL_Thread pointer that was returned from the
|
|
||||||
* SDL_CreateThread() call that started this thread.
|
|
||||||
* \param status pointer to an integer that will receive the value returned
|
|
||||||
* from the thread function by its 'return', or NULL to not
|
|
||||||
* receive such value back.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_CreateThread
|
|
||||||
* \sa SDL_DetachThread
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread * thread, int *status);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Let a thread clean up on exit without intervention.
|
|
||||||
*
|
|
||||||
* A thread may be "detached" to signify that it should not remain until
|
|
||||||
* another thread has called SDL_WaitThread() on it. Detaching a thread is
|
|
||||||
* useful for long-running threads that nothing needs to synchronize with or
|
|
||||||
* further manage. When a detached thread is done, it simply goes away.
|
|
||||||
*
|
|
||||||
* There is no way to recover the return code of a detached thread. If you
|
|
||||||
* need this, don't detach the thread and instead use SDL_WaitThread().
|
|
||||||
*
|
|
||||||
* Once a thread is detached, you should usually assume the SDL_Thread isn't
|
|
||||||
* safe to reference again, as it will become invalid immediately upon the
|
|
||||||
* detached thread's exit, instead of remaining until someone has called
|
|
||||||
* SDL_WaitThread() to finally clean it up. As such, don't detach the same
|
|
||||||
* thread more than once.
|
|
||||||
*
|
|
||||||
* If a thread has already exited when passed to SDL_DetachThread(), it will
|
|
||||||
* stop waiting for a call to SDL_WaitThread() and clean up immediately. It is
|
|
||||||
* not safe to detach a thread that might be used with SDL_WaitThread().
|
|
||||||
*
|
|
||||||
* You may not call SDL_WaitThread() on a thread that has been detached. Use
|
|
||||||
* either that function or this one, but not both, or behavior is undefined.
|
|
||||||
*
|
|
||||||
* It is safe to pass NULL to this function; it is a no-op.
|
|
||||||
*
|
|
||||||
* \param thread the SDL_Thread pointer that was returned from the
|
|
||||||
* SDL_CreateThread() call that started this thread.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.2.
|
|
||||||
*
|
|
||||||
* \sa SDL_CreateThread
|
|
||||||
* \sa SDL_WaitThread
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_DetachThread(SDL_Thread * thread);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a piece of thread-local storage.
|
|
||||||
*
|
|
||||||
* This creates an identifier that is globally visible to all threads but
|
|
||||||
* refers to data that is thread-specific.
|
|
||||||
*
|
|
||||||
* \returns the newly created thread local storage identifier or 0 on error.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_TLSGet
|
|
||||||
* \sa SDL_TLSSet
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_TLSID SDLCALL SDL_TLSCreate(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the current thread's value associated with a thread local storage ID.
|
|
||||||
*
|
|
||||||
* \param id the thread local storage ID.
|
|
||||||
* \returns the value associated with the ID for the current thread or NULL if
|
|
||||||
* no value has been set; call SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_TLSCreate
|
|
||||||
* \sa SDL_TLSSet
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void * SDLCALL SDL_TLSGet(SDL_TLSID id);
|
|
||||||
|
|
||||||
typedef void (SDLCALL *SDL_TLSDestructorCallback)(void*);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the current thread's value associated with a thread local storage ID.
|
|
||||||
*
|
|
||||||
* The function prototype for `destructor` is:
|
|
||||||
*
|
|
||||||
* ```c
|
|
||||||
* void destructor(void *value)
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* where its parameter `value` is what was passed as `value` to SDL_TLSSet().
|
|
||||||
*
|
|
||||||
* \param id the thread local storage ID.
|
|
||||||
* \param value the value to associate with the ID for the current thread.
|
|
||||||
* \param destructor a function called when the thread exits, to free the
|
|
||||||
* value.
|
|
||||||
* \returns 0 on success or a negative error code on failure; call
|
|
||||||
* SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_TLSCreate
|
|
||||||
* \sa SDL_TLSGet
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_TLSSet(SDL_TLSID id, const void *value, SDL_TLSDestructorCallback destructor);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Cleanup all TLS data for this thread.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.16.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_TLSCleanup(void);
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include <SDL2/close_code.h>
|
|
||||||
|
|
||||||
#endif /* SDL_thread_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
||||||
@@ -1,222 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2025 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_timer_h_
|
|
||||||
#define SDL_timer_h_
|
|
||||||
|
|
||||||
/**
|
|
||||||
* # CategoryTimer
|
|
||||||
*
|
|
||||||
* Header for the SDL time management routines.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <SDL2/SDL_stdinc.h>
|
|
||||||
#include <SDL2/SDL_error.h>
|
|
||||||
|
|
||||||
#include <SDL2/begin_code.h>
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the number of milliseconds since SDL library initialization.
|
|
||||||
*
|
|
||||||
* This value wraps if the program runs for more than ~49 days.
|
|
||||||
*
|
|
||||||
* This function is not recommended as of SDL 2.0.18; use SDL_GetTicks64()
|
|
||||||
* instead, where the value doesn't wrap every ~49 days. There are places in
|
|
||||||
* SDL where we provide a 32-bit timestamp that can not change without
|
|
||||||
* breaking binary compatibility, though, so this function isn't officially
|
|
||||||
* deprecated.
|
|
||||||
*
|
|
||||||
* \returns an unsigned 32-bit value representing the number of milliseconds
|
|
||||||
* since the SDL library initialized.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_TICKS_PASSED
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the number of milliseconds since SDL library initialization.
|
|
||||||
*
|
|
||||||
* Note that you should not use the SDL_TICKS_PASSED macro with values
|
|
||||||
* returned by this function, as that macro does clever math to compensate for
|
|
||||||
* the 32-bit overflow every ~49 days that SDL_GetTicks() suffers from. 64-bit
|
|
||||||
* values from this function can be safely compared directly.
|
|
||||||
*
|
|
||||||
* For example, if you want to wait 100 ms, you could do this:
|
|
||||||
*
|
|
||||||
* ```c
|
|
||||||
* const Uint64 timeout = SDL_GetTicks64() + 100;
|
|
||||||
* while (SDL_GetTicks64() < timeout) {
|
|
||||||
* // ... do work until timeout has elapsed
|
|
||||||
* }
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* \returns an unsigned 64-bit value representing the number of milliseconds
|
|
||||||
* since the SDL library initialized.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.18.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint64 SDLCALL SDL_GetTicks64(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Compare 32-bit SDL ticks values, and return true if `A` has passed `B`.
|
|
||||||
*
|
|
||||||
* This should be used with results from SDL_GetTicks(), as this macro
|
|
||||||
* attempts to deal with the 32-bit counter wrapping back to zero every ~49
|
|
||||||
* days, but should _not_ be used with SDL_GetTicks64(), which does not have
|
|
||||||
* that problem.
|
|
||||||
*
|
|
||||||
* For example, with SDL_GetTicks(), if you want to wait 100 ms, you could do
|
|
||||||
* this:
|
|
||||||
*
|
|
||||||
* ```c
|
|
||||||
* const Uint32 timeout = SDL_GetTicks() + 100;
|
|
||||||
* while (!SDL_TICKS_PASSED(SDL_GetTicks(), timeout)) {
|
|
||||||
* // ... do work until timeout has elapsed
|
|
||||||
* }
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* Note that this does not handle tick differences greater than 2^31 so take
|
|
||||||
* care when using the above kind of code with large timeout delays (tens of
|
|
||||||
* days).
|
|
||||||
*/
|
|
||||||
#define SDL_TICKS_PASSED(A, B) ((Sint32)((B) - (A)) <= 0)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the current value of the high resolution counter.
|
|
||||||
*
|
|
||||||
* This function is typically used for profiling.
|
|
||||||
*
|
|
||||||
* The counter values are only meaningful relative to each other. Differences
|
|
||||||
* between values can be converted to times by using
|
|
||||||
* SDL_GetPerformanceFrequency().
|
|
||||||
*
|
|
||||||
* \returns the current counter value.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetPerformanceFrequency
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceCounter(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the count per second of the high resolution counter.
|
|
||||||
*
|
|
||||||
* \returns a platform-specific count per second.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetPerformanceCounter
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceFrequency(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Wait a specified number of milliseconds before returning.
|
|
||||||
*
|
|
||||||
* This function waits a specified number of milliseconds before returning. It
|
|
||||||
* waits at least the specified time, but possibly longer due to OS
|
|
||||||
* scheduling.
|
|
||||||
*
|
|
||||||
* \param ms the number of milliseconds to delay.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function prototype for the timer callback function.
|
|
||||||
*
|
|
||||||
* The callback function is passed the current timer interval and returns the
|
|
||||||
* next timer interval. If the returned value is the same as the one passed
|
|
||||||
* in, the periodic alarm continues, otherwise a new alarm is scheduled. If
|
|
||||||
* the callback returns 0, the periodic alarm is cancelled.
|
|
||||||
*/
|
|
||||||
typedef Uint32 (SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Definition of the timer ID type.
|
|
||||||
*/
|
|
||||||
typedef int SDL_TimerID;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Call a callback function at a future time.
|
|
||||||
*
|
|
||||||
* If you use this function, you must pass `SDL_INIT_TIMER` to SDL_Init().
|
|
||||||
*
|
|
||||||
* The callback function is passed the current timer interval and the user
|
|
||||||
* supplied parameter from the SDL_AddTimer() call and should return the next
|
|
||||||
* timer interval. If the value returned from the callback is 0, the timer is
|
|
||||||
* canceled.
|
|
||||||
*
|
|
||||||
* The callback is run on a separate thread.
|
|
||||||
*
|
|
||||||
* Timers take into account the amount of time it took to execute the
|
|
||||||
* callback. For example, if the callback took 250 ms to execute and returned
|
|
||||||
* 1000 (ms), the timer would only wait another 750 ms before its next
|
|
||||||
* iteration.
|
|
||||||
*
|
|
||||||
* Timing may be inexact due to OS scheduling. Be sure to note the current
|
|
||||||
* time with SDL_GetTicks() or SDL_GetPerformanceCounter() in case your
|
|
||||||
* callback needs to adjust for variances.
|
|
||||||
*
|
|
||||||
* \param interval the timer delay, in milliseconds, passed to `callback`.
|
|
||||||
* \param callback the SDL_TimerCallback function to call when the specified
|
|
||||||
* `interval` elapses.
|
|
||||||
* \param param a pointer that is passed to `callback`.
|
|
||||||
* \returns a timer ID or 0 if an error occurs; call SDL_GetError() for more
|
|
||||||
* information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_RemoveTimer
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval,
|
|
||||||
SDL_TimerCallback callback,
|
|
||||||
void *param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove a timer created with SDL_AddTimer().
|
|
||||||
*
|
|
||||||
* \param id the ID of the timer to remove.
|
|
||||||
* \returns SDL_TRUE if the timer is removed or SDL_FALSE if the timer wasn't
|
|
||||||
* found.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_AddTimer
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID id);
|
|
||||||
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include <SDL2/close_code.h>
|
|
||||||
|
|
||||||
#endif /* SDL_timer_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
||||||
@@ -1,150 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2025 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* # CategoryTouch
|
|
||||||
*
|
|
||||||
* Include file for SDL touch event handling.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_touch_h_
|
|
||||||
#define SDL_touch_h_
|
|
||||||
|
|
||||||
#include <SDL2/SDL_stdinc.h>
|
|
||||||
#include <SDL2/SDL_error.h>
|
|
||||||
#include <SDL2/SDL_video.h>
|
|
||||||
|
|
||||||
#include <SDL2/begin_code.h>
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef Sint64 SDL_TouchID;
|
|
||||||
typedef Sint64 SDL_FingerID;
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_TOUCH_DEVICE_INVALID = -1,
|
|
||||||
SDL_TOUCH_DEVICE_DIRECT, /* touch screen with window-relative coordinates */
|
|
||||||
SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE, /* trackpad with absolute device coordinates */
|
|
||||||
SDL_TOUCH_DEVICE_INDIRECT_RELATIVE /* trackpad with screen cursor-relative coordinates */
|
|
||||||
} SDL_TouchDeviceType;
|
|
||||||
|
|
||||||
typedef struct SDL_Finger
|
|
||||||
{
|
|
||||||
SDL_FingerID id;
|
|
||||||
float x;
|
|
||||||
float y;
|
|
||||||
float pressure;
|
|
||||||
} SDL_Finger;
|
|
||||||
|
|
||||||
/* Used as the device ID for mouse events simulated with touch input */
|
|
||||||
#define SDL_TOUCH_MOUSEID ((Uint32)-1)
|
|
||||||
|
|
||||||
/* Used as the SDL_TouchID for touch events simulated with mouse input */
|
|
||||||
#define SDL_MOUSE_TOUCHID ((Sint64)-1)
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the number of registered touch devices.
|
|
||||||
*
|
|
||||||
* On some platforms SDL first sees the touch device if it was actually used.
|
|
||||||
* Therefore SDL_GetNumTouchDevices() may return 0 although devices are
|
|
||||||
* available. After using all devices at least once the number will be
|
|
||||||
* correct.
|
|
||||||
*
|
|
||||||
* This was fixed for Android in SDL 2.0.1.
|
|
||||||
*
|
|
||||||
* \returns the number of registered touch devices.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetTouchDevice
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the touch ID with the given index.
|
|
||||||
*
|
|
||||||
* \param index the touch device index.
|
|
||||||
* \returns the touch ID with the given index on success or 0 if the index is
|
|
||||||
* invalid; call SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetNumTouchDevices
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the touch device name as reported from the driver or NULL if the index
|
|
||||||
* is invalid.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.22.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const char* SDLCALL SDL_GetTouchName(int index);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the type of the given touch device.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.10.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_TouchDeviceType SDLCALL SDL_GetTouchDeviceType(SDL_TouchID touchID);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the number of active fingers for a given touch device.
|
|
||||||
*
|
|
||||||
* \param touchID the ID of a touch device.
|
|
||||||
* \returns the number of active fingers for a given touch device on success
|
|
||||||
* or 0 on failure; call SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetTouchFinger
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the finger object for specified touch device ID and finger index.
|
|
||||||
*
|
|
||||||
* The returned resource is owned by SDL and should not be deallocated.
|
|
||||||
*
|
|
||||||
* \param touchID the ID of the requested touch device.
|
|
||||||
* \param index the index of the requested finger.
|
|
||||||
* \returns a pointer to the SDL_Finger object or NULL if no object at the
|
|
||||||
* given ID and index could be found.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_RecordGesture
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index);
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include <SDL2/close_code.h>
|
|
||||||
|
|
||||||
#endif /* SDL_touch_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
||||||
@@ -1,205 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2025 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* # CategoryVersion
|
|
||||||
*
|
|
||||||
* This header defines the current SDL version.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_version_h_
|
|
||||||
#define SDL_version_h_
|
|
||||||
|
|
||||||
#include <SDL2/SDL_stdinc.h>
|
|
||||||
|
|
||||||
#include <SDL2/begin_code.h>
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Information about the version of SDL in use.
|
|
||||||
*
|
|
||||||
* Represents the library's version as three levels: major revision
|
|
||||||
* (increments with massive changes, additions, and enhancements), minor
|
|
||||||
* revision (increments with backwards-compatible changes to the major
|
|
||||||
* revision), and patchlevel (increments with fixes to the minor revision).
|
|
||||||
*
|
|
||||||
* \sa SDL_VERSION
|
|
||||||
* \sa SDL_GetVersion
|
|
||||||
*/
|
|
||||||
typedef struct SDL_version
|
|
||||||
{
|
|
||||||
Uint8 major; /**< major version */
|
|
||||||
Uint8 minor; /**< minor version */
|
|
||||||
Uint8 patch; /**< update version */
|
|
||||||
} SDL_version;
|
|
||||||
|
|
||||||
/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
|
|
||||||
*/
|
|
||||||
#define SDL_MAJOR_VERSION 2
|
|
||||||
#define SDL_MINOR_VERSION 32
|
|
||||||
#define SDL_PATCHLEVEL 2
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Macro to determine SDL version program was compiled against.
|
|
||||||
*
|
|
||||||
* This macro fills in a SDL_version structure with the version of the library
|
|
||||||
* you compiled against. This is determined by what header the compiler uses.
|
|
||||||
* Note that if you dynamically linked the library, you might have a slightly
|
|
||||||
* newer or older version at runtime. That version can be determined with
|
|
||||||
* SDL_GetVersion(), which, unlike SDL_VERSION(), is not a macro.
|
|
||||||
*
|
|
||||||
* \param x A pointer to a SDL_version struct to initialize.
|
|
||||||
*
|
|
||||||
* \sa SDL_version
|
|
||||||
* \sa SDL_GetVersion
|
|
||||||
*/
|
|
||||||
#define SDL_VERSION(x) \
|
|
||||||
{ \
|
|
||||||
(x)->major = SDL_MAJOR_VERSION; \
|
|
||||||
(x)->minor = SDL_MINOR_VERSION; \
|
|
||||||
(x)->patch = SDL_PATCHLEVEL; \
|
|
||||||
}
|
|
||||||
|
|
||||||
/* TODO: Remove this whole block in SDL 3 */
|
|
||||||
#if SDL_MAJOR_VERSION < 3
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This macro turns the version numbers into a numeric value:
|
|
||||||
*
|
|
||||||
* ```
|
|
||||||
* (1,2,3) -> (1203)
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* This assumes that there will never be more than 100 patchlevels.
|
|
||||||
*
|
|
||||||
* In versions higher than 2.9.0, the minor version overflows into the
|
|
||||||
* thousands digit: for example, 2.23.0 is encoded as 4300, and 2.255.99 would
|
|
||||||
* be encoded as 25799.
|
|
||||||
*
|
|
||||||
* This macro will not be available in SDL 3.x.
|
|
||||||
*/
|
|
||||||
#define SDL_VERSIONNUM(X, Y, Z) \
|
|
||||||
((X)*1000 + (Y)*100 + (Z))
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is the version number macro for the current SDL version.
|
|
||||||
*
|
|
||||||
* In versions higher than 2.9.0, the minor version overflows into the
|
|
||||||
* thousands digit: for example, 2.23.0 is encoded as 4300. This macro will
|
|
||||||
* not be available in SDL 3.x.
|
|
||||||
*
|
|
||||||
* Deprecated, use SDL_VERSION_ATLEAST or SDL_VERSION instead.
|
|
||||||
*/
|
|
||||||
#define SDL_COMPILEDVERSION \
|
|
||||||
SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)
|
|
||||||
#endif /* SDL_MAJOR_VERSION < 3 */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This macro will evaluate to true if compiled with SDL at least X.Y.Z.
|
|
||||||
*/
|
|
||||||
#define SDL_VERSION_ATLEAST(X, Y, Z) \
|
|
||||||
((SDL_MAJOR_VERSION >= X) && \
|
|
||||||
(SDL_MAJOR_VERSION > X || SDL_MINOR_VERSION >= Y) && \
|
|
||||||
(SDL_MAJOR_VERSION > X || SDL_MINOR_VERSION > Y || SDL_PATCHLEVEL >= Z))
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the version of SDL that is linked against your program.
|
|
||||||
*
|
|
||||||
* If you are linking to SDL dynamically, then it is possible that the current
|
|
||||||
* version will be different than the version you compiled against. This
|
|
||||||
* function returns the current version, while SDL_VERSION() is a macro that
|
|
||||||
* tells you what version you compiled with.
|
|
||||||
*
|
|
||||||
* This function may be called safely at any time, even before SDL_Init().
|
|
||||||
*
|
|
||||||
* \param ver the SDL_version structure that contains the version information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetRevision
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_GetVersion(SDL_version * ver);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the code revision of SDL that is linked against your program.
|
|
||||||
*
|
|
||||||
* This value is the revision of the code you are linked with and may be
|
|
||||||
* different from the code you are compiling with, which is found in the
|
|
||||||
* constant SDL_REVISION.
|
|
||||||
*
|
|
||||||
* The revision is arbitrary string (a hash value) uniquely identifying the
|
|
||||||
* exact revision of the SDL library in use, and is only useful in comparing
|
|
||||||
* against other revisions. It is NOT an incrementing number.
|
|
||||||
*
|
|
||||||
* If SDL wasn't built from a git repository with the appropriate tools, this
|
|
||||||
* will return an empty string.
|
|
||||||
*
|
|
||||||
* Prior to SDL 2.0.16, before development moved to GitHub, this returned a
|
|
||||||
* hash for a Mercurial repository.
|
|
||||||
*
|
|
||||||
* You shouldn't use this function for anything but logging it for debugging
|
|
||||||
* purposes. The string is not intended to be reliable in any way.
|
|
||||||
*
|
|
||||||
* \returns an arbitrary string, uniquely identifying the exact revision of
|
|
||||||
* the SDL library in use.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetVersion
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const char *SDLCALL SDL_GetRevision(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Obsolete function, do not use.
|
|
||||||
*
|
|
||||||
* When SDL was hosted in a Mercurial repository, and was built carefully,
|
|
||||||
* this would return the revision number that the build was created from. This
|
|
||||||
* number was not reliable for several reasons, but more importantly, SDL is
|
|
||||||
* now hosted in a git repository, which does not offer numbers at all, only
|
|
||||||
* hashes. This function only ever returns zero now. Don't use it.
|
|
||||||
*
|
|
||||||
* Before SDL 2.0.16, this might have returned an unreliable, but non-zero
|
|
||||||
* number.
|
|
||||||
*
|
|
||||||
* \deprecated Use SDL_GetRevision() instead; if SDL was carefully built, it
|
|
||||||
* will return a git hash.
|
|
||||||
*
|
|
||||||
* \returns zero, always, in modern SDL releases.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.0.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetRevision
|
|
||||||
*/
|
|
||||||
extern SDL_DEPRECATED DECLSPEC int SDLCALL SDL_GetRevisionNumber(void);
|
|
||||||
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include <SDL2/close_code.h>
|
|
||||||
|
|
||||||
#endif /* SDL_version_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,219 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 2017, Mark Callow
|
|
||||||
|
|
||||||
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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* # CategoryVulkan
|
|
||||||
*
|
|
||||||
* Header file for functions to creating Vulkan surfaces on SDL windows.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_vulkan_h_
|
|
||||||
#define SDL_vulkan_h_
|
|
||||||
|
|
||||||
#include <SDL2/SDL_video.h>
|
|
||||||
|
|
||||||
#include <SDL2/begin_code.h>
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Avoid including vulkan.h, don't define VkInstance if it's already included */
|
|
||||||
#ifdef VULKAN_H_
|
|
||||||
#define NO_SDL_VULKAN_TYPEDEFS
|
|
||||||
#endif
|
|
||||||
#ifndef NO_SDL_VULKAN_TYPEDEFS
|
|
||||||
#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object;
|
|
||||||
|
|
||||||
#if defined(__LP64__) || defined(_WIN64) || defined(__x86_64__) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__)
|
|
||||||
#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T *object;
|
|
||||||
#else
|
|
||||||
#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
VK_DEFINE_HANDLE(VkInstance)
|
|
||||||
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR)
|
|
||||||
|
|
||||||
/* Make sure to undef to avoid issues in case of later vulkan include */
|
|
||||||
#undef VK_DEFINE_HANDLE
|
|
||||||
#undef VK_DEFINE_NON_DISPATCHABLE_HANDLE
|
|
||||||
|
|
||||||
#endif /* !NO_SDL_VULKAN_TYPEDEFS */
|
|
||||||
|
|
||||||
typedef VkInstance SDL_vulkanInstance;
|
|
||||||
typedef VkSurfaceKHR SDL_vulkanSurface; /* for compatibility with Tizen */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Vulkan support functions
|
|
||||||
*
|
|
||||||
* \note SDL_Vulkan_GetInstanceExtensions & SDL_Vulkan_CreateSurface API
|
|
||||||
* is compatable with Tizen's implementation of Vulkan in SDL.
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Dynamically load the Vulkan loader library.
|
|
||||||
*
|
|
||||||
* This should be called after initializing the video driver, but before
|
|
||||||
* creating any Vulkan windows. If no Vulkan loader library is loaded, the
|
|
||||||
* default library will be loaded upon creation of the first Vulkan window.
|
|
||||||
*
|
|
||||||
* It is fairly common for Vulkan applications to link with libvulkan instead
|
|
||||||
* of explicitly loading it at run time. This will work with SDL provided the
|
|
||||||
* application links to a dynamic library and both it and SDL use the same
|
|
||||||
* search path.
|
|
||||||
*
|
|
||||||
* If you specify a non-NULL `path`, an application should retrieve all of the
|
|
||||||
* Vulkan functions it uses from the dynamic library using
|
|
||||||
* SDL_Vulkan_GetVkGetInstanceProcAddr unless you can guarantee `path` points
|
|
||||||
* to the same vulkan loader library the application linked to.
|
|
||||||
*
|
|
||||||
* On Apple devices, if `path` is NULL, SDL will attempt to find the
|
|
||||||
* `vkGetInstanceProcAddr` address within all the Mach-O images of the current
|
|
||||||
* process. This is because it is fairly common for Vulkan applications to
|
|
||||||
* link with libvulkan (and historically MoltenVK was provided as a static
|
|
||||||
* library). If it is not found, on macOS, SDL will attempt to load
|
|
||||||
* `vulkan.framework/vulkan`, `libvulkan.1.dylib`,
|
|
||||||
* `MoltenVK.framework/MoltenVK`, and `libMoltenVK.dylib`, in that order. On
|
|
||||||
* iOS, SDL will attempt to load `libMoltenVK.dylib`. Applications using a
|
|
||||||
* dynamic framework or .dylib must ensure it is included in its application
|
|
||||||
* bundle.
|
|
||||||
*
|
|
||||||
* On non-Apple devices, application linking with a static libvulkan is not
|
|
||||||
* supported. Either do not link to the Vulkan loader or link to a dynamic
|
|
||||||
* library version.
|
|
||||||
*
|
|
||||||
* \param path The platform dependent Vulkan loader library name or NULL.
|
|
||||||
* \returns 0 on success or -1 if the library couldn't be loaded; call
|
|
||||||
* SDL_GetError() for more information.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.6.
|
|
||||||
*
|
|
||||||
* \sa SDL_Vulkan_GetVkGetInstanceProcAddr
|
|
||||||
* \sa SDL_Vulkan_UnloadLibrary
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_Vulkan_LoadLibrary(const char *path);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the address of the `vkGetInstanceProcAddr` function.
|
|
||||||
*
|
|
||||||
* This should be called after either calling SDL_Vulkan_LoadLibrary() or
|
|
||||||
* creating an SDL_Window with the `SDL_WINDOW_VULKAN` flag.
|
|
||||||
*
|
|
||||||
* \returns the function pointer for `vkGetInstanceProcAddr` or NULL on error.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.6.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void *SDLCALL SDL_Vulkan_GetVkGetInstanceProcAddr(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Unload the Vulkan library previously loaded by SDL_Vulkan_LoadLibrary()
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.6.
|
|
||||||
*
|
|
||||||
* \sa SDL_Vulkan_LoadLibrary
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_Vulkan_UnloadLibrary(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the names of the Vulkan instance extensions needed to create a surface
|
|
||||||
* with SDL_Vulkan_CreateSurface.
|
|
||||||
*
|
|
||||||
* If `pNames` is NULL, then the number of required Vulkan instance extensions
|
|
||||||
* is returned in `pCount`. Otherwise, `pCount` must point to a variable set
|
|
||||||
* to the number of elements in the `pNames` array, and on return the variable
|
|
||||||
* is overwritten with the number of names actually written to `pNames`. If
|
|
||||||
* `pCount` is less than the number of required extensions, at most `pCount`
|
|
||||||
* structures will be written. If `pCount` is smaller than the number of
|
|
||||||
* required extensions, SDL_FALSE will be returned instead of SDL_TRUE, to
|
|
||||||
* indicate that not all the required extensions were returned.
|
|
||||||
*
|
|
||||||
* The `window` parameter is currently needed to be valid as of SDL 2.0.8,
|
|
||||||
* however, this parameter will likely be removed in future releases
|
|
||||||
*
|
|
||||||
* \param window A window for which the required Vulkan instance extensions
|
|
||||||
* should be retrieved (will be deprecated in a future release).
|
|
||||||
* \param pCount A pointer to an unsigned int corresponding to the number of
|
|
||||||
* extensions to be returned.
|
|
||||||
* \param pNames NULL or a pointer to an array to be filled with required
|
|
||||||
* Vulkan instance extensions.
|
|
||||||
* \returns SDL_TRUE on success, SDL_FALSE on error.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.6.
|
|
||||||
*
|
|
||||||
* \sa SDL_Vulkan_CreateSurface
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetInstanceExtensions(SDL_Window *window,
|
|
||||||
unsigned int *pCount,
|
|
||||||
const char **pNames);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a Vulkan rendering surface for a window.
|
|
||||||
*
|
|
||||||
* The `window` must have been created with the `SDL_WINDOW_VULKAN` flag and
|
|
||||||
* `instance` must have been created with extensions returned by
|
|
||||||
* SDL_Vulkan_GetInstanceExtensions() enabled.
|
|
||||||
*
|
|
||||||
* \param window The window to which to attach the Vulkan surface.
|
|
||||||
* \param instance The Vulkan instance handle.
|
|
||||||
* \param surface A pointer to a VkSurfaceKHR handle to output the newly
|
|
||||||
* created surface.
|
|
||||||
* \returns SDL_TRUE on success, SDL_FALSE on error.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.6.
|
|
||||||
*
|
|
||||||
* \sa SDL_Vulkan_GetInstanceExtensions
|
|
||||||
* \sa SDL_Vulkan_GetDrawableSize
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface(SDL_Window *window,
|
|
||||||
VkInstance instance,
|
|
||||||
VkSurfaceKHR* surface);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the size of the window's underlying drawable dimensions in pixels.
|
|
||||||
*
|
|
||||||
* This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI
|
|
||||||
* drawable, i.e. the window was created with `SDL_WINDOW_ALLOW_HIGHDPI` on a
|
|
||||||
* platform with high-DPI support (Apple calls this "Retina"), and not
|
|
||||||
* disabled by the `SDL_HINT_VIDEO_HIGHDPI_DISABLED` hint.
|
|
||||||
*
|
|
||||||
* \param window an SDL_Window for which the size is to be queried.
|
|
||||||
* \param w Pointer to the variable to write the width to or NULL.
|
|
||||||
* \param h Pointer to the variable to write the height to or NULL.
|
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.6.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetWindowSize
|
|
||||||
* \sa SDL_CreateWindow
|
|
||||||
* \sa SDL_Vulkan_CreateSurface
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_Vulkan_GetDrawableSize(SDL_Window * window,
|
|
||||||
int *w, int *h);
|
|
||||||
|
|
||||||
/* @} *//* Vulkan support functions */
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include <SDL2/close_code.h>
|
|
||||||
|
|
||||||
#endif /* SDL_vulkan_h_ */
|
|
||||||
@@ -1,189 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2025 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* WIKI CATEGORY: BeginCode */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* begin_code.h sets things up for C dynamic library function definitions,
|
|
||||||
* static inlined functions, and structures aligned at 4-byte alignment.
|
|
||||||
* If you don't like ugly C preprocessor code, don't look at this file. :)
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* This shouldn't be nested -- included it around code only. */
|
|
||||||
#ifdef SDL_begin_code_h
|
|
||||||
#error Nested inclusion of begin_code.h
|
|
||||||
#endif
|
|
||||||
#define SDL_begin_code_h
|
|
||||||
|
|
||||||
#ifndef SDL_DEPRECATED
|
|
||||||
# if defined(__GNUC__) && (__GNUC__ >= 4) /* technically, this arrived in gcc 3.1, but oh well. */
|
|
||||||
# define SDL_DEPRECATED __attribute__((deprecated))
|
|
||||||
# elif defined(_MSC_VER)
|
|
||||||
# define SDL_DEPRECATED __declspec(deprecated)
|
|
||||||
# else
|
|
||||||
# define SDL_DEPRECATED
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef SDL_UNUSED
|
|
||||||
# ifdef __GNUC__
|
|
||||||
# define SDL_UNUSED __attribute__((unused))
|
|
||||||
# else
|
|
||||||
# define SDL_UNUSED
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Some compilers use a special export keyword */
|
|
||||||
#ifndef DECLSPEC
|
|
||||||
# if defined(__WIN32__) || defined(__WINRT__) || defined(__CYGWIN__) || defined(__GDK__)
|
|
||||||
# ifdef DLL_EXPORT
|
|
||||||
# define DECLSPEC __declspec(dllexport)
|
|
||||||
# else
|
|
||||||
# define DECLSPEC
|
|
||||||
# endif
|
|
||||||
# elif defined(__OS2__)
|
|
||||||
# ifdef BUILD_SDL
|
|
||||||
# define DECLSPEC __declspec(dllexport)
|
|
||||||
# else
|
|
||||||
# define DECLSPEC
|
|
||||||
# endif
|
|
||||||
# else
|
|
||||||
# if defined(__GNUC__) && __GNUC__ >= 4
|
|
||||||
# define DECLSPEC __attribute__ ((visibility("default")))
|
|
||||||
# else
|
|
||||||
# define DECLSPEC
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* By default SDL uses the C calling convention */
|
|
||||||
#ifndef SDLCALL
|
|
||||||
#if (defined(__WIN32__) || defined(__WINRT__) || defined(__GDK__)) && !defined(__GNUC__)
|
|
||||||
#define SDLCALL __cdecl
|
|
||||||
#elif defined(__OS2__) || defined(__EMX__)
|
|
||||||
#define SDLCALL _System
|
|
||||||
# if defined (__GNUC__) && !defined(_System)
|
|
||||||
# define _System /* for old EMX/GCC compat. */
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
#define SDLCALL
|
|
||||||
#endif
|
|
||||||
#endif /* SDLCALL */
|
|
||||||
|
|
||||||
/* Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC */
|
|
||||||
#ifdef __SYMBIAN32__
|
|
||||||
#undef DECLSPEC
|
|
||||||
#define DECLSPEC
|
|
||||||
#endif /* __SYMBIAN32__ */
|
|
||||||
|
|
||||||
/* Force structure packing at 4 byte alignment.
|
|
||||||
This is necessary if the header is included in code which has structure
|
|
||||||
packing set to an alternate value, say for loading structures from disk.
|
|
||||||
The packing is reset to the previous value in close_code.h
|
|
||||||
*/
|
|
||||||
#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__)
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#pragma warning(disable: 4103)
|
|
||||||
#endif
|
|
||||||
#ifdef __clang__
|
|
||||||
#pragma clang diagnostic ignored "-Wpragma-pack"
|
|
||||||
#endif
|
|
||||||
#ifdef __BORLANDC__
|
|
||||||
#pragma nopackwarning
|
|
||||||
#endif
|
|
||||||
#ifdef _WIN64
|
|
||||||
/* Use 8-byte alignment on 64-bit architectures, so pointers are aligned */
|
|
||||||
#pragma pack(push,8)
|
|
||||||
#else
|
|
||||||
#pragma pack(push,4)
|
|
||||||
#endif
|
|
||||||
#endif /* Compiler needs structure packing set */
|
|
||||||
|
|
||||||
#ifndef SDL_INLINE
|
|
||||||
#if defined(__GNUC__)
|
|
||||||
#define SDL_INLINE __inline__
|
|
||||||
#elif defined(_MSC_VER) || defined(__BORLANDC__) || \
|
|
||||||
defined(__DMC__) || defined(__SC__) || \
|
|
||||||
defined(__WATCOMC__) || defined(__LCC__) || \
|
|
||||||
defined(__DECC) || defined(__CC_ARM)
|
|
||||||
#define SDL_INLINE __inline
|
|
||||||
#ifndef __inline__
|
|
||||||
#define __inline__ __inline
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#define SDL_INLINE inline
|
|
||||||
#ifndef __inline__
|
|
||||||
#define __inline__ inline
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif /* SDL_INLINE not defined */
|
|
||||||
|
|
||||||
#ifndef SDL_FORCE_INLINE
|
|
||||||
#if defined(_MSC_VER)
|
|
||||||
#define SDL_FORCE_INLINE __forceinline
|
|
||||||
#elif ( (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) )
|
|
||||||
#define SDL_FORCE_INLINE __attribute__((always_inline)) static __inline__
|
|
||||||
#else
|
|
||||||
#define SDL_FORCE_INLINE static SDL_INLINE
|
|
||||||
#endif
|
|
||||||
#endif /* SDL_FORCE_INLINE not defined */
|
|
||||||
|
|
||||||
#ifndef SDL_NORETURN
|
|
||||||
#if defined(__GNUC__)
|
|
||||||
#define SDL_NORETURN __attribute__((noreturn))
|
|
||||||
#elif defined(_MSC_VER)
|
|
||||||
#define SDL_NORETURN __declspec(noreturn)
|
|
||||||
#else
|
|
||||||
#define SDL_NORETURN
|
|
||||||
#endif
|
|
||||||
#endif /* SDL_NORETURN not defined */
|
|
||||||
|
|
||||||
/* Apparently this is needed by several Windows compilers */
|
|
||||||
#if !defined(__MACH__)
|
|
||||||
#ifndef NULL
|
|
||||||
#ifdef __cplusplus
|
|
||||||
#define NULL 0
|
|
||||||
#else
|
|
||||||
#define NULL ((void *)0)
|
|
||||||
#endif
|
|
||||||
#endif /* NULL */
|
|
||||||
#endif /* ! Mac OS X - breaks precompiled headers */
|
|
||||||
|
|
||||||
#ifndef SDL_FALLTHROUGH
|
|
||||||
#if (defined(__cplusplus) && __cplusplus >= 201703L) || \
|
|
||||||
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202000L)
|
|
||||||
#define SDL_FALLTHROUGH [[fallthrough]]
|
|
||||||
#else
|
|
||||||
#if defined(__has_attribute) && !defined(__SUNPRO_C) && !defined(__SUNPRO_CC)
|
|
||||||
#define SDL_HAS_FALLTHROUGH __has_attribute(__fallthrough__)
|
|
||||||
#else
|
|
||||||
#define SDL_HAS_FALLTHROUGH 0
|
|
||||||
#endif /* __has_attribute */
|
|
||||||
#if SDL_HAS_FALLTHROUGH && \
|
|
||||||
((defined(__GNUC__) && __GNUC__ >= 7) || \
|
|
||||||
(defined(__clang_major__) && __clang_major__ >= 10))
|
|
||||||
#define SDL_FALLTHROUGH __attribute__((__fallthrough__))
|
|
||||||
#else
|
|
||||||
#define SDL_FALLTHROUGH do {} while (0) /* fallthrough */
|
|
||||||
#endif /* SDL_HAS_FALLTHROUGH */
|
|
||||||
#undef SDL_HAS_FALLTHROUGH
|
|
||||||
#endif /* C++17 or C2x */
|
|
||||||
#endif /* SDL_FALLTHROUGH not defined */
|
|
||||||
@@ -1,78 +0,0 @@
|
|||||||
# SDL2 CMake configuration file:
|
|
||||||
# This file is meant to be placed in Resources/CMake of a SDL2 framework
|
|
||||||
|
|
||||||
# INTERFACE_LINK_OPTIONS needs CMake 3.12
|
|
||||||
cmake_minimum_required(VERSION 3.12)
|
|
||||||
|
|
||||||
include(FeatureSummary)
|
|
||||||
set_package_properties(SDL2 PROPERTIES
|
|
||||||
URL "https://www.libsdl.org/"
|
|
||||||
DESCRIPTION "low level access to audio, keyboard, mouse, joystick, and graphics hardware"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Copied from `configure_package_config_file`
|
|
||||||
macro(set_and_check _var _file)
|
|
||||||
set(${_var} "${_file}")
|
|
||||||
if(NOT EXISTS "${_file}")
|
|
||||||
message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
|
|
||||||
endif()
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
# Copied from `configure_package_config_file`
|
|
||||||
macro(check_required_components _NAME)
|
|
||||||
foreach(comp ${${_NAME}_FIND_COMPONENTS})
|
|
||||||
if(NOT ${_NAME}_${comp}_FOUND)
|
|
||||||
if(${_NAME}_FIND_REQUIRED_${comp})
|
|
||||||
set(${_NAME}_FOUND FALSE)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
set(SDL2_FOUND TRUE)
|
|
||||||
|
|
||||||
# Compute the installation prefix relative to this file.
|
|
||||||
set(SDL2_FRAMEWORK_PATH "${CMAKE_CURRENT_LIST_DIR}") # > /SDL2.framework/Resources/CMake/
|
|
||||||
get_filename_component(SDL2_FRAMEWORK_PATH "${SDL2_FRAMEWORK_PATH}" REALPATH) # > /SDL2.framework/Versions/Current/Resources/CMake
|
|
||||||
get_filename_component(SDL2_FRAMEWORK_PATH "${SDL2_FRAMEWORK_PATH}" REALPATH) # > /SDL2.framework/Versions/A/Resources/CMake/
|
|
||||||
get_filename_component(SDL2_FRAMEWORK_PATH "${SDL2_FRAMEWORK_PATH}" PATH) # > /SDL2.framework/Versions/A/Resources/
|
|
||||||
get_filename_component(SDL2_FRAMEWORK_PATH "${SDL2_FRAMEWORK_PATH}" PATH) # > /SDL2.framework/Versions/A/
|
|
||||||
get_filename_component(SDL2_FRAMEWORK_PATH "${SDL2_FRAMEWORK_PATH}" PATH) # > /SDL2.framework/Versions/
|
|
||||||
get_filename_component(SDL2_FRAMEWORK_PATH "${SDL2_FRAMEWORK_PATH}" PATH) # > /SDL2.framework/
|
|
||||||
get_filename_component(SDL2_FRAMEWORK_PARENT_PATH "${SDL2_FRAMEWORK_PATH}" PATH) # > /
|
|
||||||
|
|
||||||
# For compatibility with autotools sdl2-config.cmake, provide SDL2_* variables.
|
|
||||||
|
|
||||||
set_and_check(SDL2_PREFIX "${SDL2_FRAMEWORK_PATH}")
|
|
||||||
set_and_check(SDL2_EXEC_PREFIX "${SDL2_FRAMEWORK_PATH}")
|
|
||||||
set_and_check(SDL2_INCLUDE_DIR "${SDL2_FRAMEWORK_PATH}/Headers")
|
|
||||||
set(SDL2_INCLUDE_DIRS "${SDL2_INCLUDE_DIR};${SDL2_FRAMEWORK_PATH}")
|
|
||||||
set_and_check(SDL2_BINDIR "${SDL2_FRAMEWORK_PATH}")
|
|
||||||
set_and_check(SDL2_LIBDIR "${SDL2_FRAMEWORK_PATH}")
|
|
||||||
|
|
||||||
set(SDL2_LIBRARIES "SDL2::SDL2")
|
|
||||||
|
|
||||||
# All targets are created, even when some might not be requested though COMPONENTS.
|
|
||||||
# This is done for compatibility with CMake generated SDL2-target.cmake files.
|
|
||||||
|
|
||||||
if(NOT TARGET SDL2::SDL2)
|
|
||||||
add_library(SDL2::SDL2 SHARED IMPORTED)
|
|
||||||
set_target_properties(SDL2::SDL2
|
|
||||||
PROPERTIES
|
|
||||||
FRAMEWORK "TRUE"
|
|
||||||
IMPORTED_LOCATION "${SDL2_FRAMEWORK_PATH}/Versions/A/SDL2"
|
|
||||||
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIRS}"
|
|
||||||
COMPATIBLE_INTERFACE_BOOL "SDL2_SHARED"
|
|
||||||
INTERFACE_SDL2_SHARED "ON"
|
|
||||||
COMPATIBLE_INTERFACE_STRING "SDL_VERSION"
|
|
||||||
INTERFACE_SDL_VERSION "SDL2"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
set(SDL2_SDL2_FOUND TRUE)
|
|
||||||
|
|
||||||
if(NOT TARGET SDL2::SDL2main)
|
|
||||||
add_library(SDL2::SDL2main INTERFACE IMPORTED)
|
|
||||||
endif()
|
|
||||||
set(SDL2_SDL2main_FOUND TRUE)
|
|
||||||
|
|
||||||
check_required_components(SDL2)
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
The Simple DirectMedia Layer (SDL for short) is a cross-platform
|
|
||||||
library designed to make it easy to write multi-media software,
|
|
||||||
such as games and emulators.
|
|
||||||
|
|
||||||
The Simple DirectMedia Layer library source code is available from:
|
|
||||||
http://www.libsdl.org/
|
|
||||||
|
|
||||||
This library is distributed under the terms of the zlib license:
|
|
||||||
http://zlib.net/zlib_license.html
|
|
||||||
|
|
||||||
|
|
||||||
This packages contains the SDL framework for OS X.
|
|
||||||
Conforming with Apple guidelines, this framework
|
|
||||||
contains both the SDL runtime component and development header files.
|
|
||||||
|
|
||||||
|
|
||||||
To Install:
|
|
||||||
Copy the SDL2.framework to /Library/Frameworks
|
|
||||||
|
|
||||||
You may alternatively install it in <Your home directory>/Library/Frameworks
|
|
||||||
if your access privileges are not high enough.
|
|
||||||
|
|
||||||
|
|
||||||
Use in CMake projects:
|
|
||||||
SDL2.framework can be used in CMake projects using the following pattern:
|
|
||||||
```
|
|
||||||
find_package(SDL2 REQUIRED COMPONENTS SDL2)
|
|
||||||
add_executable(my_game ${MY_SOURCES})
|
|
||||||
target_link_libraries(my_game PRIVATE SDL2::SDL2)
|
|
||||||
```
|
|
||||||
If SDL2.framework is installed in a non-standard location,
|
|
||||||
please refer to the following link for ways to configure CMake:
|
|
||||||
https://cmake.org/cmake/help/latest/command/find_package.html#config-mode-search-procedure
|
|
||||||
|
|
||||||
|
|
||||||
Additional References:
|
|
||||||
|
|
||||||
- Screencast tutorials for getting started with OpenSceneGraph/Mac OS X are
|
|
||||||
available at:
|
|
||||||
http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials/MacOSXTips
|
|
||||||
Though these are OpenSceneGraph centric, the same exact concepts apply to
|
|
||||||
SDL, thus the videos are recommended for everybody getting started with
|
|
||||||
developing on Mac OS X. (You can skim over the PlugIns stuff since SDL
|
|
||||||
doesn't have any PlugIns to worry about.)
|
|
||||||
Binary file not shown.
Binary file not shown.
@@ -1,933 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>files</key>
|
|
||||||
<dict>
|
|
||||||
<key>Resources/CMake/sdl2-config-version.cmake</key>
|
|
||||||
<data>
|
|
||||||
GOmfPsl6+zUzjRroR1OeRUu1Do0=
|
|
||||||
</data>
|
|
||||||
<key>Resources/CMake/sdl2-config.cmake</key>
|
|
||||||
<data>
|
|
||||||
HFjU0snuPDDpVpeJJsOGAfWEqrU=
|
|
||||||
</data>
|
|
||||||
<key>Resources/Info.plist</key>
|
|
||||||
<data>
|
|
||||||
Dy9w1XfagXeZ0e81ZSWsFJg+azY=
|
|
||||||
</data>
|
|
||||||
<key>Resources/License.txt</key>
|
|
||||||
<data>
|
|
||||||
KX1rSrXSX56fKz5R5KaZfmWONHY=
|
|
||||||
</data>
|
|
||||||
<key>Resources/ReadMe.txt</key>
|
|
||||||
<data>
|
|
||||||
04Gl3MPa3Etx4qtkaftLHaPqBVU=
|
|
||||||
</data>
|
|
||||||
<key>Resources/default.metallib</key>
|
|
||||||
<data>
|
|
||||||
BO5njZwigEYbd1h6TX/xkchzM2o=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>files2</key>
|
|
||||||
<dict>
|
|
||||||
<key>Headers/SDL.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
kXZkl2ZSSQyVrmrJOXBRaAtXY0I=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
xDumk5UiAj/35enjtwvoNz9i9FWhFvojHs4+59cpnbI=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_assert.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
lr3sQSBPznWi8vveV34dIyAW8BM=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
BGNHXTS5rBD3wuyUkKhgbl50o8FUh12u96oFkrA4KFo=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_atomic.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
R5vrwDefFJeaJsnGkly4WqJ7UPw=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
DgHR+hJ6x1M3+NB4wUNI4S8Xj2awpMe4dWD1hJ6C+Ak=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_audio.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
vD35LoraUn0dXRtYXURSOA2fmzo=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
7GEn/t1dKLeDAz+dClqETucnBCg0JQiRgVOxmOn7JFM=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_bits.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
m/yLRLFvcyhpnaReaUyzn+DrKjY=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
o2NLdv2ji2kQE1gvsKNW/xcd1txMxhXGRX6D9LXZpA0=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_blendmode.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
ZhDDvn1XJCv+eMyWGDNz26CFI58=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
bQjeL6hATkceL0ngnlzrYY2Zp7jNdLW26Cr3Mt7eM6o=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_clipboard.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
uq20kABjWOFzXdejk/Q8rC8a5AM=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
u9qUforELEcJfq+QEHCgZ3wd8g5tPW9JI1+zj4xEm5E=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_config.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
hI+pWoBtzhWnuh9kOELW4J4hs8o=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
s/hYepaQobM/ewrw1MULpg/LKbyWnIHEVZQ4sbSY7ws=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_config_macosx.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
GlLgLXuBTBmhZyraeiSZZfvLusQ=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
ouwOfhautxowjLZuYmCpXZ89bZkmIoOrawg13ReI0vE=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_copying.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
7PsNEqTRutlWBeYrk5he8dfe/wA=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
P5C+RwwY+Z9K7zlETpN07boWbP6xuQ+Z81KGzDOSRkI=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_cpuinfo.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
C0H58cl/xghA4cpTvltFa5zADSc=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
JpncPWHkqqQ39WvjWBFvdMLGOAhlGvwtEdtEflUSwwQ=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_endian.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
Oo+H5bGafn8oIzZ5A2DI+6yJsNI=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
ejsqpRB8uahMk/Zo2KMVUes2H9nWrrSMDXtypIMmAUE=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_error.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
ZxWtU4QHHrwxJbxAg+0wA/BX2OA=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
SsWIV+Yerb7smmRk25OcD33qX1UCM94jrw0iu38zQco=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_events.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
34TF6C56a/HKmGg7hzyO88NJle4=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
2Po+gCuGCGxgmR6DdLPrWu2deTHFLhWAFPZUCkap8Mo=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_filesystem.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
5OC/DWaJoiaHRxExqCHZ1QPRP4Y=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
tZpKt7pLk5yKvjAiPMqdoeFsNWGZlwY390pZAzyeCLM=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_gamecontroller.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
I/FIRlgGO0GQxPa7tmoA9QbfT8s=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
kcdn3wsLxbvOYUIfT6RjZ6PVwEJyiP19UHCVZ1SK0Xg=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_gesture.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
clELTT6eZHcdLgYclKLVVihe3vU=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
jcGQi63lLK6d0mKPptalC8oIPHIYkJXVFmB+Ph03FIc=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_guid.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
dgThPofjZztWJ48hlLrifr+7Dtc=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
+2lkD4yu0yhf1fO7Cbd91+Zw7rsW1R7oVeT9Z6YOwZU=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_haptic.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
yhzVxf1Kdqq1Xr2Sg+pJbTqkwQ0=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
q4GVfzAB4sSEDj+jIPWp9Xw2B3HauyTHo/o060eaygQ=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_hidapi.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
z+fSffaSHzN3Y/+Fvx/Q3ZxzlvM=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
CBbGekbczUMw0zOsfPZwjkntaN1nlc4fho8S5LTQbTc=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_hints.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
x8pHmxmobsfIdGQ3U8T/wVTr4pc=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
6tHFNKbAt52Tfvnd9I5945Lgf9zMlRYqeRuWrPW2wfo=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_joystick.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
6XHQGqWAhtUqF+5nJXvM5qTYwRE=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
uKjhvX3KIhPTT/lpAu1Y3q/KMqIQXVfi2H+VFfmb4mg=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_keyboard.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
Ml+MLe134SMquN/d5bx948jSG2k=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
SO9J+my4T35L6w60ZTEC98mabEy2W14U3bXg8ZMSodQ=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_keycode.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
m7xeznNONTBfKkVWp/d041JqNxc=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
wl5XcoxPLKXuZfRaVMHaN5CjnygVgrSNowFRESevpd8=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_loadso.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
5L842bJf5iUWjoTpu+UQFgKa09I=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
zryjqdnh9zWQRgbBLaH8ZzFYHxS0/wEeBXqq9KW8wds=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_locale.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
PIHUy1X2+y0z6c3pxt/ge6pBcvo=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
/rfGMxdMoHftVV0QUdzzyMCV5DNBVAJ2t2fDfmXGEo0=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_log.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
+/4vJepf9ntrZJr5bivvVp/QUio=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
CIY407VUnS9pLPMOxgjJpAGcv3zny3Ls+Y7yhVO0qqE=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_main.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
E0g/VXfi2wtzpgsPenS2Si+WzoU=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
t7yYbM3kL+w4Cjbt6cIcyLJ59lDFO7YwlCxbNXPf7/8=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_messagebox.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
S/UqHw1xzOq/G5whAbsqqR83zFE=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
9aB/qv/nBBV7BOwuqIY4MXSD6bpDrkA4afejIwfNBp8=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_metal.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
fmU5Aftuv130e3jkyJpHaPg3eqM=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
hwRNMv854qroz8h1X0Aaab5nt3a6JLY0GSILyvaBvCk=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_misc.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
R+Xst5koKUN3c8Q7ABjNFogS7S4=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
lczD5q4vVNJ0MwkE9oLIYaZsWesbVlAu1cLQ1Dg+nmM=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_mouse.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
n11vFqL98fGtKLlIjg5mmNQIL68=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
MDPaWpoGwlvOF7QxkDl0rh6bjsPhvf4oRwDOdTzWjTA=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_mutex.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
+P42iYJpHbiwGZ7bBhCJFWSQgos=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
EcYUNrtTCWC+fr7AUjZLpWNxq0TH0NmEZ3LkjVV9/TE=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_name.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
f29xmTe3SPKpaOPghsKTawVSasI=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
/cbGSHNCIChQVq2LgnNRHHXVvgDRf8HqPrTAZSaxP6M=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_opengl.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
3leUh6Gq18sJB4BEcKQy+iQolc0=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
k8R1LV5eKvkCsaMBHfJ1lNNI7I/dqmIbqr+qjbsRn64=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_opengl_glext.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
eOvalGUielSzNuOWWDLYkwqpYrg=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
GrsoiRybBmG2/zdJ3iZx2l/hK+tbyxgzsta99ciezfg=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_opengles.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
P5Pj7wk9Nf1ixGBxO3GiEwSI0TU=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
7UPklt2GVWwjaLS9BScuAQJ1VnJfzyOWQ7XffOUgKF4=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_opengles2.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
iaFWK+305+CdfRcsenhRwwxW348=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
p6YaZQLVlsW+Xtmwq2apbUUN0V5PQBqbL+Kb50ty874=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_opengles2_gl2.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
GbD4M9ZIR9sxgLX4G8T/ojLVQJk=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
1uxEsdc/OvzjogrGl223+z2sZWxRkPC1Y+TOkNeaFao=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_opengles2_gl2ext.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
frTvd+EfShO/uonAvnnsnPkqc80=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
T8WwA03N6cElki4+cNAUiaazNQdoVu5mApThpjBaNxk=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_opengles2_gl2platform.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
JO1DB28zz7TCz/P5YCSvV1PaqWg=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
R3m+mZrNGQRFgjjwnIaYO3lgrEDmEuBdstuX22FfHg8=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_opengles2_khrplatform.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
mBjqEs+5bGC9u1ED2M93VNzONPQ=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
ex4Bqqetj2/DS1x733nr9RibsJ4sTS55/F01BiPRHoM=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_pixels.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
HOeOsR1S852BPw+GyoQxCu8dnrk=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
DMnCgERmRqNhjIu8bEnce3WOlhLueJ7/2VQlkld0cqM=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_platform.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
2EuaPqxxPCCnhQT8TgXVlAGPVd0=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
/UdCUiELMW5LpnyQtiRIrltB0fmsOUuo5PcJfihUSP4=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_power.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
OcflGeCM0fbVTFzZKWdM1eKVKlg=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
u80xdoA8Qm6LjBYuxop4mIHrpcCya4BL5oxrH9I+DaM=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_quit.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
UesdW/A6uv3gPVlX0rttt2qUYY8=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
1orkEGymBZUzW8+XfZkjeGEbgKcXPxZkwleDgdTXWFU=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_rect.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
0tzoAGRmXs2qe4YGcW7xEB44mgI=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
4a+aTUFeNyT8FcphJmUM2TJsOqpZr5pDXXmKjQWfwLA=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_render.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
ixhZ1LVMllogghoxkbkrnjkmfm0=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
YKCPJJ9GkJ8hiZ95O876mXtZ5SvBv5ViiUsgYkuykPs=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_revision.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
wlRT2sTA0dP97Vvcah+M13dM6Ng=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
Dn4kx2zaANESjNuADThOyPh3QukKZMRvUrIcDo8vIR4=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_rwops.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
RoEkA5bj0f8XwVQyVcYHxlRLH+M=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
x/9RNtJfolHcK7DxJwPH3corQGd2BbzC8PgvzzHSxX8=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_scancode.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
uT6v61MI9lFx99szDhZfL4N/rGc=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
MzwGUSgeP0Cmj7z20owSg5EsfpwV9yfG7bIFUqgzric=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_sensor.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
5r6P94IS5vfiIJMZhrMZNpabid0=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
gAFmGVEIFr3q+SQiXmHBctnS1qMa9guogUbp2JDeDdk=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_shape.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
jmzKazW1l/+89mfDEsa68yfO+M0=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
zrlHT6aGBYNFY5OOhnuPp6/HUIq32NzHq7RcHEnY4ww=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_stdinc.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
ghpA/MCplmhdO4hJb25EXKh4+s4=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
cSrXM8EyC4v/PujaxFfax4TvFm2zt24dFebf53otApM=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_surface.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
4Ep9Q21aB+MvJ4ohfIaIobCiERU=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
HBm9M4a5z2TAO7jYrEREEBPmFIZ10He+SyiAhJ90C6M=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_system.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
kBnA4mSoS+aU91if04kxha03KHY=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
EV4kDREc7p2kR4LtHoOuY6J2Rsm+KX65ZQv58y+QVz8=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_syswm.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
yIC4ZT4qln13hliROuzUyx3FhyY=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
rXp/rtBhEjRJoZnGV9F6IrAIdoE5WJdtUtwNypSUF7E=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_thread.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
OFKWGOtypbrEI7UTrkw42voWf20=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
7qn2qV503yS1JbYFUB2HvCHoN1AzetzjrmZWZIIf3qo=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_timer.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
GIT08iK8cG99/tVgSH4+ACwG9mU=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
Q8Bv8+1i2eKfGySzfRXZT03Clzce9l8uP9QDjGTzzVc=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_touch.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
QmkTEEIiL2jICJu6ecf2wLwyhAU=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
MOw1u2X8Zk9fljCdbfSRRyEXEbgT+caV26N+T0NjF0s=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_types.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
Uh90u3TkJONniC7ql41abwXUPa4=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
jrJoMRTqqOrdJC6jL9UHPmZHjACvE7fU8poxxLLjKd8=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_version.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
0p5YxpDU0ZKVW3O7oaiUEbQvQgM=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
EtiQXi0LseubTFgUWQb2VmPg9hMBLtbyUYL/q744sqo=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_video.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
pbav/kF15VNS1e5QTP2fYMa9u+E=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
XyZkUty0lOswE4c3LokQs92335pjv6Mdqu/eFkB0XNo=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_vulkan.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
gLQPn/TnSR9Mw0SzIieM7cyPPQY=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
gqb0mAn18Ax0d7+3MwoDmO2kMJ2wXR900U/Kxs7QP8A=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/begin_code.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
F5WwG4LxINu6xsjkDri880RDPAQ=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
mAPasp+0UizjUAq3iSYOliLfYwfOkPkq0gwYCOGcTns=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/close_code.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
Hv+nlnxXg4WGAt4qPpTk93cX3R0=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
RZnpztunRR/wemMG8LdTG+7QWxxaZbGiYT0bdxvkP9o=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Resources/CMake/sdl2-config-version.cmake</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
GOmfPsl6+zUzjRroR1OeRUu1Do0=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
YeQ8SoXGqMam3mk/39htvQ5fF5Twd16X5JPfl7/hSuk=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Resources/CMake/sdl2-config.cmake</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
HFjU0snuPDDpVpeJJsOGAfWEqrU=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
3CcBgLSrIjtN3CnKminQz7NzcDt2kcMM2AW/PSX3/0Q=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Resources/Info.plist</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
Dy9w1XfagXeZ0e81ZSWsFJg+azY=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
BAddkaN2r4dEHPxmdAwZ33wKCEuHqn1y3xUe9sQ/wtY=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Resources/License.txt</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
KX1rSrXSX56fKz5R5KaZfmWONHY=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
N7l1tSc3NOoVf7HjY9BhkQNvKJ7Kd2f3NpZ4Fr7dFW8=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Resources/ReadMe.txt</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
04Gl3MPa3Etx4qtkaftLHaPqBVU=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
OjTqSEaeNJpJyrrZIzKimvTn011CW6ucNulPPxUwgL0=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Resources/default.metallib</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
BO5njZwigEYbd1h6TX/xkchzM2o=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
Fe5XhVrmpOq2Hqk5Jy7Yhqd+IXcB/PDUI58bHeKR4Cg=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
|
||||||
<key>rules</key>
|
|
||||||
<dict>
|
|
||||||
<key>^Resources/</key>
|
|
||||||
<true/>
|
|
||||||
<key>^Resources/.*\.lproj/</key>
|
|
||||||
<dict>
|
|
||||||
<key>optional</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>1000</real>
|
|
||||||
</dict>
|
|
||||||
<key>^Resources/.*\.lproj/locversion.plist$</key>
|
|
||||||
<dict>
|
|
||||||
<key>omit</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>1100</real>
|
|
||||||
</dict>
|
|
||||||
<key>^Resources/Base\.lproj/</key>
|
|
||||||
<dict>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>1010</real>
|
|
||||||
</dict>
|
|
||||||
<key>^version.plist$</key>
|
|
||||||
<true/>
|
|
||||||
</dict>
|
|
||||||
<key>rules2</key>
|
|
||||||
<dict>
|
|
||||||
<key>.*\.dSYM($|/)</key>
|
|
||||||
<dict>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>11</real>
|
|
||||||
</dict>
|
|
||||||
<key>^(.*/)?\.DS_Store$</key>
|
|
||||||
<dict>
|
|
||||||
<key>omit</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>2000</real>
|
|
||||||
</dict>
|
|
||||||
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
|
|
||||||
<dict>
|
|
||||||
<key>nested</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>10</real>
|
|
||||||
</dict>
|
|
||||||
<key>^.*</key>
|
|
||||||
<true/>
|
|
||||||
<key>^Info\.plist$</key>
|
|
||||||
<dict>
|
|
||||||
<key>omit</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>20</real>
|
|
||||||
</dict>
|
|
||||||
<key>^PkgInfo$</key>
|
|
||||||
<dict>
|
|
||||||
<key>omit</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>20</real>
|
|
||||||
</dict>
|
|
||||||
<key>^Resources/</key>
|
|
||||||
<dict>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>20</real>
|
|
||||||
</dict>
|
|
||||||
<key>^Resources/.*\.lproj/</key>
|
|
||||||
<dict>
|
|
||||||
<key>optional</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>1000</real>
|
|
||||||
</dict>
|
|
||||||
<key>^Resources/.*\.lproj/locversion.plist$</key>
|
|
||||||
<dict>
|
|
||||||
<key>omit</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>1100</real>
|
|
||||||
</dict>
|
|
||||||
<key>^Resources/Base\.lproj/</key>
|
|
||||||
<dict>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>1010</real>
|
|
||||||
</dict>
|
|
||||||
<key>^[^/]+$</key>
|
|
||||||
<dict>
|
|
||||||
<key>nested</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>10</real>
|
|
||||||
</dict>
|
|
||||||
<key>^embedded\.provisionprofile$</key>
|
|
||||||
<dict>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>20</real>
|
|
||||||
</dict>
|
|
||||||
<key>^version\.plist$</key>
|
|
||||||
<dict>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>20</real>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
||||||
BIN
release/SDL3.dll
Normal file
BIN
release/SDL3.dll
Normal file
Binary file not shown.
Binary file not shown.
150
release/create_icons.py
Normal file
150
release/create_icons.py
Normal file
@@ -0,0 +1,150 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import shutil
|
||||||
|
import subprocess
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
|
def check_dependencies():
|
||||||
|
"""Verifica que ImageMagick esté instalado"""
|
||||||
|
try:
|
||||||
|
subprocess.run(['magick', '--version'], capture_output=True, check=True)
|
||||||
|
except (subprocess.CalledProcessError, FileNotFoundError):
|
||||||
|
print("Error: ImageMagick no está instalado o no se encuentra en el PATH")
|
||||||
|
print("Instala ImageMagick desde: https://imagemagick.org/script/download.php")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
# Verificar iconutil solo en macOS
|
||||||
|
if sys.platform == 'darwin':
|
||||||
|
try:
|
||||||
|
# iconutil no tiene --version, mejor usar which o probar con -h
|
||||||
|
result = subprocess.run(['which', 'iconutil'], capture_output=True, check=True)
|
||||||
|
if result.returncode == 0:
|
||||||
|
print("✓ iconutil disponible - se crearán archivos .ico e .icns")
|
||||||
|
except (subprocess.CalledProcessError, FileNotFoundError):
|
||||||
|
print("Error: iconutil no está disponible (solo funciona en macOS)")
|
||||||
|
print("Solo se creará el archivo .ico")
|
||||||
|
else:
|
||||||
|
print("ℹ️ Sistema no-macOS detectado - solo se creará archivo .ico")
|
||||||
|
|
||||||
|
|
||||||
|
def create_icons(input_file):
|
||||||
|
"""Crea archivos .icns e .ico a partir de un PNG"""
|
||||||
|
|
||||||
|
# Verificar que el archivo existe
|
||||||
|
if not os.path.isfile(input_file):
|
||||||
|
print(f"Error: El archivo {input_file} no existe.")
|
||||||
|
return False
|
||||||
|
|
||||||
|
# Obtener información del archivo
|
||||||
|
file_path = Path(input_file)
|
||||||
|
file_dir = file_path.parent
|
||||||
|
file_name = file_path.stem # Nombre sin extensión
|
||||||
|
file_extension = file_path.suffix
|
||||||
|
|
||||||
|
if file_extension.lower() not in ['.png', '.jpg', '.jpeg', '.bmp', '.tiff']:
|
||||||
|
print(f"Advertencia: {file_extension} puede no ser compatible. Se recomienda usar PNG.")
|
||||||
|
|
||||||
|
# Crear archivo .ico usando el método simplificado
|
||||||
|
ico_output = file_dir / f"{file_name}.ico"
|
||||||
|
try:
|
||||||
|
print(f"Creando {ico_output}...")
|
||||||
|
subprocess.run([
|
||||||
|
'magick', str(input_file),
|
||||||
|
'-define', 'icon:auto-resize=256,128,64,48,32,16',
|
||||||
|
str(ico_output)
|
||||||
|
], check=True)
|
||||||
|
print(f"✓ Archivo .ico creado: {ico_output}")
|
||||||
|
except subprocess.CalledProcessError as e:
|
||||||
|
print(f"Error creando archivo .ico: {e}")
|
||||||
|
return False
|
||||||
|
|
||||||
|
# Crear archivo .icns (solo en macOS)
|
||||||
|
if sys.platform == 'darwin':
|
||||||
|
try:
|
||||||
|
# Crear carpeta temporal para iconset
|
||||||
|
temp_folder = file_dir / "icon.iconset"
|
||||||
|
|
||||||
|
# Eliminar carpeta temporal si existe
|
||||||
|
if temp_folder.exists():
|
||||||
|
shutil.rmtree(temp_folder)
|
||||||
|
|
||||||
|
# Crear carpeta temporal
|
||||||
|
temp_folder.mkdir(parents=True)
|
||||||
|
|
||||||
|
# Definir los tamaños y nombres de archivo para .icns
|
||||||
|
icon_sizes = [
|
||||||
|
(16, "icon_16x16.png"),
|
||||||
|
(32, "icon_16x16@2x.png"),
|
||||||
|
(32, "icon_32x32.png"),
|
||||||
|
(64, "icon_32x32@2x.png"),
|
||||||
|
(128, "icon_128x128.png"),
|
||||||
|
(256, "icon_128x128@2x.png"),
|
||||||
|
(256, "icon_256x256.png"),
|
||||||
|
(512, "icon_256x256@2x.png"),
|
||||||
|
(512, "icon_512x512.png"),
|
||||||
|
(1024, "icon_512x512@2x.png")
|
||||||
|
]
|
||||||
|
|
||||||
|
print("Generando imágenes para .icns...")
|
||||||
|
# Crear cada tamaño de imagen
|
||||||
|
for size, output_name in icon_sizes:
|
||||||
|
output_path = temp_folder / output_name
|
||||||
|
subprocess.run([
|
||||||
|
'magick', str(input_file),
|
||||||
|
'-resize', f'{size}x{size}',
|
||||||
|
str(output_path)
|
||||||
|
], check=True)
|
||||||
|
|
||||||
|
# Crear archivo .icns usando iconutil
|
||||||
|
icns_output = file_dir / f"{file_name}.icns"
|
||||||
|
print(f"Creando {icns_output}...")
|
||||||
|
subprocess.run([
|
||||||
|
'iconutil', '-c', 'icns',
|
||||||
|
str(temp_folder),
|
||||||
|
'-o', str(icns_output)
|
||||||
|
], check=True)
|
||||||
|
|
||||||
|
# Limpiar carpeta temporal
|
||||||
|
if temp_folder.exists():
|
||||||
|
shutil.rmtree(temp_folder)
|
||||||
|
|
||||||
|
print(f"✓ Archivo .icns creado: {icns_output}")
|
||||||
|
|
||||||
|
except subprocess.CalledProcessError as e:
|
||||||
|
print(f"Error creando archivo .icns: {e}")
|
||||||
|
# Limpiar carpeta temporal en caso de error
|
||||||
|
if temp_folder.exists():
|
||||||
|
shutil.rmtree(temp_folder)
|
||||||
|
return False
|
||||||
|
else:
|
||||||
|
print("ℹ️ Archivo .icns no creado (solo disponible en macOS)")
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
"""Función principal"""
|
||||||
|
# Verificar argumentos
|
||||||
|
if len(sys.argv) != 2:
|
||||||
|
print(f"Uso: {sys.argv[0]} ARCHIVO")
|
||||||
|
print("Ejemplo: python3 create_icons.py imagen.png")
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
|
input_file = sys.argv[1]
|
||||||
|
|
||||||
|
# Verificar dependencias
|
||||||
|
check_dependencies()
|
||||||
|
|
||||||
|
# Crear iconos
|
||||||
|
if create_icons(input_file):
|
||||||
|
print("\n✅ Proceso completado exitosamente")
|
||||||
|
else:
|
||||||
|
print("\n❌ El proceso falló")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
90
release/frameworks/SDL3.xcframework/Info.plist
Normal file
90
release/frameworks/SDL3.xcframework/Info.plist
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>AvailableLibraries</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>BinaryPath</key>
|
||||||
|
<string>SDL3.framework/Versions/A/SDL3</string>
|
||||||
|
<key>LibraryIdentifier</key>
|
||||||
|
<string>macos-arm64_x86_64</string>
|
||||||
|
<key>LibraryPath</key>
|
||||||
|
<string>SDL3.framework</string>
|
||||||
|
<key>SupportedArchitectures</key>
|
||||||
|
<array>
|
||||||
|
<string>arm64</string>
|
||||||
|
<string>x86_64</string>
|
||||||
|
</array>
|
||||||
|
<key>SupportedPlatform</key>
|
||||||
|
<string>macos</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>BinaryPath</key>
|
||||||
|
<string>SDL3.framework/SDL3</string>
|
||||||
|
<key>LibraryIdentifier</key>
|
||||||
|
<string>tvos-arm64</string>
|
||||||
|
<key>LibraryPath</key>
|
||||||
|
<string>SDL3.framework</string>
|
||||||
|
<key>SupportedArchitectures</key>
|
||||||
|
<array>
|
||||||
|
<string>arm64</string>
|
||||||
|
</array>
|
||||||
|
<key>SupportedPlatform</key>
|
||||||
|
<string>tvos</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>BinaryPath</key>
|
||||||
|
<string>SDL3.framework/SDL3</string>
|
||||||
|
<key>LibraryIdentifier</key>
|
||||||
|
<string>ios-arm64</string>
|
||||||
|
<key>LibraryPath</key>
|
||||||
|
<string>SDL3.framework</string>
|
||||||
|
<key>SupportedArchitectures</key>
|
||||||
|
<array>
|
||||||
|
<string>arm64</string>
|
||||||
|
</array>
|
||||||
|
<key>SupportedPlatform</key>
|
||||||
|
<string>ios</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>BinaryPath</key>
|
||||||
|
<string>SDL3.framework/SDL3</string>
|
||||||
|
<key>LibraryIdentifier</key>
|
||||||
|
<string>ios-arm64_x86_64-simulator</string>
|
||||||
|
<key>LibraryPath</key>
|
||||||
|
<string>SDL3.framework</string>
|
||||||
|
<key>SupportedArchitectures</key>
|
||||||
|
<array>
|
||||||
|
<string>arm64</string>
|
||||||
|
<string>x86_64</string>
|
||||||
|
</array>
|
||||||
|
<key>SupportedPlatform</key>
|
||||||
|
<string>ios</string>
|
||||||
|
<key>SupportedPlatformVariant</key>
|
||||||
|
<string>simulator</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>BinaryPath</key>
|
||||||
|
<string>SDL3.framework/SDL3</string>
|
||||||
|
<key>LibraryIdentifier</key>
|
||||||
|
<string>tvos-arm64_x86_64-simulator</string>
|
||||||
|
<key>LibraryPath</key>
|
||||||
|
<string>SDL3.framework</string>
|
||||||
|
<key>SupportedArchitectures</key>
|
||||||
|
<array>
|
||||||
|
<string>arm64</string>
|
||||||
|
<string>x86_64</string>
|
||||||
|
</array>
|
||||||
|
<key>SupportedPlatform</key>
|
||||||
|
<string>tvos</string>
|
||||||
|
<key>SupportedPlatformVariant</key>
|
||||||
|
<string>simulator</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>XFWK</string>
|
||||||
|
<key>XCFrameworkFormatVersion</key>
|
||||||
|
<string>1.0</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -0,0 +1,106 @@
|
|||||||
|
# SDL3 CMake configuration file:
|
||||||
|
# This file is meant to be placed in Resources/CMake of a SDL3 framework
|
||||||
|
|
||||||
|
# INTERFACE_LINK_OPTIONS needs CMake 3.12
|
||||||
|
cmake_minimum_required(VERSION 3.12)
|
||||||
|
|
||||||
|
include(FeatureSummary)
|
||||||
|
set_package_properties(SDL3 PROPERTIES
|
||||||
|
URL "https://www.libsdl.org/"
|
||||||
|
DESCRIPTION "low level access to audio, keyboard, mouse, joystick, and graphics hardware"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Copied from `configure_package_config_file`
|
||||||
|
macro(set_and_check _var _file)
|
||||||
|
set(${_var} "${_file}")
|
||||||
|
if(NOT EXISTS "${_file}")
|
||||||
|
message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
# Copied from `configure_package_config_file`
|
||||||
|
macro(check_required_components _NAME)
|
||||||
|
foreach(comp ${${_NAME}_FIND_COMPONENTS})
|
||||||
|
if(NOT ${_NAME}_${comp}_FOUND)
|
||||||
|
if(${_NAME}_FIND_REQUIRED_${comp})
|
||||||
|
set(${_NAME}_FOUND FALSE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
set(SDL3_FOUND TRUE)
|
||||||
|
|
||||||
|
# Compute the installation prefix relative to this file.
|
||||||
|
set(_sdl3_framework_path "${CMAKE_CURRENT_LIST_DIR}") # > /SDL3.framework/Resources/CMake/
|
||||||
|
get_filename_component(_sdl3_framework_path "${_sdl3_framework_path}" REALPATH) # > /SDL3.framework/Versions/Current/Resources/CMake
|
||||||
|
get_filename_component(_sdl3_framework_path "${_sdl3_framework_path}" REALPATH) # > /SDL3.framework/Versions/A/Resources/CMake/
|
||||||
|
get_filename_component(_sdl3_framework_path "${_sdl3_framework_path}" PATH) # > /SDL3.framework/Versions/A/Resources/
|
||||||
|
get_filename_component(_sdl3_framework_path "${_sdl3_framework_path}" PATH) # > /SDL3.framework/Versions/A/
|
||||||
|
get_filename_component(_sdl3_framework_path "${_sdl3_framework_path}" PATH) # > /SDL3.framework/Versions/
|
||||||
|
get_filename_component(_sdl3_framework_path "${_sdl3_framework_path}" PATH) # > /SDL3.framework/
|
||||||
|
get_filename_component(_sdl3_framework_parent_path "${_sdl3_framework_path}" PATH) # > /
|
||||||
|
|
||||||
|
|
||||||
|
# All targets are created, even when some might not be requested though COMPONENTS.
|
||||||
|
# This is done for compatibility with CMake generated SDL3-target.cmake files.
|
||||||
|
|
||||||
|
if(NOT TARGET SDL3::Headers)
|
||||||
|
add_library(SDL3::Headers INTERFACE IMPORTED)
|
||||||
|
set_target_properties(SDL3::Headers
|
||||||
|
PROPERTIES
|
||||||
|
INTERFACE_COMPILE_OPTIONS "SHELL:-F \"${_sdl3_framework_parent_path}\""
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
set(SDL3_Headers_FOUND TRUE)
|
||||||
|
|
||||||
|
if(NOT TARGET SDL3::SDL3-shared)
|
||||||
|
add_library(SDL3::SDL3-shared SHARED IMPORTED)
|
||||||
|
set_target_properties(SDL3::SDL3-shared
|
||||||
|
PROPERTIES
|
||||||
|
FRAMEWORK "TRUE"
|
||||||
|
IMPORTED_LOCATION "${_sdl3_framework_path}/SDL3"
|
||||||
|
INTERFACE_LINK_LIBRARIES "SDL3::Headers"
|
||||||
|
COMPATIBLE_INTERFACE_BOOL "SDL3_SHARED"
|
||||||
|
INTERFACE_SDL3_SHARED "ON"
|
||||||
|
COMPATIBLE_INTERFACE_STRING "SDL_VERSION"
|
||||||
|
INTERFACE_SDL_VERSION "SDL3"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
set(SDL3_SDL3-shared_FOUND TRUE)
|
||||||
|
|
||||||
|
set(SDL3_SDL3-static FALSE)
|
||||||
|
|
||||||
|
set(SDL3_SDL3_test FALSE)
|
||||||
|
|
||||||
|
unset(_sdl3_framework_parent_path)
|
||||||
|
unset(_sdl3_framework_path)
|
||||||
|
|
||||||
|
if(SDL3_SDL3-shared_FOUND)
|
||||||
|
set(SDL3_SDL3_FOUND TRUE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
function(_sdl_create_target_alias_compat NEW_TARGET TARGET)
|
||||||
|
if(CMAKE_VERSION VERSION_LESS "3.18")
|
||||||
|
# Aliasing local targets is not supported on CMake < 3.18, so make it global.
|
||||||
|
add_library(${NEW_TARGET} INTERFACE IMPORTED)
|
||||||
|
set_target_properties(${NEW_TARGET} PROPERTIES INTERFACE_LINK_LIBRARIES "${TARGET}")
|
||||||
|
else()
|
||||||
|
add_library(${NEW_TARGET} ALIAS ${TARGET})
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# Make sure SDL3::SDL3 always exists
|
||||||
|
if(NOT TARGET SDL3::SDL3)
|
||||||
|
if(TARGET SDL3::SDL3-shared)
|
||||||
|
_sdl_create_target_alias_compat(SDL3::SDL3 SDL3::SDL3-shared)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
check_required_components(SDL3)
|
||||||
|
|
||||||
|
set(SDL3_LIBRARIES SDL3::SDL3)
|
||||||
|
set(SDL3_STATIC_LIBRARIES SDL3::SDL3-static)
|
||||||
|
set(SDL3_STATIC_PRIVATE_LIBS)
|
||||||
|
|
||||||
|
set(SDL3TEST_LIBRARY SDL3::SDL3_test)
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
# based on the files generated by CMake's write_basic_package_version_file
|
# based on the files generated by CMake's write_basic_package_version_file
|
||||||
|
|
||||||
# SDL2 CMake version configuration file:
|
# SDL CMake version configuration file:
|
||||||
# This file is meant to be placed in Resources/CMake of a SDL2 framework
|
# This file is meant to be placed in Resources/CMake of a SDL3 framework
|
||||||
|
|
||||||
|
cmake_minimum_required(VERSION 3.12)
|
||||||
|
|
||||||
if(NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/../../Headers/SDL_version.h")
|
if(NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/../../Headers/SDL_version.h")
|
||||||
message(AUTHOR_WARNING "Could not find SDL_version.h. This script is meant to be placed in the Resources/CMake directory of SDL2.framework")
|
message(AUTHOR_WARNING "Could not find SDL_version.h. This script is meant to be placed in the Resources/CMake directory of SDL2.framework")
|
||||||
@@ -13,15 +15,22 @@ string(REGEX MATCH "#define[ \t]+SDL_MAJOR_VERSION[ \t]+([0-9]+)" _sdl_major_re
|
|||||||
set(_sdl_major "${CMAKE_MATCH_1}")
|
set(_sdl_major "${CMAKE_MATCH_1}")
|
||||||
string(REGEX MATCH "#define[ \t]+SDL_MINOR_VERSION[ \t]+([0-9]+)" _sdl_minor_re "${_sdl_version_h}")
|
string(REGEX MATCH "#define[ \t]+SDL_MINOR_VERSION[ \t]+([0-9]+)" _sdl_minor_re "${_sdl_version_h}")
|
||||||
set(_sdl_minor "${CMAKE_MATCH_1}")
|
set(_sdl_minor "${CMAKE_MATCH_1}")
|
||||||
string(REGEX MATCH "#define[ \t]+SDL_PATCHLEVEL[ \t]+([0-9]+)" _sdl_patch_re "${_sdl_version_h}")
|
string(REGEX MATCH "#define[ \t]+SDL_MICRO_VERSION[ \t]+([0-9]+)" _sdl_micro_re "${_sdl_version_h}")
|
||||||
set(_sdl_patch "${CMAKE_MATCH_1}")
|
set(_sdl_micro "${CMAKE_MATCH_1}")
|
||||||
if(_sdl_major_re AND _sdl_minor_re AND _sdl_patch_re)
|
if(_sdl_major_re AND _sdl_minor_re AND _sdl_micro_re)
|
||||||
set(PACKAGE_VERSION "${_sdl_major}.${_sdl_minor}.${_sdl_patch}")
|
set(PACKAGE_VERSION "${_sdl_major}.${_sdl_minor}.${_sdl_micro}")
|
||||||
else()
|
else()
|
||||||
message(AUTHOR_WARNING "Could not extract version from SDL_version.h.")
|
message(AUTHOR_WARNING "Could not extract version from SDL_version.h.")
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
unset(_sdl_major_re)
|
||||||
|
unset(_sdl_major)
|
||||||
|
unset(_sdl_minor_re)
|
||||||
|
unset(_sdl_minor)
|
||||||
|
unset(_sdl_micro_re)
|
||||||
|
unset(_sdl_micro)
|
||||||
|
|
||||||
if(PACKAGE_FIND_VERSION_RANGE)
|
if(PACKAGE_FIND_VERSION_RANGE)
|
||||||
# Package version must be in the requested version range
|
# Package version must be in the requested version range
|
||||||
if ((PACKAGE_FIND_VERSION_RANGE_MIN STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MIN)
|
if ((PACKAGE_FIND_VERSION_RANGE_MIN STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MIN)
|
||||||
@@ -42,7 +51,7 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# if the using project doesn't have CMAKE_SIZEOF_VOID_P set, fail.
|
# The SDL3.xcframework only contains 64-bit archives
|
||||||
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "")
|
if(NOT "${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
|
||||||
set(PACKAGE_VERSION_UNSUITABLE TRUE)
|
set(PACKAGE_VERSION_UNSUITABLE TRUE)
|
||||||
endif()
|
endif()
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
/*
|
||||||
|
Simple DirectMedia Layer
|
||||||
|
Copyright (C) 1997-2025 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Main include header for the SDL library, version 3.2.20
|
||||||
|
*
|
||||||
|
* It is almost always best to include just this one header instead of
|
||||||
|
* picking out individual headers included here. There are exceptions to
|
||||||
|
* this rule--SDL_main.h is special and not included here--but usually
|
||||||
|
* letting SDL.h include the kitchen sink for you is the correct approach.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SDL_h_
|
||||||
|
#define SDL_h_
|
||||||
|
|
||||||
|
#include <SDL3/SDL_stdinc.h>
|
||||||
|
#include <SDL3/SDL_assert.h>
|
||||||
|
#include <SDL3/SDL_asyncio.h>
|
||||||
|
#include <SDL3/SDL_atomic.h>
|
||||||
|
#include <SDL3/SDL_audio.h>
|
||||||
|
#include <SDL3/SDL_bits.h>
|
||||||
|
#include <SDL3/SDL_blendmode.h>
|
||||||
|
#include <SDL3/SDL_camera.h>
|
||||||
|
#include <SDL3/SDL_clipboard.h>
|
||||||
|
#include <SDL3/SDL_cpuinfo.h>
|
||||||
|
#include <SDL3/SDL_dialog.h>
|
||||||
|
#include <SDL3/SDL_endian.h>
|
||||||
|
#include <SDL3/SDL_error.h>
|
||||||
|
#include <SDL3/SDL_events.h>
|
||||||
|
#include <SDL3/SDL_filesystem.h>
|
||||||
|
#include <SDL3/SDL_gamepad.h>
|
||||||
|
#include <SDL3/SDL_gpu.h>
|
||||||
|
#include <SDL3/SDL_guid.h>
|
||||||
|
#include <SDL3/SDL_haptic.h>
|
||||||
|
#include <SDL3/SDL_hidapi.h>
|
||||||
|
#include <SDL3/SDL_hints.h>
|
||||||
|
#include <SDL3/SDL_init.h>
|
||||||
|
#include <SDL3/SDL_iostream.h>
|
||||||
|
#include <SDL3/SDL_joystick.h>
|
||||||
|
#include <SDL3/SDL_keyboard.h>
|
||||||
|
#include <SDL3/SDL_keycode.h>
|
||||||
|
#include <SDL3/SDL_loadso.h>
|
||||||
|
#include <SDL3/SDL_locale.h>
|
||||||
|
#include <SDL3/SDL_log.h>
|
||||||
|
#include <SDL3/SDL_messagebox.h>
|
||||||
|
#include <SDL3/SDL_metal.h>
|
||||||
|
#include <SDL3/SDL_misc.h>
|
||||||
|
#include <SDL3/SDL_mouse.h>
|
||||||
|
#include <SDL3/SDL_mutex.h>
|
||||||
|
#include <SDL3/SDL_pen.h>
|
||||||
|
#include <SDL3/SDL_pixels.h>
|
||||||
|
#include <SDL3/SDL_platform.h>
|
||||||
|
#include <SDL3/SDL_power.h>
|
||||||
|
#include <SDL3/SDL_process.h>
|
||||||
|
#include <SDL3/SDL_properties.h>
|
||||||
|
#include <SDL3/SDL_rect.h>
|
||||||
|
#include <SDL3/SDL_render.h>
|
||||||
|
#include <SDL3/SDL_scancode.h>
|
||||||
|
#include <SDL3/SDL_sensor.h>
|
||||||
|
#include <SDL3/SDL_storage.h>
|
||||||
|
#include <SDL3/SDL_surface.h>
|
||||||
|
#include <SDL3/SDL_system.h>
|
||||||
|
#include <SDL3/SDL_thread.h>
|
||||||
|
#include <SDL3/SDL_time.h>
|
||||||
|
#include <SDL3/SDL_timer.h>
|
||||||
|
#include <SDL3/SDL_tray.h>
|
||||||
|
#include <SDL3/SDL_touch.h>
|
||||||
|
#include <SDL3/SDL_version.h>
|
||||||
|
#include <SDL3/SDL_video.h>
|
||||||
|
#include <SDL3/SDL_oldnames.h>
|
||||||
|
|
||||||
|
#endif /* SDL_h_ */
|
||||||
@@ -0,0 +1,662 @@
|
|||||||
|
/*
|
||||||
|
Simple DirectMedia Layer
|
||||||
|
Copyright (C) 1997-2025 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* # CategoryAssert
|
||||||
|
*
|
||||||
|
* A helpful assertion macro!
|
||||||
|
*
|
||||||
|
* SDL assertions operate like your usual `assert` macro, but with some added
|
||||||
|
* features:
|
||||||
|
*
|
||||||
|
* - It uses a trick with the `sizeof` operator, so disabled assertions
|
||||||
|
* vaporize out of the compiled code, but variables only referenced in the
|
||||||
|
* assertion won't trigger compiler warnings about being unused.
|
||||||
|
* - It is safe to use with a dangling-else: `if (x) SDL_assert(y); else
|
||||||
|
* do_something();`
|
||||||
|
* - It works the same everywhere, instead of counting on various platforms'
|
||||||
|
* compiler and C runtime to behave.
|
||||||
|
* - It provides multiple levels of assertion (SDL_assert, SDL_assert_release,
|
||||||
|
* SDL_assert_paranoid) instead of a single all-or-nothing option.
|
||||||
|
* - It offers a variety of responses when an assertion fails (retry, trigger
|
||||||
|
* the debugger, abort the program, ignore the failure once, ignore it for
|
||||||
|
* the rest of the program's run).
|
||||||
|
* - It tries to show the user a dialog by default, if possible, but the app
|
||||||
|
* can provide a callback to handle assertion failures however they like.
|
||||||
|
* - It lets failed assertions be retried. Perhaps you had a network failure
|
||||||
|
* and just want to retry the test after plugging your network cable back
|
||||||
|
* in? You can.
|
||||||
|
* - It lets the user ignore an assertion failure, if there's a harmless
|
||||||
|
* problem that one can continue past.
|
||||||
|
* - It lets the user mark an assertion as ignored for the rest of the
|
||||||
|
* program's run; if there's a harmless problem that keeps popping up.
|
||||||
|
* - It provides statistics and data on all failed assertions to the app.
|
||||||
|
* - It allows the default assertion handler to be controlled with environment
|
||||||
|
* variables, in case an automated script needs to control it.
|
||||||
|
* - It can be used as an aid to Clang's static analysis; it will treat SDL
|
||||||
|
* assertions as universally true (under the assumption that you are serious
|
||||||
|
* about the asserted claims and that your debug builds will detect when
|
||||||
|
* these claims were wrong). This can help the analyzer avoid false
|
||||||
|
* positives.
|
||||||
|
*
|
||||||
|
* To use it: compile a debug build and just sprinkle around tests to check
|
||||||
|
* your code!
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SDL_assert_h_
|
||||||
|
#define SDL_assert_h_
|
||||||
|
|
||||||
|
#include <SDL3/SDL_stdinc.h>
|
||||||
|
|
||||||
|
#include <SDL3/SDL_begin_code.h>
|
||||||
|
/* Set up for C function definitions, even when using C++ */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The level of assertion aggressiveness.
|
||||||
|
*
|
||||||
|
* This value changes depending on compiler options and other preprocessor
|
||||||
|
* defines.
|
||||||
|
*
|
||||||
|
* It is currently one of the following values, but future SDL releases might
|
||||||
|
* add more:
|
||||||
|
*
|
||||||
|
* - 0: All SDL assertion macros are disabled.
|
||||||
|
* - 1: Release settings: SDL_assert disabled, SDL_assert_release enabled.
|
||||||
|
* - 2: Debug settings: SDL_assert and SDL_assert_release enabled.
|
||||||
|
* - 3: Paranoid settings: All SDL assertion macros enabled, including
|
||||||
|
* SDL_assert_paranoid.
|
||||||
|
*
|
||||||
|
* \since This macro is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
#define SDL_ASSERT_LEVEL SomeNumberBasedOnVariousFactors
|
||||||
|
|
||||||
|
#elif !defined(SDL_ASSERT_LEVEL)
|
||||||
|
#ifdef SDL_DEFAULT_ASSERT_LEVEL
|
||||||
|
#define SDL_ASSERT_LEVEL SDL_DEFAULT_ASSERT_LEVEL
|
||||||
|
#elif defined(_DEBUG) || defined(DEBUG) || \
|
||||||
|
(defined(__GNUC__) && !defined(__OPTIMIZE__))
|
||||||
|
#define SDL_ASSERT_LEVEL 2
|
||||||
|
#else
|
||||||
|
#define SDL_ASSERT_LEVEL 1
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attempt to tell an attached debugger to pause.
|
||||||
|
*
|
||||||
|
* This allows an app to programmatically halt ("break") the debugger as if it
|
||||||
|
* had hit a breakpoint, allowing the developer to examine program state, etc.
|
||||||
|
*
|
||||||
|
* This is a macro--not a function--so that the debugger breaks on the source
|
||||||
|
* code line that used SDL_TriggerBreakpoint and not in some random guts of
|
||||||
|
* SDL. SDL_assert uses this macro for the same reason.
|
||||||
|
*
|
||||||
|
* If the program is not running under a debugger, SDL_TriggerBreakpoint will
|
||||||
|
* likely terminate the app, possibly without warning. If the current platform
|
||||||
|
* isn't supported, this macro is left undefined.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this macro from any thread.
|
||||||
|
*
|
||||||
|
* \since This macro is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
#define SDL_TriggerBreakpoint() TriggerABreakpointInAPlatformSpecificManner
|
||||||
|
|
||||||
|
#elif defined(_MSC_VER) && _MSC_VER >= 1310
|
||||||
|
/* Don't include intrin.h here because it contains C++ code */
|
||||||
|
extern void __cdecl __debugbreak(void);
|
||||||
|
#define SDL_TriggerBreakpoint() __debugbreak()
|
||||||
|
#elif defined(_MSC_VER) && defined(_M_IX86)
|
||||||
|
#define SDL_TriggerBreakpoint() { _asm { int 0x03 } }
|
||||||
|
#elif defined(ANDROID)
|
||||||
|
#include <assert.h>
|
||||||
|
#define SDL_TriggerBreakpoint() assert(0)
|
||||||
|
#elif SDL_HAS_BUILTIN(__builtin_debugtrap)
|
||||||
|
#define SDL_TriggerBreakpoint() __builtin_debugtrap()
|
||||||
|
#elif SDL_HAS_BUILTIN(__builtin_trap)
|
||||||
|
#define SDL_TriggerBreakpoint() __builtin_trap()
|
||||||
|
#elif (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))
|
||||||
|
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
|
||||||
|
#elif (defined(__GNUC__) || defined(__clang__)) && defined(__riscv)
|
||||||
|
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "ebreak\n\t" )
|
||||||
|
#elif ( defined(SDL_PLATFORM_APPLE) && (defined(__arm64__) || defined(__aarch64__)) ) /* this might work on other ARM targets, but this is a known quantity... */
|
||||||
|
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #22\n\t" )
|
||||||
|
#elif defined(SDL_PLATFORM_APPLE) && defined(__arm__)
|
||||||
|
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "bkpt #22\n\t" )
|
||||||
|
#elif defined(_WIN32) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__arm64__) || defined(__aarch64__)) )
|
||||||
|
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #0xF000\n\t" )
|
||||||
|
#elif defined(__GNUC__) || defined(__clang__)
|
||||||
|
#define SDL_TriggerBreakpoint() __builtin_trap() /* older gcc may not support SDL_HAS_BUILTIN(__builtin_trap) above */
|
||||||
|
#elif defined(__386__) && defined(__WATCOMC__)
|
||||||
|
#define SDL_TriggerBreakpoint() { _asm { int 0x03 } }
|
||||||
|
#elif defined(HAVE_SIGNAL_H) && !defined(__WATCOMC__)
|
||||||
|
#include <signal.h>
|
||||||
|
#define SDL_TriggerBreakpoint() raise(SIGTRAP)
|
||||||
|
#else
|
||||||
|
/* SDL_TriggerBreakpoint is intentionally left undefined on unknown platforms. */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A macro that reports the current function being compiled.
|
||||||
|
*
|
||||||
|
* If SDL can't figure how the compiler reports this, it will use "???".
|
||||||
|
*
|
||||||
|
* \since This macro is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
#define SDL_FUNCTION __FUNCTION__
|
||||||
|
|
||||||
|
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */
|
||||||
|
# define SDL_FUNCTION __func__
|
||||||
|
#elif ((defined(__GNUC__) && (__GNUC__ >= 2)) || defined(_MSC_VER) || defined (__WATCOMC__))
|
||||||
|
# define SDL_FUNCTION __FUNCTION__
|
||||||
|
#else
|
||||||
|
# define SDL_FUNCTION "???"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A macro that reports the current file being compiled.
|
||||||
|
*
|
||||||
|
* \since This macro is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
#define SDL_FILE __FILE__
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A macro that reports the current line number of the file being compiled.
|
||||||
|
*
|
||||||
|
* \since This macro is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
#define SDL_LINE __LINE__
|
||||||
|
|
||||||
|
/*
|
||||||
|
sizeof (x) makes the compiler still parse the expression even without
|
||||||
|
assertions enabled, so the code is always checked at compile time, but
|
||||||
|
doesn't actually generate code for it, so there are no side effects or
|
||||||
|
expensive checks at run time, just the constant size of what x WOULD be,
|
||||||
|
which presumably gets optimized out as unused.
|
||||||
|
This also solves the problem of...
|
||||||
|
|
||||||
|
int somevalue = blah();
|
||||||
|
SDL_assert(somevalue == 1);
|
||||||
|
|
||||||
|
...which would cause compiles to complain that somevalue is unused if we
|
||||||
|
disable assertions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A macro for wrapping code in `do {} while (0);` without compiler warnings.
|
||||||
|
*
|
||||||
|
* Visual Studio with really aggressive warnings enabled needs this to avoid
|
||||||
|
* compiler complaints.
|
||||||
|
*
|
||||||
|
* the `do {} while (0);` trick is useful for wrapping code in a macro that
|
||||||
|
* may or may not be a single statement, to avoid various C language
|
||||||
|
* accidents.
|
||||||
|
*
|
||||||
|
* To use:
|
||||||
|
*
|
||||||
|
* ```c
|
||||||
|
* do { SomethingOnce(); } while (SDL_NULL_WHILE_LOOP_CONDITION (0));
|
||||||
|
* ```
|
||||||
|
*
|
||||||
|
* \since This macro is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
#define SDL_NULL_WHILE_LOOP_CONDITION (0)
|
||||||
|
|
||||||
|
#elif defined(_MSC_VER) /* 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)
|
||||||
|
#else
|
||||||
|
#define SDL_NULL_WHILE_LOOP_CONDITION (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The macro used when an assertion is disabled.
|
||||||
|
*
|
||||||
|
* This isn't for direct use by apps, but this is the code that is inserted
|
||||||
|
* when an SDL_assert is disabled (perhaps in a release build).
|
||||||
|
*
|
||||||
|
* The code does nothing, but wraps `condition` in a sizeof operator, which
|
||||||
|
* generates no code and has no side effects, but avoid compiler warnings
|
||||||
|
* about unused variables.
|
||||||
|
*
|
||||||
|
* \param condition the condition to assert (but not actually run here).
|
||||||
|
*
|
||||||
|
* \since This macro is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
#define SDL_disabled_assert(condition) \
|
||||||
|
do { (void) sizeof ((condition)); } while (SDL_NULL_WHILE_LOOP_CONDITION)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Possible outcomes from a triggered assertion.
|
||||||
|
*
|
||||||
|
* When an enabled assertion triggers, it may call the assertion handler
|
||||||
|
* (possibly one provided by the app via SDL_SetAssertionHandler), which will
|
||||||
|
* return one of these values, possibly after asking the user.
|
||||||
|
*
|
||||||
|
* Then SDL will respond based on this outcome (loop around to retry the
|
||||||
|
* condition, try to break in a debugger, kill the program, or ignore the
|
||||||
|
* problem).
|
||||||
|
*
|
||||||
|
* \since This enum is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
typedef enum SDL_AssertState
|
||||||
|
{
|
||||||
|
SDL_ASSERTION_RETRY, /**< Retry the assert immediately. */
|
||||||
|
SDL_ASSERTION_BREAK, /**< Make the debugger trigger a breakpoint. */
|
||||||
|
SDL_ASSERTION_ABORT, /**< Terminate the program. */
|
||||||
|
SDL_ASSERTION_IGNORE, /**< Ignore the assert. */
|
||||||
|
SDL_ASSERTION_ALWAYS_IGNORE /**< Ignore the assert from now on. */
|
||||||
|
} SDL_AssertState;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Information about an assertion failure.
|
||||||
|
*
|
||||||
|
* This structure is filled in with information about a triggered assertion,
|
||||||
|
* used by the assertion handler, then added to the assertion report. This is
|
||||||
|
* returned as a linked list from SDL_GetAssertionReport().
|
||||||
|
*
|
||||||
|
* \since This struct is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
typedef struct SDL_AssertData
|
||||||
|
{
|
||||||
|
bool always_ignore; /**< true if app should always continue when assertion is triggered. */
|
||||||
|
unsigned int trigger_count; /**< Number of times this assertion has been triggered. */
|
||||||
|
const char *condition; /**< A string of this assert's test code. */
|
||||||
|
const char *filename; /**< The source file where this assert lives. */
|
||||||
|
int linenum; /**< The line in `filename` where this assert lives. */
|
||||||
|
const char *function; /**< The name of the function where this assert lives. */
|
||||||
|
const struct SDL_AssertData *next; /**< next item in the linked list. */
|
||||||
|
} SDL_AssertData;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Never call this directly.
|
||||||
|
*
|
||||||
|
* Use the SDL_assert macros instead.
|
||||||
|
*
|
||||||
|
* \param data assert data structure.
|
||||||
|
* \param func function name.
|
||||||
|
* \param file file name.
|
||||||
|
* \param line line number.
|
||||||
|
* \returns assert state.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *data,
|
||||||
|
const char *func,
|
||||||
|
const char *file, int line) SDL_ANALYZER_NORETURN;
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The macro used when an assertion triggers a breakpoint.
|
||||||
|
*
|
||||||
|
* This isn't for direct use by apps; use SDL_assert or SDL_TriggerBreakpoint
|
||||||
|
* instead.
|
||||||
|
*
|
||||||
|
* \since This macro is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
#define SDL_AssertBreakpoint() SDL_TriggerBreakpoint()
|
||||||
|
|
||||||
|
#elif !defined(SDL_AssertBreakpoint)
|
||||||
|
# if defined(ANDROID) && defined(assert)
|
||||||
|
/* Define this as empty in case assert() is defined as SDL_assert */
|
||||||
|
# define SDL_AssertBreakpoint()
|
||||||
|
# else
|
||||||
|
# define SDL_AssertBreakpoint() SDL_TriggerBreakpoint()
|
||||||
|
# endif
|
||||||
|
#endif /* !SDL_AssertBreakpoint */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The macro used when an assertion is enabled.
|
||||||
|
*
|
||||||
|
* This isn't for direct use by apps, but this is the code that is inserted
|
||||||
|
* when an SDL_assert is enabled.
|
||||||
|
*
|
||||||
|
* The `do {} while(0)` avoids dangling else problems:
|
||||||
|
*
|
||||||
|
* ```c
|
||||||
|
* if (x) SDL_assert(y); else blah();
|
||||||
|
* ```
|
||||||
|
*
|
||||||
|
* ... without the do/while, the "else" could attach to this macro's "if". We
|
||||||
|
* try to handle just the minimum we need here in a macro...the loop, the
|
||||||
|
* static vars, and break points. The heavy lifting is handled in
|
||||||
|
* SDL_ReportAssertion().
|
||||||
|
*
|
||||||
|
* \param condition the condition to assert.
|
||||||
|
*
|
||||||
|
* \since This macro is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
#define SDL_enabled_assert(condition) \
|
||||||
|
do { \
|
||||||
|
while ( !(condition) ) { \
|
||||||
|
static struct SDL_AssertData sdl_assert_data = { false, 0, #condition, NULL, 0, NULL, NULL }; \
|
||||||
|
const SDL_AssertState sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \
|
||||||
|
if (sdl_assert_state == SDL_ASSERTION_RETRY) { \
|
||||||
|
continue; /* go again. */ \
|
||||||
|
} else if (sdl_assert_state == SDL_ASSERTION_BREAK) { \
|
||||||
|
SDL_AssertBreakpoint(); \
|
||||||
|
} \
|
||||||
|
break; /* not retrying. */ \
|
||||||
|
} \
|
||||||
|
} while (SDL_NULL_WHILE_LOOP_CONDITION)
|
||||||
|
|
||||||
|
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An assertion test that is normally performed only in debug builds.
|
||||||
|
*
|
||||||
|
* This macro is enabled when the SDL_ASSERT_LEVEL is >= 2, otherwise it is
|
||||||
|
* disabled. This is meant to only do these tests in debug builds, so they can
|
||||||
|
* tend to be more expensive, and they are meant to bring everything to a halt
|
||||||
|
* when they fail, with the programmer there to assess the problem.
|
||||||
|
*
|
||||||
|
* In short: you can sprinkle these around liberally and assume they will
|
||||||
|
* evaporate out of the build when building for end-users.
|
||||||
|
*
|
||||||
|
* When assertions are disabled, this wraps `condition` in a `sizeof`
|
||||||
|
* operator, which means any function calls and side effects will not run, but
|
||||||
|
* the compiler will not complain about any otherwise-unused variables that
|
||||||
|
* are only referenced in the assertion.
|
||||||
|
*
|
||||||
|
* One can set the environment variable "SDL_ASSERT" to one of several strings
|
||||||
|
* ("abort", "break", "retry", "ignore", "always_ignore") to force a default
|
||||||
|
* behavior, which may be desirable for automation purposes. If your platform
|
||||||
|
* requires GUI interfaces to happen on the main thread but you're debugging
|
||||||
|
* an assertion in a background thread, it might be desirable to set this to
|
||||||
|
* "break" so that your debugger takes control as soon as assert is triggered,
|
||||||
|
* instead of risking a bad UI interaction (deadlock, etc) in the application.
|
||||||
|
*
|
||||||
|
* \param condition boolean value to test.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this macro from any thread.
|
||||||
|
*
|
||||||
|
* \since This macro is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
#define SDL_assert(condition) if (assertion_enabled && (condition)) { trigger_assertion; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An assertion test that is performed even in release builds.
|
||||||
|
*
|
||||||
|
* This macro is enabled when the SDL_ASSERT_LEVEL is >= 1, otherwise it is
|
||||||
|
* disabled. This is meant to be for tests that are cheap to make and
|
||||||
|
* extremely unlikely to fail; generally it is frowned upon to have an
|
||||||
|
* assertion failure in a release build, so these assertions generally need to
|
||||||
|
* be of more than life-and-death importance if there's a chance they might
|
||||||
|
* trigger. You should almost always consider handling these cases more
|
||||||
|
* gracefully than an assert allows.
|
||||||
|
*
|
||||||
|
* When assertions are disabled, this wraps `condition` in a `sizeof`
|
||||||
|
* operator, which means any function calls and side effects will not run, but
|
||||||
|
* the compiler will not complain about any otherwise-unused variables that
|
||||||
|
* are only referenced in the assertion.
|
||||||
|
*
|
||||||
|
* One can set the environment variable "SDL_ASSERT" to one of several strings
|
||||||
|
* ("abort", "break", "retry", "ignore", "always_ignore") to force a default
|
||||||
|
* behavior, which may be desirable for automation purposes. If your platform
|
||||||
|
* requires GUI interfaces to happen on the main thread but you're debugging
|
||||||
|
* an assertion in a background thread, it might be desirable to set this to
|
||||||
|
* "break" so that your debugger takes control as soon as assert is triggered,
|
||||||
|
* instead of risking a bad UI interaction (deadlock, etc) in the application.
|
||||||
|
* *
|
||||||
|
*
|
||||||
|
* \param condition boolean value to test.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this macro from any thread.
|
||||||
|
*
|
||||||
|
* \since This macro is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
#define SDL_assert_release(condition) SDL_disabled_assert(condition)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An assertion test that is performed only when built with paranoid settings.
|
||||||
|
*
|
||||||
|
* This macro is enabled when the SDL_ASSERT_LEVEL is >= 3, otherwise it is
|
||||||
|
* disabled. This is a higher level than both release and debug, so these
|
||||||
|
* tests are meant to be expensive and only run when specifically looking for
|
||||||
|
* extremely unexpected failure cases in a special build.
|
||||||
|
*
|
||||||
|
* When assertions are disabled, this wraps `condition` in a `sizeof`
|
||||||
|
* operator, which means any function calls and side effects will not run, but
|
||||||
|
* the compiler will not complain about any otherwise-unused variables that
|
||||||
|
* are only referenced in the assertion.
|
||||||
|
*
|
||||||
|
* One can set the environment variable "SDL_ASSERT" to one of several strings
|
||||||
|
* ("abort", "break", "retry", "ignore", "always_ignore") to force a default
|
||||||
|
* behavior, which may be desirable for automation purposes. If your platform
|
||||||
|
* requires GUI interfaces to happen on the main thread but you're debugging
|
||||||
|
* an assertion in a background thread, it might be desirable to set this to
|
||||||
|
* "break" so that your debugger takes control as soon as assert is triggered,
|
||||||
|
* instead of risking a bad UI interaction (deadlock, etc) in the application.
|
||||||
|
*
|
||||||
|
* \param condition boolean value to test.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this macro from any thread.
|
||||||
|
*
|
||||||
|
* \since This macro is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
#define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
|
||||||
|
|
||||||
|
/* Enable various levels of assertions. */
|
||||||
|
#elif SDL_ASSERT_LEVEL == 0 /* assertions disabled */
|
||||||
|
# define SDL_assert(condition) SDL_disabled_assert(condition)
|
||||||
|
# define SDL_assert_release(condition) SDL_disabled_assert(condition)
|
||||||
|
# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
|
||||||
|
#elif SDL_ASSERT_LEVEL == 1 /* release settings. */
|
||||||
|
# define SDL_assert(condition) SDL_disabled_assert(condition)
|
||||||
|
# define SDL_assert_release(condition) SDL_enabled_assert(condition)
|
||||||
|
# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
|
||||||
|
#elif SDL_ASSERT_LEVEL == 2 /* debug settings. */
|
||||||
|
# define SDL_assert(condition) SDL_enabled_assert(condition)
|
||||||
|
# define SDL_assert_release(condition) SDL_enabled_assert(condition)
|
||||||
|
# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
|
||||||
|
#elif SDL_ASSERT_LEVEL == 3 /* paranoid settings. */
|
||||||
|
# define SDL_assert(condition) SDL_enabled_assert(condition)
|
||||||
|
# define SDL_assert_release(condition) SDL_enabled_assert(condition)
|
||||||
|
# define SDL_assert_paranoid(condition) SDL_enabled_assert(condition)
|
||||||
|
#else
|
||||||
|
# error Unknown assertion level.
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An assertion test that is always performed.
|
||||||
|
*
|
||||||
|
* This macro is always enabled no matter what SDL_ASSERT_LEVEL is set to. You
|
||||||
|
* almost never want to use this, as it could trigger on an end-user's system,
|
||||||
|
* crashing your program.
|
||||||
|
*
|
||||||
|
* One can set the environment variable "SDL_ASSERT" to one of several strings
|
||||||
|
* ("abort", "break", "retry", "ignore", "always_ignore") to force a default
|
||||||
|
* behavior, which may be desirable for automation purposes. If your platform
|
||||||
|
* requires GUI interfaces to happen on the main thread but you're debugging
|
||||||
|
* an assertion in a background thread, it might be desirable to set this to
|
||||||
|
* "break" so that your debugger takes control as soon as assert is triggered,
|
||||||
|
* instead of risking a bad UI interaction (deadlock, etc) in the application.
|
||||||
|
*
|
||||||
|
* \param condition boolean value to test.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this macro from any thread.
|
||||||
|
*
|
||||||
|
* \since This macro is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
#define SDL_assert_always(condition) SDL_enabled_assert(condition)
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A callback that fires when an SDL assertion fails.
|
||||||
|
*
|
||||||
|
* \param data a pointer to the SDL_AssertData structure corresponding to the
|
||||||
|
* current assertion.
|
||||||
|
* \param userdata what was passed as `userdata` to SDL_SetAssertionHandler().
|
||||||
|
* \returns an SDL_AssertState value indicating how to handle the failure.
|
||||||
|
*
|
||||||
|
* \threadsafety This callback may be called from any thread that triggers an
|
||||||
|
* assert at any time.
|
||||||
|
*
|
||||||
|
* \since This datatype is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)(
|
||||||
|
const SDL_AssertData *data, void *userdata);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set an application-defined assertion handler.
|
||||||
|
*
|
||||||
|
* This function allows an application to show its own assertion UI and/or
|
||||||
|
* force the response to an assertion failure. If the application doesn't
|
||||||
|
* provide this, SDL will try to do the right thing, popping up a
|
||||||
|
* system-specific GUI dialog, and probably minimizing any fullscreen windows.
|
||||||
|
*
|
||||||
|
* This callback may fire from any thread, but it runs wrapped in a mutex, so
|
||||||
|
* it will only fire from one thread at a time.
|
||||||
|
*
|
||||||
|
* This callback is NOT reset to SDL's internal handler upon SDL_Quit()!
|
||||||
|
*
|
||||||
|
* \param handler the SDL_AssertionHandler function to call when an assertion
|
||||||
|
* fails or NULL for the default handler.
|
||||||
|
* \param userdata a pointer that is passed to `handler`.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_GetAssertionHandler
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC void SDLCALL SDL_SetAssertionHandler(
|
||||||
|
SDL_AssertionHandler handler,
|
||||||
|
void *userdata);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the default assertion handler.
|
||||||
|
*
|
||||||
|
* This returns the function pointer that is called by default when an
|
||||||
|
* assertion is triggered. This is an internal function provided by SDL, that
|
||||||
|
* is used for assertions when SDL_SetAssertionHandler() hasn't been used to
|
||||||
|
* provide a different function.
|
||||||
|
*
|
||||||
|
* \returns the default SDL_AssertionHandler that is called when an assert
|
||||||
|
* triggers.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_GetAssertionHandler
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the current assertion handler.
|
||||||
|
*
|
||||||
|
* This returns the function pointer that is called when an assertion is
|
||||||
|
* triggered. This is either the value last passed to
|
||||||
|
* SDL_SetAssertionHandler(), or if no application-specified function is set,
|
||||||
|
* is equivalent to calling SDL_GetDefaultAssertionHandler().
|
||||||
|
*
|
||||||
|
* The parameter `puserdata` is a pointer to a void*, which will store the
|
||||||
|
* "userdata" pointer that was passed to SDL_SetAssertionHandler(). This value
|
||||||
|
* will always be NULL for the default handler. If you don't care about this
|
||||||
|
* data, it is safe to pass a NULL pointer to this function to ignore it.
|
||||||
|
*
|
||||||
|
* \param puserdata pointer which is filled with the "userdata" pointer that
|
||||||
|
* was passed to SDL_SetAssertionHandler().
|
||||||
|
* \returns the SDL_AssertionHandler that is called when an assert triggers.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_SetAssertionHandler
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetAssertionHandler(void **puserdata);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a list of all assertion failures.
|
||||||
|
*
|
||||||
|
* This function gets all assertions triggered since the last call to
|
||||||
|
* SDL_ResetAssertionReport(), or the start of the program.
|
||||||
|
*
|
||||||
|
* The proper way to examine this data looks something like this:
|
||||||
|
*
|
||||||
|
* ```c
|
||||||
|
* const SDL_AssertData *item = SDL_GetAssertionReport();
|
||||||
|
* while (item) {
|
||||||
|
* printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\\n",
|
||||||
|
* item->condition, item->function, item->filename,
|
||||||
|
* item->linenum, item->trigger_count,
|
||||||
|
* item->always_ignore ? "yes" : "no");
|
||||||
|
* item = item->next;
|
||||||
|
* }
|
||||||
|
* ```
|
||||||
|
*
|
||||||
|
* \returns a list of all failed assertions or NULL if the list is empty. This
|
||||||
|
* memory should not be modified or freed by the application. This
|
||||||
|
* pointer remains valid until the next call to SDL_Quit() or
|
||||||
|
* SDL_ResetAssertionReport().
|
||||||
|
*
|
||||||
|
* \threadsafety This function is not thread safe. Other threads calling
|
||||||
|
* SDL_ResetAssertionReport() simultaneously, may render the
|
||||||
|
* returned pointer invalid.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_ResetAssertionReport
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC const SDL_AssertData * SDLCALL SDL_GetAssertionReport(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clear the list of all assertion failures.
|
||||||
|
*
|
||||||
|
* This function will clear the list of all assertions triggered up to that
|
||||||
|
* point. Immediately following this call, SDL_GetAssertionReport will return
|
||||||
|
* no items. In addition, any previously-triggered assertions will be reset to
|
||||||
|
* a trigger_count of zero, and their always_ignore state will be false.
|
||||||
|
*
|
||||||
|
* \threadsafety This function is not thread safe. Other threads triggering an
|
||||||
|
* assertion, or simultaneously calling this function may cause
|
||||||
|
* memory leaks or crashes.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_GetAssertionReport
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC void SDLCALL SDL_ResetAssertionReport(void);
|
||||||
|
|
||||||
|
/* Ends C function definitions when using C++ */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#include <SDL3/SDL_close_code.h>
|
||||||
|
|
||||||
|
#endif /* SDL_assert_h_ */
|
||||||
@@ -0,0 +1,546 @@
|
|||||||
|
/*
|
||||||
|
Simple DirectMedia Layer
|
||||||
|
Copyright (C) 1997-2025 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* WIKI CATEGORY: AsyncIO */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* # CategoryAsyncIO
|
||||||
|
*
|
||||||
|
* SDL offers a way to perform I/O asynchronously. This allows an app to read
|
||||||
|
* or write files without waiting for data to actually transfer; the functions
|
||||||
|
* that request I/O never block while the request is fulfilled.
|
||||||
|
*
|
||||||
|
* Instead, the data moves in the background and the app can check for results
|
||||||
|
* at their leisure.
|
||||||
|
*
|
||||||
|
* This is more complicated than just reading and writing files in a
|
||||||
|
* synchronous way, but it can allow for more efficiency, and never having
|
||||||
|
* framerate drops as the hard drive catches up, etc.
|
||||||
|
*
|
||||||
|
* The general usage pattern for async I/O is:
|
||||||
|
*
|
||||||
|
* - Create one or more SDL_AsyncIOQueue objects.
|
||||||
|
* - Open files with SDL_AsyncIOFromFile.
|
||||||
|
* - Start I/O tasks to the files with SDL_ReadAsyncIO or SDL_WriteAsyncIO,
|
||||||
|
* putting those tasks into one of the queues.
|
||||||
|
* - Later on, use SDL_GetAsyncIOResult on a queue to see if any task is
|
||||||
|
* finished without blocking. Tasks might finish in any order with success
|
||||||
|
* or failure.
|
||||||
|
* - When all your tasks are done, close the file with SDL_CloseAsyncIO. This
|
||||||
|
* also generates a task, since it might flush data to disk!
|
||||||
|
*
|
||||||
|
* This all works, without blocking, in a single thread, but one can also wait
|
||||||
|
* on a queue in a background thread, sleeping until new results have arrived:
|
||||||
|
*
|
||||||
|
* - Call SDL_WaitAsyncIOResult from one or more threads to efficiently block
|
||||||
|
* until new tasks complete.
|
||||||
|
* - When shutting down, call SDL_SignalAsyncIOQueue to unblock any sleeping
|
||||||
|
* threads despite there being no new tasks completed.
|
||||||
|
*
|
||||||
|
* And, of course, to match the synchronous SDL_LoadFile, we offer
|
||||||
|
* SDL_LoadFileAsync as a convenience function. This will handle allocating a
|
||||||
|
* buffer, slurping in the file data, and null-terminating it; you still check
|
||||||
|
* for results later.
|
||||||
|
*
|
||||||
|
* Behind the scenes, SDL will use newer, efficient APIs on platforms that
|
||||||
|
* support them: Linux's io_uring and Windows 11's IoRing, for example. If
|
||||||
|
* those technologies aren't available, SDL will offload the work to a thread
|
||||||
|
* pool that will manage otherwise-synchronous loads without blocking the app.
|
||||||
|
*
|
||||||
|
* ## Best Practices
|
||||||
|
*
|
||||||
|
* Simple non-blocking I/O--for an app that just wants to pick up data
|
||||||
|
* whenever it's ready without losing framerate waiting on disks to spin--can
|
||||||
|
* use whatever pattern works well for the program. In this case, simply call
|
||||||
|
* SDL_ReadAsyncIO, or maybe SDL_LoadFileAsync, as needed. Once a frame, call
|
||||||
|
* SDL_GetAsyncIOResult to check for any completed tasks and deal with the
|
||||||
|
* data as it arrives.
|
||||||
|
*
|
||||||
|
* If two separate pieces of the same program need their own I/O, it is legal
|
||||||
|
* for each to create their own queue. This will prevent either piece from
|
||||||
|
* accidentally consuming the other's completed tasks. Each queue does require
|
||||||
|
* some amount of resources, but it is not an overwhelming cost. Do not make a
|
||||||
|
* queue for each task, however. It is better to put many tasks into a single
|
||||||
|
* queue. They will be reported in order of completion, not in the order they
|
||||||
|
* were submitted, so it doesn't generally matter what order tasks are
|
||||||
|
* started.
|
||||||
|
*
|
||||||
|
* One async I/O queue can be shared by multiple threads, or one thread can
|
||||||
|
* have more than one queue, but the most efficient way--if ruthless
|
||||||
|
* efficiency is the goal--is to have one queue per thread, with multiple
|
||||||
|
* threads working in parallel, and attempt to keep each queue loaded with
|
||||||
|
* tasks that are both started by and consumed by the same thread. On modern
|
||||||
|
* platforms that can use newer interfaces, this can keep data flowing as
|
||||||
|
* efficiently as possible all the way from storage hardware to the app, with
|
||||||
|
* no contention between threads for access to the same queue.
|
||||||
|
*
|
||||||
|
* Written data is not guaranteed to make it to physical media by the time a
|
||||||
|
* closing task is completed, unless SDL_CloseAsyncIO is called with its
|
||||||
|
* `flush` parameter set to true, which is to say that a successful result
|
||||||
|
* here can still result in lost data during an unfortunately-timed power
|
||||||
|
* outage if not flushed. However, flushing will take longer and may be
|
||||||
|
* unnecessary, depending on the app's needs.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SDL_asyncio_h_
|
||||||
|
#define SDL_asyncio_h_
|
||||||
|
|
||||||
|
#include <SDL3/SDL_stdinc.h>
|
||||||
|
|
||||||
|
#include <SDL3/SDL_begin_code.h>
|
||||||
|
/* Set up for C function definitions, even when using C++ */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The asynchronous I/O operation structure.
|
||||||
|
*
|
||||||
|
* This operates as an opaque handle. One can then request read or write
|
||||||
|
* operations on it.
|
||||||
|
*
|
||||||
|
* \since This struct is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_AsyncIOFromFile
|
||||||
|
*/
|
||||||
|
typedef struct SDL_AsyncIO SDL_AsyncIO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Types of asynchronous I/O tasks.
|
||||||
|
*
|
||||||
|
* \since This enum is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
typedef enum SDL_AsyncIOTaskType
|
||||||
|
{
|
||||||
|
SDL_ASYNCIO_TASK_READ, /**< A read operation. */
|
||||||
|
SDL_ASYNCIO_TASK_WRITE, /**< A write operation. */
|
||||||
|
SDL_ASYNCIO_TASK_CLOSE /**< A close operation. */
|
||||||
|
} SDL_AsyncIOTaskType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Possible outcomes of an asynchronous I/O task.
|
||||||
|
*
|
||||||
|
* \since This enum is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
typedef enum SDL_AsyncIOResult
|
||||||
|
{
|
||||||
|
SDL_ASYNCIO_COMPLETE, /**< request was completed without error */
|
||||||
|
SDL_ASYNCIO_FAILURE, /**< request failed for some reason; check SDL_GetError()! */
|
||||||
|
SDL_ASYNCIO_CANCELED /**< request was canceled before completing. */
|
||||||
|
} SDL_AsyncIOResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Information about a completed asynchronous I/O request.
|
||||||
|
*
|
||||||
|
* \since This struct is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
typedef struct SDL_AsyncIOOutcome
|
||||||
|
{
|
||||||
|
SDL_AsyncIO *asyncio; /**< what generated this task. This pointer will be invalid if it was closed! */
|
||||||
|
SDL_AsyncIOTaskType type; /**< What sort of task was this? Read, write, etc? */
|
||||||
|
SDL_AsyncIOResult result; /**< the result of the work (success, failure, cancellation). */
|
||||||
|
void *buffer; /**< buffer where data was read/written. */
|
||||||
|
Uint64 offset; /**< offset in the SDL_AsyncIO where data was read/written. */
|
||||||
|
Uint64 bytes_requested; /**< number of bytes the task was to read/write. */
|
||||||
|
Uint64 bytes_transferred; /**< actual number of bytes that were read/written. */
|
||||||
|
void *userdata; /**< pointer provided by the app when starting the task */
|
||||||
|
} SDL_AsyncIOOutcome;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A queue of completed asynchronous I/O tasks.
|
||||||
|
*
|
||||||
|
* When starting an asynchronous operation, you specify a queue for the new
|
||||||
|
* task. A queue can be asked later if any tasks in it have completed,
|
||||||
|
* allowing an app to manage multiple pending tasks in one place, in whatever
|
||||||
|
* order they complete.
|
||||||
|
*
|
||||||
|
* \since This struct is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_CreateAsyncIOQueue
|
||||||
|
* \sa SDL_ReadAsyncIO
|
||||||
|
* \sa SDL_WriteAsyncIO
|
||||||
|
* \sa SDL_GetAsyncIOResult
|
||||||
|
* \sa SDL_WaitAsyncIOResult
|
||||||
|
*/
|
||||||
|
typedef struct SDL_AsyncIOQueue SDL_AsyncIOQueue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use this function to create a new SDL_AsyncIO object for reading from
|
||||||
|
* and/or writing to a named file.
|
||||||
|
*
|
||||||
|
* The `mode` string understands the following values:
|
||||||
|
*
|
||||||
|
* - "r": Open a file for reading only. It must exist.
|
||||||
|
* - "w": Open a file for writing only. It will create missing files or
|
||||||
|
* truncate existing ones.
|
||||||
|
* - "r+": Open a file for update both reading and writing. The file must
|
||||||
|
* exist.
|
||||||
|
* - "w+": Create an empty file for both reading and writing. If a file with
|
||||||
|
* the same name already exists its content is erased and the file is
|
||||||
|
* treated as a new empty file.
|
||||||
|
*
|
||||||
|
* There is no "b" mode, as there is only "binary" style I/O, and no "a" mode
|
||||||
|
* for appending, since you specify the position when starting a task.
|
||||||
|
*
|
||||||
|
* This function supports Unicode filenames, but they must be encoded in UTF-8
|
||||||
|
* format, regardless of the underlying operating system.
|
||||||
|
*
|
||||||
|
* This call is _not_ asynchronous; it will open the file before returning,
|
||||||
|
* under the assumption that doing so is generally a fast operation. Future
|
||||||
|
* reads and writes to the opened file will be async, however.
|
||||||
|
*
|
||||||
|
* \param file a UTF-8 string representing the filename to open.
|
||||||
|
* \param mode an ASCII string representing the mode to be used for opening
|
||||||
|
* the file.
|
||||||
|
* \returns a pointer to the SDL_AsyncIO structure that is created or NULL on
|
||||||
|
* failure; call SDL_GetError() for more information.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_CloseAsyncIO
|
||||||
|
* \sa SDL_ReadAsyncIO
|
||||||
|
* \sa SDL_WriteAsyncIO
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC SDL_AsyncIO * SDLCALL SDL_AsyncIOFromFile(const char *file, const char *mode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use this function to get the size of the data stream in an SDL_AsyncIO.
|
||||||
|
*
|
||||||
|
* This call is _not_ asynchronous; it assumes that obtaining this info is a
|
||||||
|
* non-blocking operation in most reasonable cases.
|
||||||
|
*
|
||||||
|
* \param asyncio the SDL_AsyncIO to get the size of the data stream from.
|
||||||
|
* \returns the size of the data stream in the SDL_IOStream on success or a
|
||||||
|
* negative error code 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.2.0.
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC Sint64 SDLCALL SDL_GetAsyncIOSize(SDL_AsyncIO *asyncio);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Start an async read.
|
||||||
|
*
|
||||||
|
* This function reads up to `size` bytes from `offset` position in the data
|
||||||
|
* source to the area pointed at by `ptr`. This function may read less bytes
|
||||||
|
* than requested.
|
||||||
|
*
|
||||||
|
* This function returns as quickly as possible; it does not wait for the read
|
||||||
|
* to complete. On a successful return, this work will continue in the
|
||||||
|
* background. If the work begins, even failure is asynchronous: a failing
|
||||||
|
* return value from this function only means the work couldn't start at all.
|
||||||
|
*
|
||||||
|
* `ptr` must remain available until the work is done, and may be accessed by
|
||||||
|
* the system at any time until then. Do not allocate it on the stack, as this
|
||||||
|
* might take longer than the life of the calling function to complete!
|
||||||
|
*
|
||||||
|
* An SDL_AsyncIOQueue must be specified. The newly-created task will be added
|
||||||
|
* to it when it completes its work.
|
||||||
|
*
|
||||||
|
* \param asyncio a pointer to an SDL_AsyncIO structure.
|
||||||
|
* \param ptr a pointer to a buffer to read data into.
|
||||||
|
* \param offset the position to start reading in the data source.
|
||||||
|
* \param size the number of bytes to read from the data source.
|
||||||
|
* \param queue a queue to add the new SDL_AsyncIO to.
|
||||||
|
* \param userdata an app-defined pointer that will be provided with the task
|
||||||
|
* results.
|
||||||
|
* \returns true on success or false 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.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_WriteAsyncIO
|
||||||
|
* \sa SDL_CreateAsyncIOQueue
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC bool SDLCALL SDL_ReadAsyncIO(SDL_AsyncIO *asyncio, void *ptr, Uint64 offset, Uint64 size, SDL_AsyncIOQueue *queue, void *userdata);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Start an async write.
|
||||||
|
*
|
||||||
|
* This function writes `size` bytes from `offset` position in the data source
|
||||||
|
* to the area pointed at by `ptr`.
|
||||||
|
*
|
||||||
|
* This function returns as quickly as possible; it does not wait for the
|
||||||
|
* write to complete. On a successful return, this work will continue in the
|
||||||
|
* background. If the work begins, even failure is asynchronous: a failing
|
||||||
|
* return value from this function only means the work couldn't start at all.
|
||||||
|
*
|
||||||
|
* `ptr` must remain available until the work is done, and may be accessed by
|
||||||
|
* the system at any time until then. Do not allocate it on the stack, as this
|
||||||
|
* might take longer than the life of the calling function to complete!
|
||||||
|
*
|
||||||
|
* An SDL_AsyncIOQueue must be specified. The newly-created task will be added
|
||||||
|
* to it when it completes its work.
|
||||||
|
*
|
||||||
|
* \param asyncio a pointer to an SDL_AsyncIO structure.
|
||||||
|
* \param ptr a pointer to a buffer to write data from.
|
||||||
|
* \param offset the position to start writing to the data source.
|
||||||
|
* \param size the number of bytes to write to the data source.
|
||||||
|
* \param queue a queue to add the new SDL_AsyncIO to.
|
||||||
|
* \param userdata an app-defined pointer that will be provided with the task
|
||||||
|
* results.
|
||||||
|
* \returns true on success or false 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.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_ReadAsyncIO
|
||||||
|
* \sa SDL_CreateAsyncIOQueue
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC bool SDLCALL SDL_WriteAsyncIO(SDL_AsyncIO *asyncio, void *ptr, Uint64 offset, Uint64 size, SDL_AsyncIOQueue *queue, void *userdata);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close and free any allocated resources for an async I/O object.
|
||||||
|
*
|
||||||
|
* Closing a file is _also_ an asynchronous task! If a write failure were to
|
||||||
|
* happen during the closing process, for example, the task results will
|
||||||
|
* report it as usual.
|
||||||
|
*
|
||||||
|
* Closing a file that has been written to does not guarantee the data has
|
||||||
|
* made it to physical media; it may remain in the operating system's file
|
||||||
|
* cache, for later writing to disk. This means that a successfully-closed
|
||||||
|
* file can be lost if the system crashes or loses power in this small window.
|
||||||
|
* To prevent this, call this function with the `flush` parameter set to true.
|
||||||
|
* This will make the operation take longer, and perhaps increase system load
|
||||||
|
* in general, but a successful result guarantees that the data has made it to
|
||||||
|
* physical storage. Don't use this for temporary files, caches, and
|
||||||
|
* unimportant data, and definitely use it for crucial irreplaceable files,
|
||||||
|
* like game saves.
|
||||||
|
*
|
||||||
|
* This function guarantees that the close will happen after any other pending
|
||||||
|
* tasks to `asyncio`, so it's safe to open a file, start several operations,
|
||||||
|
* close the file immediately, then check for all results later. This function
|
||||||
|
* will not block until the tasks have completed.
|
||||||
|
*
|
||||||
|
* Once this function returns true, `asyncio` is no longer valid, regardless
|
||||||
|
* of any future outcomes. Any completed tasks might still contain this
|
||||||
|
* pointer in their SDL_AsyncIOOutcome data, in case the app was using this
|
||||||
|
* value to track information, but it should not be used again.
|
||||||
|
*
|
||||||
|
* If this function returns false, the close wasn't started at all, and it's
|
||||||
|
* safe to attempt to close again later.
|
||||||
|
*
|
||||||
|
* An SDL_AsyncIOQueue must be specified. The newly-created task will be added
|
||||||
|
* to it when it completes its work.
|
||||||
|
*
|
||||||
|
* \param asyncio a pointer to an SDL_AsyncIO structure to close.
|
||||||
|
* \param flush true if data should sync to disk before the task completes.
|
||||||
|
* \param queue a queue to add the new SDL_AsyncIO to.
|
||||||
|
* \param userdata an app-defined pointer that will be provided with the task
|
||||||
|
* results.
|
||||||
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
|
* information.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread, but two
|
||||||
|
* threads should not attempt to close the same object.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC bool SDLCALL SDL_CloseAsyncIO(SDL_AsyncIO *asyncio, bool flush, SDL_AsyncIOQueue *queue, void *userdata);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a task queue for tracking multiple I/O operations.
|
||||||
|
*
|
||||||
|
* Async I/O operations are assigned to a queue when started. The queue can be
|
||||||
|
* checked for completed tasks thereafter.
|
||||||
|
*
|
||||||
|
* \returns a new task queue object or NULL if there was an error; 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.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_DestroyAsyncIOQueue
|
||||||
|
* \sa SDL_GetAsyncIOResult
|
||||||
|
* \sa SDL_WaitAsyncIOResult
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC SDL_AsyncIOQueue * SDLCALL SDL_CreateAsyncIOQueue(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Destroy a previously-created async I/O task queue.
|
||||||
|
*
|
||||||
|
* If there are still tasks pending for this queue, this call will block until
|
||||||
|
* those tasks are finished. All those tasks will be deallocated. Their
|
||||||
|
* results will be lost to the app.
|
||||||
|
*
|
||||||
|
* Any pending reads from SDL_LoadFileAsync() that are still in this queue
|
||||||
|
* will have their buffers deallocated by this function, to prevent a memory
|
||||||
|
* leak.
|
||||||
|
*
|
||||||
|
* Once this function is called, the queue is no longer valid and should not
|
||||||
|
* be used, including by other threads that might access it while destruction
|
||||||
|
* is blocking on pending tasks.
|
||||||
|
*
|
||||||
|
* Do not destroy a queue that still has threads waiting on it through
|
||||||
|
* SDL_WaitAsyncIOResult(). You can call SDL_SignalAsyncIOQueue() first to
|
||||||
|
* unblock those threads, and take measures (such as SDL_WaitThread()) to make
|
||||||
|
* sure they have finished their wait and won't wait on the queue again.
|
||||||
|
*
|
||||||
|
* \param queue the task queue to destroy.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread, so long as
|
||||||
|
* no other thread is waiting on the queue with
|
||||||
|
* SDL_WaitAsyncIOResult.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC void SDLCALL SDL_DestroyAsyncIOQueue(SDL_AsyncIOQueue *queue);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Query an async I/O task queue for completed tasks.
|
||||||
|
*
|
||||||
|
* If a task assigned to this queue has finished, this will return true and
|
||||||
|
* fill in `outcome` with the details of the task. If no task in the queue has
|
||||||
|
* finished, this function will return false. This function does not block.
|
||||||
|
*
|
||||||
|
* If a task has completed, this function will free its resources and the task
|
||||||
|
* pointer will no longer be valid. The task will be removed from the queue.
|
||||||
|
*
|
||||||
|
* It is safe for multiple threads to call this function on the same queue at
|
||||||
|
* once; a completed task will only go to one of the threads.
|
||||||
|
*
|
||||||
|
* \param queue the async I/O task queue to query.
|
||||||
|
* \param outcome details of a finished task will be written here. May not be
|
||||||
|
* NULL.
|
||||||
|
* \returns true if a task has completed, false otherwise.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_WaitAsyncIOResult
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC bool SDLCALL SDL_GetAsyncIOResult(SDL_AsyncIOQueue *queue, SDL_AsyncIOOutcome *outcome);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Block until an async I/O task queue has a completed task.
|
||||||
|
*
|
||||||
|
* This function puts the calling thread to sleep until there a task assigned
|
||||||
|
* to the queue that has finished.
|
||||||
|
*
|
||||||
|
* If a task assigned to the queue has finished, this will return true and
|
||||||
|
* fill in `outcome` with the details of the task. If no task in the queue has
|
||||||
|
* finished, this function will return false.
|
||||||
|
*
|
||||||
|
* If a task has completed, this function will free its resources and the task
|
||||||
|
* pointer will no longer be valid. The task will be removed from the queue.
|
||||||
|
*
|
||||||
|
* It is safe for multiple threads to call this function on the same queue at
|
||||||
|
* once; a completed task will only go to one of the threads.
|
||||||
|
*
|
||||||
|
* Note that by the nature of various platforms, more than one waiting thread
|
||||||
|
* may wake to handle a single task, but only one will obtain it, so
|
||||||
|
* `timeoutMS` is a _maximum_ wait time, and this function may return false
|
||||||
|
* sooner.
|
||||||
|
*
|
||||||
|
* This function may return false if there was a system error, the OS
|
||||||
|
* inadvertently awoke multiple threads, or if SDL_SignalAsyncIOQueue() was
|
||||||
|
* called to wake up all waiting threads without a finished task.
|
||||||
|
*
|
||||||
|
* A timeout can be used to specify a maximum wait time, but rather than
|
||||||
|
* polling, it is possible to have a timeout of -1 to wait forever, and use
|
||||||
|
* SDL_SignalAsyncIOQueue() to wake up the waiting threads later.
|
||||||
|
*
|
||||||
|
* \param queue the async I/O task queue to wait on.
|
||||||
|
* \param outcome details of a finished task will be written here. May not be
|
||||||
|
* NULL.
|
||||||
|
* \param timeoutMS the maximum time to wait, in milliseconds, or -1 to wait
|
||||||
|
* indefinitely.
|
||||||
|
* \returns true if task has completed, false otherwise.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_SignalAsyncIOQueue
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC bool SDLCALL SDL_WaitAsyncIOResult(SDL_AsyncIOQueue *queue, SDL_AsyncIOOutcome *outcome, Sint32 timeoutMS);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wake up any threads that are blocking in SDL_WaitAsyncIOResult().
|
||||||
|
*
|
||||||
|
* This will unblock any threads that are sleeping in a call to
|
||||||
|
* SDL_WaitAsyncIOResult for the specified queue, and cause them to return
|
||||||
|
* from that function.
|
||||||
|
*
|
||||||
|
* This can be useful when destroying a queue to make sure nothing is touching
|
||||||
|
* it indefinitely. In this case, once this call completes, the caller should
|
||||||
|
* take measures to make sure any previously-blocked threads have returned
|
||||||
|
* from their wait and will not touch the queue again (perhaps by setting a
|
||||||
|
* flag to tell the threads to terminate and then using SDL_WaitThread() to
|
||||||
|
* make sure they've done so).
|
||||||
|
*
|
||||||
|
* \param queue the async I/O task queue to signal.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_WaitAsyncIOResult
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC void SDLCALL SDL_SignalAsyncIOQueue(SDL_AsyncIOQueue *queue);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load all the data from a file path, asynchronously.
|
||||||
|
*
|
||||||
|
* This function returns as quickly as possible; it does not wait for the read
|
||||||
|
* to complete. On a successful return, this work will continue in the
|
||||||
|
* background. If the work begins, even failure is asynchronous: a failing
|
||||||
|
* return value from this function only means the work couldn't start at all.
|
||||||
|
*
|
||||||
|
* The data is allocated with a zero byte at the end (null terminated) for
|
||||||
|
* convenience. This extra byte is not included in SDL_AsyncIOOutcome's
|
||||||
|
* bytes_transferred value.
|
||||||
|
*
|
||||||
|
* This function will allocate the buffer to contain the file. It must be
|
||||||
|
* deallocated by calling SDL_free() on SDL_AsyncIOOutcome's buffer field
|
||||||
|
* after completion.
|
||||||
|
*
|
||||||
|
* An SDL_AsyncIOQueue must be specified. The newly-created task will be added
|
||||||
|
* to it when it completes its work.
|
||||||
|
*
|
||||||
|
* \param file the path to read all available data from.
|
||||||
|
* \param queue a queue to add the new SDL_AsyncIO to.
|
||||||
|
* \param userdata an app-defined pointer that will be provided with the task
|
||||||
|
* results.
|
||||||
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
|
* information.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_LoadFile_IO
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC bool SDLCALL SDL_LoadFileAsync(const char *file, SDL_AsyncIOQueue *queue, void *userdata);
|
||||||
|
|
||||||
|
/* Ends C function definitions when using C++ */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#include <SDL3/SDL_close_code.h>
|
||||||
|
|
||||||
|
#endif /* SDL_asyncio_h_ */
|
||||||
@@ -0,0 +1,664 @@
|
|||||||
|
/*
|
||||||
|
Simple DirectMedia Layer
|
||||||
|
Copyright (C) 1997-2025 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* # CategoryAtomic
|
||||||
|
*
|
||||||
|
* Atomic operations.
|
||||||
|
*
|
||||||
|
* IMPORTANT: If you are not an expert in concurrent lockless programming, you
|
||||||
|
* should not be using any functions in this file. You should be protecting
|
||||||
|
* your data structures with full mutexes instead.
|
||||||
|
*
|
||||||
|
* ***Seriously, here be dragons!***
|
||||||
|
*
|
||||||
|
* You can find out a little more about lockless programming and the subtle
|
||||||
|
* issues that can arise here:
|
||||||
|
* https://learn.microsoft.com/en-us/windows/win32/dxtecharts/lockless-programming
|
||||||
|
*
|
||||||
|
* There's also lots of good information here:
|
||||||
|
*
|
||||||
|
* - https://www.1024cores.net/home/lock-free-algorithms
|
||||||
|
* - https://preshing.com/
|
||||||
|
*
|
||||||
|
* These operations may or may not actually be implemented using processor
|
||||||
|
* specific atomic operations. When possible they are implemented as true
|
||||||
|
* processor specific atomic operations. When that is not possible the are
|
||||||
|
* implemented using locks that *do* use the available atomic operations.
|
||||||
|
*
|
||||||
|
* All of the atomic operations that modify memory are full memory barriers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SDL_atomic_h_
|
||||||
|
#define SDL_atomic_h_
|
||||||
|
|
||||||
|
#include <SDL3/SDL_stdinc.h>
|
||||||
|
#include <SDL3/SDL_platform_defines.h>
|
||||||
|
|
||||||
|
#include <SDL3/SDL_begin_code.h>
|
||||||
|
|
||||||
|
/* Set up for C function definitions, even when using C++ */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An atomic spinlock.
|
||||||
|
*
|
||||||
|
* The atomic locks are efficient spinlocks using CPU instructions, but are
|
||||||
|
* vulnerable to starvation and can spin forever if a thread holding a lock
|
||||||
|
* has been terminated. For this reason you should minimize the code executed
|
||||||
|
* inside an atomic lock and never do expensive things like API or system
|
||||||
|
* calls while holding them.
|
||||||
|
*
|
||||||
|
* They are also vulnerable to starvation if the thread holding the lock is
|
||||||
|
* lower priority than other threads and doesn't get scheduled. In general you
|
||||||
|
* should use mutexes instead, since they have better performance and
|
||||||
|
* contention behavior.
|
||||||
|
*
|
||||||
|
* The atomic locks are not safe to lock recursively.
|
||||||
|
*
|
||||||
|
* Porting Note: The spin lock functions and type are required and can not be
|
||||||
|
* emulated because they are used in the atomic emulation code.
|
||||||
|
*/
|
||||||
|
typedef int SDL_SpinLock;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Try to lock a spin lock by setting it to a non-zero value.
|
||||||
|
*
|
||||||
|
* ***Please note that spinlocks are dangerous if you don't know what you're
|
||||||
|
* doing. Please be careful using any sort of spinlock!***
|
||||||
|
*
|
||||||
|
* \param lock a pointer to a lock variable.
|
||||||
|
* \returns true if the lock succeeded, false if the lock is already held.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_LockSpinlock
|
||||||
|
* \sa SDL_UnlockSpinlock
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC bool SDLCALL SDL_TryLockSpinlock(SDL_SpinLock *lock);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lock a spin lock by setting it to a non-zero value.
|
||||||
|
*
|
||||||
|
* ***Please note that spinlocks are dangerous if you don't know what you're
|
||||||
|
* doing. Please be careful using any sort of spinlock!***
|
||||||
|
*
|
||||||
|
* \param lock a pointer to a lock variable.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_TryLockSpinlock
|
||||||
|
* \sa SDL_UnlockSpinlock
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC void SDLCALL SDL_LockSpinlock(SDL_SpinLock *lock);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unlock a spin lock by setting it to 0.
|
||||||
|
*
|
||||||
|
* Always returns immediately.
|
||||||
|
*
|
||||||
|
* ***Please note that spinlocks are dangerous if you don't know what you're
|
||||||
|
* doing. Please be careful using any sort of spinlock!***
|
||||||
|
*
|
||||||
|
* \param lock a pointer to a lock variable.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_LockSpinlock
|
||||||
|
* \sa SDL_TryLockSpinlock
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC void SDLCALL SDL_UnlockSpinlock(SDL_SpinLock *lock);
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mark a compiler barrier.
|
||||||
|
*
|
||||||
|
* A compiler barrier prevents the compiler from reordering reads and writes
|
||||||
|
* to globally visible variables across the call.
|
||||||
|
*
|
||||||
|
* This macro only prevents the compiler from reordering reads and writes, it
|
||||||
|
* does not prevent the CPU from reordering reads and writes. However, all of
|
||||||
|
* the atomic operations that modify memory are full memory barriers.
|
||||||
|
*
|
||||||
|
* \threadsafety Obviously this macro is safe to use from any thread at any
|
||||||
|
* time, but if you find yourself needing this, you are probably
|
||||||
|
* dealing with some very sensitive code; be careful!
|
||||||
|
*
|
||||||
|
* \since This macro is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
#define SDL_CompilerBarrier() DoCompilerSpecificReadWriteBarrier()
|
||||||
|
|
||||||
|
#elif defined(_MSC_VER) && (_MSC_VER > 1200) && !defined(__clang__)
|
||||||
|
void _ReadWriteBarrier(void);
|
||||||
|
#pragma intrinsic(_ReadWriteBarrier)
|
||||||
|
#define SDL_CompilerBarrier() _ReadWriteBarrier()
|
||||||
|
#elif (defined(__GNUC__) && !defined(SDL_PLATFORM_EMSCRIPTEN)) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120))
|
||||||
|
/* This is correct for all CPUs when using GCC or Solaris Studio 12.1+. */
|
||||||
|
#define SDL_CompilerBarrier() __asm__ __volatile__ ("" : : : "memory")
|
||||||
|
#elif defined(__WATCOMC__)
|
||||||
|
extern __inline void SDL_CompilerBarrier(void);
|
||||||
|
#pragma aux SDL_CompilerBarrier = "" parm [] modify exact [];
|
||||||
|
#else
|
||||||
|
#define SDL_CompilerBarrier() \
|
||||||
|
{ SDL_SpinLock _tmp = 0; SDL_LockSpinlock(&_tmp); SDL_UnlockSpinlock(&_tmp); }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Insert a memory release barrier (function version).
|
||||||
|
*
|
||||||
|
* Please refer to SDL_MemoryBarrierRelease for details. This is a function
|
||||||
|
* version, which might be useful if you need to use this functionality from a
|
||||||
|
* scripting language, etc. Also, some of the macro versions call this
|
||||||
|
* function behind the scenes, where more heavy lifting can happen inside of
|
||||||
|
* SDL. Generally, though, an app written in C/C++/etc should use the macro
|
||||||
|
* version, as it will be more efficient.
|
||||||
|
*
|
||||||
|
* \threadsafety Obviously this function is safe to use from any thread at any
|
||||||
|
* time, but if you find yourself needing this, you are probably
|
||||||
|
* dealing with some very sensitive code; be careful!
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_MemoryBarrierRelease
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC void SDLCALL SDL_MemoryBarrierReleaseFunction(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Insert a memory acquire barrier (function version).
|
||||||
|
*
|
||||||
|
* Please refer to SDL_MemoryBarrierRelease for details. This is a function
|
||||||
|
* version, which might be useful if you need to use this functionality from a
|
||||||
|
* scripting language, etc. Also, some of the macro versions call this
|
||||||
|
* function behind the scenes, where more heavy lifting can happen inside of
|
||||||
|
* SDL. Generally, though, an app written in C/C++/etc should use the macro
|
||||||
|
* version, as it will be more efficient.
|
||||||
|
*
|
||||||
|
* \threadsafety Obviously this function is safe to use from any thread at any
|
||||||
|
* time, but if you find yourself needing this, you are probably
|
||||||
|
* dealing with some very sensitive code; be careful!
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_MemoryBarrierAcquire
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC void SDLCALL SDL_MemoryBarrierAcquireFunction(void);
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Insert a memory release barrier (macro version).
|
||||||
|
*
|
||||||
|
* Memory barriers are designed to prevent reads and writes from being
|
||||||
|
* reordered by the compiler and being seen out of order on multi-core CPUs.
|
||||||
|
*
|
||||||
|
* A typical pattern would be for thread A to write some data and a flag, and
|
||||||
|
* for thread B to read the flag and get the data. In this case you would
|
||||||
|
* insert a release barrier between writing the data and the flag,
|
||||||
|
* guaranteeing that the data write completes no later than the flag is
|
||||||
|
* written, and you would insert an acquire barrier between reading the flag
|
||||||
|
* and reading the data, to ensure that all the reads associated with the flag
|
||||||
|
* have completed.
|
||||||
|
*
|
||||||
|
* In this pattern you should always see a release barrier paired with an
|
||||||
|
* acquire barrier and you should gate the data reads/writes with a single
|
||||||
|
* flag variable.
|
||||||
|
*
|
||||||
|
* For more information on these semantics, take a look at the blog post:
|
||||||
|
* http://preshing.com/20120913/acquire-and-release-semantics
|
||||||
|
*
|
||||||
|
* This is the macro version of this functionality; if possible, SDL will use
|
||||||
|
* compiler intrinsics or inline assembly, but some platforms might need to
|
||||||
|
* call the function version of this, SDL_MemoryBarrierReleaseFunction to do
|
||||||
|
* the heavy lifting. Apps that can use the macro should favor it over the
|
||||||
|
* function.
|
||||||
|
*
|
||||||
|
* \threadsafety Obviously this macro is safe to use from any thread at any
|
||||||
|
* time, but if you find yourself needing this, you are probably
|
||||||
|
* dealing with some very sensitive code; be careful!
|
||||||
|
*
|
||||||
|
* \since This macro is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_MemoryBarrierAcquire
|
||||||
|
* \sa SDL_MemoryBarrierReleaseFunction
|
||||||
|
*/
|
||||||
|
#define SDL_MemoryBarrierRelease() SDL_MemoryBarrierReleaseFunction()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Insert a memory acquire barrier (macro version).
|
||||||
|
*
|
||||||
|
* Please see SDL_MemoryBarrierRelease for the details on what memory barriers
|
||||||
|
* are and when to use them.
|
||||||
|
*
|
||||||
|
* This is the macro version of this functionality; if possible, SDL will use
|
||||||
|
* compiler intrinsics or inline assembly, but some platforms might need to
|
||||||
|
* call the function version of this, SDL_MemoryBarrierAcquireFunction, to do
|
||||||
|
* the heavy lifting. Apps that can use the macro should favor it over the
|
||||||
|
* function.
|
||||||
|
*
|
||||||
|
* \threadsafety Obviously this macro is safe to use from any thread at any
|
||||||
|
* time, but if you find yourself needing this, you are probably
|
||||||
|
* dealing with some very sensitive code; be careful!
|
||||||
|
*
|
||||||
|
* \since This macro is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_MemoryBarrierRelease
|
||||||
|
* \sa SDL_MemoryBarrierAcquireFunction
|
||||||
|
*/
|
||||||
|
#define SDL_MemoryBarrierAcquire() SDL_MemoryBarrierAcquireFunction()
|
||||||
|
|
||||||
|
#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")
|
||||||
|
#elif defined(__GNUC__) && defined(__arm__)
|
||||||
|
#if 0 /* defined(SDL_PLATFORM_LINUX) || defined(SDL_PLATFORM_ANDROID) */
|
||||||
|
/* Information from:
|
||||||
|
https://chromium.googlesource.com/chromium/chromium/+/trunk/base/atomicops_internals_arm_gcc.h#19
|
||||||
|
|
||||||
|
The Linux kernel provides a helper function which provides the right code for a memory barrier,
|
||||||
|
hard-coded at address 0xffff0fa0
|
||||||
|
*/
|
||||||
|
typedef void (*SDL_KernelMemoryBarrierFunc)();
|
||||||
|
#define SDL_MemoryBarrierRelease() ((SDL_KernelMemoryBarrierFunc)0xffff0fa0)()
|
||||||
|
#define SDL_MemoryBarrierAcquire() ((SDL_KernelMemoryBarrierFunc)0xffff0fa0)()
|
||||||
|
#else
|
||||||
|
#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) || defined(__ARM_ARCH_8A__)
|
||||||
|
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory")
|
||||||
|
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory")
|
||||||
|
#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__)
|
||||||
|
#ifdef __thumb__
|
||||||
|
/* The mcr instruction isn't available in thumb mode, use real functions */
|
||||||
|
#define SDL_MEMORY_BARRIER_USES_FUNCTION
|
||||||
|
#define SDL_MemoryBarrierRelease() SDL_MemoryBarrierReleaseFunction()
|
||||||
|
#define SDL_MemoryBarrierAcquire() SDL_MemoryBarrierAcquireFunction()
|
||||||
|
#else
|
||||||
|
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory")
|
||||||
|
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory")
|
||||||
|
#endif /* __thumb__ */
|
||||||
|
#else
|
||||||
|
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("" : : : "memory")
|
||||||
|
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("" : : : "memory")
|
||||||
|
#endif /* SDL_PLATFORM_LINUX || SDL_PLATFORM_ANDROID */
|
||||||
|
#endif /* __GNUC__ && __arm__ */
|
||||||
|
#else
|
||||||
|
#if (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120))
|
||||||
|
/* This is correct for all CPUs on Solaris when using Solaris Studio 12.1+. */
|
||||||
|
#include <mbarrier.h>
|
||||||
|
#define SDL_MemoryBarrierRelease() __machine_rel_barrier()
|
||||||
|
#define SDL_MemoryBarrierAcquire() __machine_acq_barrier()
|
||||||
|
#else
|
||||||
|
/* This is correct for the x86 and x64 CPUs, and we'll expand this over time. */
|
||||||
|
#define SDL_MemoryBarrierRelease() SDL_CompilerBarrier()
|
||||||
|
#define SDL_MemoryBarrierAcquire() SDL_CompilerBarrier()
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* "REP NOP" is PAUSE, coded for tools that don't know it by that name. */
|
||||||
|
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A macro to insert a CPU-specific "pause" instruction into the program.
|
||||||
|
*
|
||||||
|
* This can be useful in busy-wait loops, as it serves as a hint to the CPU as
|
||||||
|
* to the program's intent; some CPUs can use this to do more efficient
|
||||||
|
* processing. On some platforms, this doesn't do anything, so using this
|
||||||
|
* macro might just be a harmless no-op.
|
||||||
|
*
|
||||||
|
* Note that if you are busy-waiting, there are often more-efficient
|
||||||
|
* approaches with other synchronization primitives: mutexes, semaphores,
|
||||||
|
* condition variables, etc.
|
||||||
|
*
|
||||||
|
* \threadsafety This macro is safe to use from any thread.
|
||||||
|
*
|
||||||
|
* \since This macro is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
#define SDL_CPUPauseInstruction() DoACPUPauseInACompilerAndArchitectureSpecificWay
|
||||||
|
|
||||||
|
#elif (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))
|
||||||
|
#define SDL_CPUPauseInstruction() __asm__ __volatile__("pause\n") /* Some assemblers can't do REP NOP, so go with PAUSE. */
|
||||||
|
#elif (defined(__arm__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7) || defined(__aarch64__)
|
||||||
|
#define SDL_CPUPauseInstruction() __asm__ __volatile__("yield" ::: "memory")
|
||||||
|
#elif (defined(__powerpc__) || defined(__powerpc64__))
|
||||||
|
#define SDL_CPUPauseInstruction() __asm__ __volatile__("or 27,27,27");
|
||||||
|
#elif (defined(__riscv) && __riscv_xlen == 64)
|
||||||
|
#define SDL_CPUPauseInstruction() __asm__ __volatile__(".insn i 0x0F, 0, x0, x0, 0x010");
|
||||||
|
#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
|
||||||
|
#define SDL_CPUPauseInstruction() _mm_pause() /* this is actually "rep nop" and not a SIMD instruction. No inline asm in MSVC x86-64! */
|
||||||
|
#elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64))
|
||||||
|
#define SDL_CPUPauseInstruction() __yield()
|
||||||
|
#elif defined(__WATCOMC__) && defined(__386__)
|
||||||
|
extern __inline void SDL_CPUPauseInstruction(void);
|
||||||
|
#pragma aux SDL_CPUPauseInstruction = ".686p" ".xmm2" "pause"
|
||||||
|
#else
|
||||||
|
#define SDL_CPUPauseInstruction()
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A type representing an atomic integer value.
|
||||||
|
*
|
||||||
|
* This can be used to manage a value that is synchronized across multiple
|
||||||
|
* CPUs without a race condition; when an app sets a value with
|
||||||
|
* SDL_SetAtomicInt all other threads, regardless of the CPU it is running on,
|
||||||
|
* will see that value when retrieved with SDL_GetAtomicInt, regardless of CPU
|
||||||
|
* caches, etc.
|
||||||
|
*
|
||||||
|
* This is also useful for atomic compare-and-swap operations: a thread can
|
||||||
|
* change the value as long as its current value matches expectations. When
|
||||||
|
* done in a loop, one can guarantee data consistency across threads without a
|
||||||
|
* lock (but the usual warnings apply: if you don't know what you're doing, or
|
||||||
|
* you don't do it carefully, you can confidently cause any number of
|
||||||
|
* disasters with this, so in most cases, you _should_ use a mutex instead of
|
||||||
|
* this!).
|
||||||
|
*
|
||||||
|
* This is a struct so people don't accidentally use numeric operations on it
|
||||||
|
* directly. You have to use SDL atomic functions.
|
||||||
|
*
|
||||||
|
* \since This struct is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_CompareAndSwapAtomicInt
|
||||||
|
* \sa SDL_GetAtomicInt
|
||||||
|
* \sa SDL_SetAtomicInt
|
||||||
|
* \sa SDL_AddAtomicInt
|
||||||
|
*/
|
||||||
|
typedef struct SDL_AtomicInt { int value; } SDL_AtomicInt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set an atomic variable to a new value if it is currently an old value.
|
||||||
|
*
|
||||||
|
* ***Note: If you don't know what this function is for, you shouldn't use
|
||||||
|
* it!***
|
||||||
|
*
|
||||||
|
* \param a a pointer to an SDL_AtomicInt variable to be modified.
|
||||||
|
* \param oldval the old value.
|
||||||
|
* \param newval the new value.
|
||||||
|
* \returns true if the atomic variable was set, false otherwise.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_GetAtomicInt
|
||||||
|
* \sa SDL_SetAtomicInt
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC bool SDLCALL SDL_CompareAndSwapAtomicInt(SDL_AtomicInt *a, int oldval, int newval);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set an atomic variable to a value.
|
||||||
|
*
|
||||||
|
* This function also acts as a full memory barrier.
|
||||||
|
*
|
||||||
|
* ***Note: If you don't know what this function is for, you shouldn't use
|
||||||
|
* it!***
|
||||||
|
*
|
||||||
|
* \param a a pointer to an SDL_AtomicInt variable to be modified.
|
||||||
|
* \param v the desired value.
|
||||||
|
* \returns the previous value of the atomic variable.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_GetAtomicInt
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC int SDLCALL SDL_SetAtomicInt(SDL_AtomicInt *a, int v);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the value of an atomic variable.
|
||||||
|
*
|
||||||
|
* ***Note: If you don't know what this function is for, you shouldn't use
|
||||||
|
* it!***
|
||||||
|
*
|
||||||
|
* \param a a pointer to an SDL_AtomicInt variable.
|
||||||
|
* \returns the current value of an atomic variable.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_SetAtomicInt
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC int SDLCALL SDL_GetAtomicInt(SDL_AtomicInt *a);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add to an atomic variable.
|
||||||
|
*
|
||||||
|
* This function also acts as a full memory barrier.
|
||||||
|
*
|
||||||
|
* ***Note: If you don't know what this function is for, you shouldn't use
|
||||||
|
* it!***
|
||||||
|
*
|
||||||
|
* \param a a pointer to an SDL_AtomicInt variable to be modified.
|
||||||
|
* \param v the desired value to add.
|
||||||
|
* \returns the previous value of the atomic variable.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_AtomicDecRef
|
||||||
|
* \sa SDL_AtomicIncRef
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC int SDLCALL SDL_AddAtomicInt(SDL_AtomicInt *a, int v);
|
||||||
|
|
||||||
|
#ifndef SDL_AtomicIncRef
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Increment an atomic variable used as a reference count.
|
||||||
|
*
|
||||||
|
* ***Note: If you don't know what this macro is for, you shouldn't use it!***
|
||||||
|
*
|
||||||
|
* \param a a pointer to an SDL_AtomicInt to increment.
|
||||||
|
* \returns the previous value of the atomic variable.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this macro from any thread.
|
||||||
|
*
|
||||||
|
* \since This macro is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_AtomicDecRef
|
||||||
|
*/
|
||||||
|
#define SDL_AtomicIncRef(a) SDL_AddAtomicInt(a, 1)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef SDL_AtomicDecRef
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Decrement an atomic variable used as a reference count.
|
||||||
|
*
|
||||||
|
* ***Note: If you don't know what this macro is for, you shouldn't use it!***
|
||||||
|
*
|
||||||
|
* \param a a pointer to an SDL_AtomicInt to decrement.
|
||||||
|
* \returns true if the variable reached zero after decrementing, false
|
||||||
|
* otherwise.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this macro from any thread.
|
||||||
|
*
|
||||||
|
* \since This macro is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_AtomicIncRef
|
||||||
|
*/
|
||||||
|
#define SDL_AtomicDecRef(a) (SDL_AddAtomicInt(a, -1) == 1)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A type representing an atomic unsigned 32-bit value.
|
||||||
|
*
|
||||||
|
* This can be used to manage a value that is synchronized across multiple
|
||||||
|
* CPUs without a race condition; when an app sets a value with
|
||||||
|
* SDL_SetAtomicU32 all other threads, regardless of the CPU it is running on,
|
||||||
|
* will see that value when retrieved with SDL_GetAtomicU32, regardless of CPU
|
||||||
|
* caches, etc.
|
||||||
|
*
|
||||||
|
* This is also useful for atomic compare-and-swap operations: a thread can
|
||||||
|
* change the value as long as its current value matches expectations. When
|
||||||
|
* done in a loop, one can guarantee data consistency across threads without a
|
||||||
|
* lock (but the usual warnings apply: if you don't know what you're doing, or
|
||||||
|
* you don't do it carefully, you can confidently cause any number of
|
||||||
|
* disasters with this, so in most cases, you _should_ use a mutex instead of
|
||||||
|
* this!).
|
||||||
|
*
|
||||||
|
* This is a struct so people don't accidentally use numeric operations on it
|
||||||
|
* directly. You have to use SDL atomic functions.
|
||||||
|
*
|
||||||
|
* \since This struct is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_CompareAndSwapAtomicU32
|
||||||
|
* \sa SDL_GetAtomicU32
|
||||||
|
* \sa SDL_SetAtomicU32
|
||||||
|
*/
|
||||||
|
typedef struct SDL_AtomicU32 { Uint32 value; } SDL_AtomicU32;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set an atomic variable to a new value if it is currently an old value.
|
||||||
|
*
|
||||||
|
* ***Note: If you don't know what this function is for, you shouldn't use
|
||||||
|
* it!***
|
||||||
|
*
|
||||||
|
* \param a a pointer to an SDL_AtomicU32 variable to be modified.
|
||||||
|
* \param oldval the old value.
|
||||||
|
* \param newval the new value.
|
||||||
|
* \returns true if the atomic variable was set, false otherwise.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_GetAtomicU32
|
||||||
|
* \sa SDL_SetAtomicU32
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC bool SDLCALL SDL_CompareAndSwapAtomicU32(SDL_AtomicU32 *a, Uint32 oldval, Uint32 newval);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set an atomic variable to a value.
|
||||||
|
*
|
||||||
|
* This function also acts as a full memory barrier.
|
||||||
|
*
|
||||||
|
* ***Note: If you don't know what this function is for, you shouldn't use
|
||||||
|
* it!***
|
||||||
|
*
|
||||||
|
* \param a a pointer to an SDL_AtomicU32 variable to be modified.
|
||||||
|
* \param v the desired value.
|
||||||
|
* \returns the previous value of the atomic variable.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_GetAtomicU32
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC Uint32 SDLCALL SDL_SetAtomicU32(SDL_AtomicU32 *a, Uint32 v);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the value of an atomic variable.
|
||||||
|
*
|
||||||
|
* ***Note: If you don't know what this function is for, you shouldn't use
|
||||||
|
* it!***
|
||||||
|
*
|
||||||
|
* \param a a pointer to an SDL_AtomicU32 variable.
|
||||||
|
* \returns the current value of an atomic variable.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_SetAtomicU32
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetAtomicU32(SDL_AtomicU32 *a);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set a pointer to a new value if it is currently an old value.
|
||||||
|
*
|
||||||
|
* ***Note: If you don't know what this function is for, you shouldn't use
|
||||||
|
* it!***
|
||||||
|
*
|
||||||
|
* \param a a pointer to a pointer.
|
||||||
|
* \param oldval the old pointer value.
|
||||||
|
* \param newval the new pointer value.
|
||||||
|
* \returns true if the pointer was set, false otherwise.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_CompareAndSwapAtomicInt
|
||||||
|
* \sa SDL_GetAtomicPointer
|
||||||
|
* \sa SDL_SetAtomicPointer
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC bool SDLCALL SDL_CompareAndSwapAtomicPointer(void **a, void *oldval, void *newval);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set a pointer to a value atomically.
|
||||||
|
*
|
||||||
|
* ***Note: If you don't know what this function is for, you shouldn't use
|
||||||
|
* it!***
|
||||||
|
*
|
||||||
|
* \param a a pointer to a pointer.
|
||||||
|
* \param v the desired pointer value.
|
||||||
|
* \returns the previous value of the pointer.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_CompareAndSwapAtomicPointer
|
||||||
|
* \sa SDL_GetAtomicPointer
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC void * SDLCALL SDL_SetAtomicPointer(void **a, void *v);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the value of a pointer atomically.
|
||||||
|
*
|
||||||
|
* ***Note: If you don't know what this function is for, you shouldn't use
|
||||||
|
* it!***
|
||||||
|
*
|
||||||
|
* \param a a pointer to a pointer.
|
||||||
|
* \returns the current value of a pointer.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_CompareAndSwapAtomicPointer
|
||||||
|
* \sa SDL_SetAtomicPointer
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC void * SDLCALL SDL_GetAtomicPointer(void **a);
|
||||||
|
|
||||||
|
/* Ends C function definitions when using C++ */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <SDL3/SDL_close_code.h>
|
||||||
|
|
||||||
|
#endif /* SDL_atomic_h_ */
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,486 @@
|
|||||||
|
/*
|
||||||
|
Simple DirectMedia Layer
|
||||||
|
Copyright (C) 1997-2025 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* WIKI CATEGORY: BeginCode */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* # CategoryBeginCode
|
||||||
|
*
|
||||||
|
* `SDL_begin_code.h` sets things up for C dynamic library function
|
||||||
|
* definitions, static inlined functions, and structures aligned at 4-byte
|
||||||
|
* alignment. If you don't like ugly C preprocessor code, don't look at this
|
||||||
|
* file. :)
|
||||||
|
*
|
||||||
|
* SDL's headers use this; applications generally should not include this
|
||||||
|
* header directly.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* This shouldn't be nested -- included it around code only. */
|
||||||
|
#ifdef SDL_begin_code_h
|
||||||
|
#error Nested inclusion of SDL_begin_code.h
|
||||||
|
#endif
|
||||||
|
#define SDL_begin_code_h
|
||||||
|
|
||||||
|
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A macro to tag a symbol as deprecated.
|
||||||
|
*
|
||||||
|
* A function is marked deprecated by adding this macro to its declaration:
|
||||||
|
*
|
||||||
|
* ```c
|
||||||
|
* extern SDL_DEPRECATED int ThisFunctionWasABadIdea(void);
|
||||||
|
* ```
|
||||||
|
*
|
||||||
|
* Compilers with deprecation support can give a warning when a deprecated
|
||||||
|
* function is used. This symbol may be used in SDL's headers, but apps are
|
||||||
|
* welcome to use it for their own interfaces as well.
|
||||||
|
*
|
||||||
|
* SDL, on occasion, might deprecate a function for various reasons. However,
|
||||||
|
* SDL never removes symbols before major versions, so deprecated interfaces
|
||||||
|
* in SDL3 will remain available until SDL4, where it would be expected an app
|
||||||
|
* would have to take steps to migrate anyhow.
|
||||||
|
*
|
||||||
|
* On compilers without a deprecation mechanism, this is defined to nothing,
|
||||||
|
* and using a deprecated function will not generate a warning.
|
||||||
|
*
|
||||||
|
* \since This macro is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
#define SDL_DEPRECATED __attribute__((deprecated))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A macro to tag a symbol as a public API.
|
||||||
|
*
|
||||||
|
* SDL uses this macro for all its public functions. On some targets, it is
|
||||||
|
* used to signal to the compiler that this function needs to be exported from
|
||||||
|
* a shared library, but it might have other side effects.
|
||||||
|
*
|
||||||
|
* This symbol is used in SDL's headers, but apps and other libraries are
|
||||||
|
* welcome to use it for their own interfaces as well.
|
||||||
|
*
|
||||||
|
* \since This macro is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
#define SDL_DECLSPEC __attribute__ ((visibility("default")))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A macro to set a function's calling conventions.
|
||||||
|
*
|
||||||
|
* SDL uses this macro for all its public functions, and any callbacks it
|
||||||
|
* defines. This macro guarantees that calling conventions match between SDL
|
||||||
|
* and the app, even if the two were built with different compilers or
|
||||||
|
* optimization settings.
|
||||||
|
*
|
||||||
|
* When writing a callback function, it is very important for it to be
|
||||||
|
* correctly tagged with SDLCALL, as mismatched calling conventions can cause
|
||||||
|
* strange behaviors and can be difficult to diagnose. Plus, on many
|
||||||
|
* platforms, SDLCALL is defined to nothing, so compilers won't be able to
|
||||||
|
* warn that the tag is missing.
|
||||||
|
*
|
||||||
|
* This symbol is used in SDL's headers, but apps and other libraries are
|
||||||
|
* welcome to use it for their own interfaces as well.
|
||||||
|
*
|
||||||
|
* \since This macro is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
#define SDLCALL __cdecl
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A macro to request a function be inlined.
|
||||||
|
*
|
||||||
|
* This is a hint to the compiler to inline a function. The compiler is free
|
||||||
|
* to ignore this request. On compilers without inline support, this is
|
||||||
|
* defined to nothing.
|
||||||
|
*
|
||||||
|
* \since This macro is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
#define SDL_INLINE __inline
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A macro to demand a function be inlined.
|
||||||
|
*
|
||||||
|
* This is a command to the compiler to inline a function. SDL uses this macro
|
||||||
|
* in its public headers for a handful of simple functions. On compilers
|
||||||
|
* without forceinline support, this is defined to `static SDL_INLINE`, which
|
||||||
|
* is often good enough.
|
||||||
|
*
|
||||||
|
* This symbol is used in SDL's headers, but apps and other libraries are
|
||||||
|
* welcome to use it for their own interfaces as well.
|
||||||
|
*
|
||||||
|
* \since This macro is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
#define SDL_FORCE_INLINE __forceinline
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A macro to tag a function as never-returning.
|
||||||
|
*
|
||||||
|
* This is a hint to the compiler that a function does not return. An example
|
||||||
|
* of a function like this is the C runtime's exit() function.
|
||||||
|
*
|
||||||
|
* This hint can lead to code optimizations, and help analyzers understand
|
||||||
|
* code flow better. On compilers without noreturn support, this is defined to
|
||||||
|
* nothing.
|
||||||
|
*
|
||||||
|
* This symbol is used in SDL's headers, but apps and other libraries are
|
||||||
|
* welcome to use it for their own interfaces as well.
|
||||||
|
*
|
||||||
|
* \since This macro is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
#define SDL_NORETURN __attribute__((noreturn))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A macro to tag a function as never-returning (for analysis purposes).
|
||||||
|
*
|
||||||
|
* This is almost identical to SDL_NORETURN, except functions marked with this
|
||||||
|
* _can_ actually return. The difference is that this isn't used for code
|
||||||
|
* generation, but rather static analyzers use this information to assume
|
||||||
|
* truths about program state and available code paths. Specifically, this tag
|
||||||
|
* is useful for writing an assertion mechanism. Indeed, SDL_assert uses this
|
||||||
|
* tag behind the scenes. Generally, apps that don't understand the specific
|
||||||
|
* use-case for this tag should avoid using it directly.
|
||||||
|
*
|
||||||
|
* On compilers without analyzer_noreturn support, this is defined to nothing.
|
||||||
|
*
|
||||||
|
* This symbol is used in SDL's headers, but apps and other libraries are
|
||||||
|
* welcome to use it for their own interfaces as well.
|
||||||
|
*
|
||||||
|
* \since This macro is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
#define SDL_ANALYZER_NORETURN __attribute__((analyzer_noreturn))
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A macro to signal that a case statement without a `break` is intentional.
|
||||||
|
*
|
||||||
|
* C compilers have gotten more aggressive about warning when a switch's
|
||||||
|
* `case` block does not end with a `break` or other flow control statement,
|
||||||
|
* flowing into the next case's code, as this is a common accident that leads
|
||||||
|
* to strange bugs. But sometimes falling through to the next case is the
|
||||||
|
* correct and desired behavior. This symbol lets an app communicate this
|
||||||
|
* intention to the compiler, so it doesn't generate a warning.
|
||||||
|
*
|
||||||
|
* It is used like this:
|
||||||
|
*
|
||||||
|
* ```c
|
||||||
|
* switch (x) {
|
||||||
|
* case 1:
|
||||||
|
* DoSomethingOnlyForOne();
|
||||||
|
* SDL_FALLTHROUGH; // tell the compiler this was intentional.
|
||||||
|
* case 2:
|
||||||
|
* DoSomethingForOneAndTwo();
|
||||||
|
* break;
|
||||||
|
* }
|
||||||
|
* ```
|
||||||
|
*
|
||||||
|
* \since This macro is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
#define SDL_FALLTHROUGH [[fallthrough]]
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A macro to tag a function's return value as critical.
|
||||||
|
*
|
||||||
|
* This is a hint to the compiler that a function's return value should not be
|
||||||
|
* ignored.
|
||||||
|
*
|
||||||
|
* If an NODISCARD function's return value is thrown away (the function is
|
||||||
|
* called as if it returns `void`), the compiler will issue a warning.
|
||||||
|
*
|
||||||
|
* While it's generally good practice to check return values for errors, often
|
||||||
|
* times legitimate programs do not for good reasons. Be careful about what
|
||||||
|
* functions are tagged as NODISCARD. It operates best when used on a function
|
||||||
|
* that's failure is surprising and catastrophic; a good example would be a
|
||||||
|
* program that checks the return values of all its file write function calls
|
||||||
|
* but not the call to close the file, which it assumes incorrectly never
|
||||||
|
* fails.
|
||||||
|
*
|
||||||
|
* Function callers that want to throw away a NODISCARD return value can call
|
||||||
|
* the function with a `(void)` cast, which informs the compiler the act is
|
||||||
|
* intentional.
|
||||||
|
*
|
||||||
|
* On compilers without nodiscard support, this is defined to nothing.
|
||||||
|
*
|
||||||
|
* \since This macro is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
#define SDL_NODISCARD [[nodiscard]]
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A macro to tag a function as an allocator.
|
||||||
|
*
|
||||||
|
* This is a hint to the compiler that a function is an allocator, like
|
||||||
|
* malloc(), with certain rules. A description of how GCC treats this hint is
|
||||||
|
* here:
|
||||||
|
*
|
||||||
|
* https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-malloc-function-attribute
|
||||||
|
*
|
||||||
|
* On compilers without allocator tag support, this is defined to nothing.
|
||||||
|
*
|
||||||
|
* Most apps don't need to, and should not, use this directly.
|
||||||
|
*
|
||||||
|
* \since This macro is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
#define SDL_MALLOC __declspec(allocator) __desclspec(restrict)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A macro to tag a function as returning a certain allocation.
|
||||||
|
*
|
||||||
|
* This is a hint to the compiler that a function allocates and returns a
|
||||||
|
* specific amount of memory based on one of its arguments. For example, the C
|
||||||
|
* runtime's malloc() function could use this macro with an argument of 1
|
||||||
|
* (first argument to malloc is the size of the allocation).
|
||||||
|
*
|
||||||
|
* On compilers without alloc_size support, this is defined to nothing.
|
||||||
|
*
|
||||||
|
* Most apps don't need to, and should not, use this directly.
|
||||||
|
*
|
||||||
|
* \since This macro is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
#define SDL_ALLOC_SIZE(p) __attribute__((alloc_size(p)))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A macro to tag a pointer variable, to help with pointer aliasing.
|
||||||
|
*
|
||||||
|
* A good explanation of the restrict keyword is here:
|
||||||
|
*
|
||||||
|
* https://en.wikipedia.org/wiki/Restrict
|
||||||
|
*
|
||||||
|
* On compilers without restrict support, this is defined to nothing.
|
||||||
|
*
|
||||||
|
* \since This macro is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
#define SDL_RESTRICT __restrict__
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the compiler supports a given builtin functionality.
|
||||||
|
*
|
||||||
|
* 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_builtin support, this is defined to 0 (always
|
||||||
|
* false).
|
||||||
|
*
|
||||||
|
* \since This macro is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
#define SDL_HAS_BUILTIN(x) __has_builtin(x)
|
||||||
|
|
||||||
|
/* end of wiki documentation section. */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef SDL_HAS_BUILTIN
|
||||||
|
#ifdef __has_builtin
|
||||||
|
#define SDL_HAS_BUILTIN(x) __has_builtin(x)
|
||||||
|
#else
|
||||||
|
#define SDL_HAS_BUILTIN(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))
|
||||||
|
# elif defined(_MSC_VER)
|
||||||
|
# define SDL_DEPRECATED __declspec(deprecated)
|
||||||
|
# else
|
||||||
|
# define SDL_DEPRECATED
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef SDL_UNUSED
|
||||||
|
# ifdef __GNUC__
|
||||||
|
# define SDL_UNUSED __attribute__((unused))
|
||||||
|
# else
|
||||||
|
# define SDL_UNUSED
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Some compilers use a special export keyword */
|
||||||
|
#ifndef SDL_DECLSPEC
|
||||||
|
# if defined(SDL_PLATFORM_WINDOWS)
|
||||||
|
# ifdef DLL_EXPORT
|
||||||
|
# define SDL_DECLSPEC __declspec(dllexport)
|
||||||
|
# else
|
||||||
|
# define SDL_DECLSPEC
|
||||||
|
# endif
|
||||||
|
# else
|
||||||
|
# if defined(__GNUC__) && __GNUC__ >= 4
|
||||||
|
# define SDL_DECLSPEC __attribute__ ((visibility("default")))
|
||||||
|
# else
|
||||||
|
# define SDL_DECLSPEC
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* By default SDL uses the C calling convention */
|
||||||
|
#ifndef SDLCALL
|
||||||
|
#if defined(SDL_PLATFORM_WINDOWS) && !defined(__GNUC__)
|
||||||
|
#define SDLCALL __cdecl
|
||||||
|
#else
|
||||||
|
#define SDLCALL
|
||||||
|
#endif
|
||||||
|
#endif /* SDLCALL */
|
||||||
|
|
||||||
|
/* Force structure packing at 4 byte alignment.
|
||||||
|
This is necessary if the header is included in code which has structure
|
||||||
|
packing set to an alternate value, say for loading structures from disk.
|
||||||
|
The packing is reset to the previous value in SDL_close_code.h
|
||||||
|
*/
|
||||||
|
#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__)
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(disable: 4103)
|
||||||
|
#endif
|
||||||
|
#ifdef __clang__
|
||||||
|
#pragma clang diagnostic ignored "-Wpragma-pack"
|
||||||
|
#endif
|
||||||
|
#ifdef __BORLANDC__
|
||||||
|
#pragma nopackwarning
|
||||||
|
#endif
|
||||||
|
#ifdef _WIN64
|
||||||
|
/* Use 8-byte alignment on 64-bit architectures, so pointers are aligned */
|
||||||
|
#pragma pack(push,8)
|
||||||
|
#else
|
||||||
|
#pragma pack(push,4)
|
||||||
|
#endif
|
||||||
|
#endif /* Compiler needs structure packing set */
|
||||||
|
|
||||||
|
#ifndef SDL_INLINE
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#define SDL_INLINE __inline__
|
||||||
|
#elif defined(_MSC_VER) || defined(__BORLANDC__) || \
|
||||||
|
defined(__DMC__) || defined(__SC__) || \
|
||||||
|
defined(__WATCOMC__) || defined(__LCC__) || \
|
||||||
|
defined(__DECC) || defined(__CC_ARM)
|
||||||
|
#define SDL_INLINE __inline
|
||||||
|
#ifndef __inline__
|
||||||
|
#define __inline__ __inline
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define SDL_INLINE inline
|
||||||
|
#ifndef __inline__
|
||||||
|
#define __inline__ inline
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif /* SDL_INLINE not defined */
|
||||||
|
|
||||||
|
#ifndef SDL_FORCE_INLINE
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#define SDL_FORCE_INLINE __forceinline
|
||||||
|
#elif ( (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) )
|
||||||
|
#define SDL_FORCE_INLINE __attribute__((always_inline)) static __inline__
|
||||||
|
#else
|
||||||
|
#define SDL_FORCE_INLINE static SDL_INLINE
|
||||||
|
#endif
|
||||||
|
#endif /* SDL_FORCE_INLINE not defined */
|
||||||
|
|
||||||
|
#ifndef SDL_NORETURN
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#define SDL_NORETURN __attribute__((noreturn))
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
|
#define SDL_NORETURN __declspec(noreturn)
|
||||||
|
#else
|
||||||
|
#define SDL_NORETURN
|
||||||
|
#endif
|
||||||
|
#endif /* SDL_NORETURN not defined */
|
||||||
|
|
||||||
|
#ifdef __clang__
|
||||||
|
#if __has_feature(attribute_analyzer_noreturn)
|
||||||
|
#define SDL_ANALYZER_NORETURN __attribute__((analyzer_noreturn))
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef SDL_ANALYZER_NORETURN
|
||||||
|
#define SDL_ANALYZER_NORETURN
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Apparently this is needed by several Windows compilers */
|
||||||
|
#ifndef __MACH__
|
||||||
|
#ifndef NULL
|
||||||
|
#ifdef __cplusplus
|
||||||
|
#define NULL 0
|
||||||
|
#else
|
||||||
|
#define NULL ((void *)0)
|
||||||
|
#endif
|
||||||
|
#endif /* NULL */
|
||||||
|
#endif /* ! macOS - breaks precompiled headers */
|
||||||
|
|
||||||
|
#ifndef SDL_FALLTHROUGH
|
||||||
|
#if (defined(__cplusplus) && __cplusplus >= 201703L) || \
|
||||||
|
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202000L)
|
||||||
|
#define SDL_FALLTHROUGH [[fallthrough]]
|
||||||
|
#else
|
||||||
|
#if defined(__has_attribute) && !defined(__SUNPRO_C) && !defined(__SUNPRO_CC)
|
||||||
|
#define SDL_HAS_FALLTHROUGH __has_attribute(__fallthrough__)
|
||||||
|
#else
|
||||||
|
#define SDL_HAS_FALLTHROUGH 0
|
||||||
|
#endif /* __has_attribute */
|
||||||
|
#if SDL_HAS_FALLTHROUGH && \
|
||||||
|
((defined(__GNUC__) && __GNUC__ >= 7) || \
|
||||||
|
(defined(__clang_major__) && __clang_major__ >= 10))
|
||||||
|
#define SDL_FALLTHROUGH __attribute__((__fallthrough__))
|
||||||
|
#else
|
||||||
|
#define SDL_FALLTHROUGH do {} while (0) /* fallthrough */
|
||||||
|
#endif /* SDL_HAS_FALLTHROUGH */
|
||||||
|
#undef SDL_HAS_FALLTHROUGH
|
||||||
|
#endif /* C++17 or C2x */
|
||||||
|
#endif /* SDL_FALLTHROUGH not defined */
|
||||||
|
|
||||||
|
#ifndef SDL_NODISCARD
|
||||||
|
#if (defined(__cplusplus) && __cplusplus >= 201703L) || \
|
||||||
|
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L)
|
||||||
|
#define SDL_NODISCARD [[nodiscard]]
|
||||||
|
#elif ( (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) )
|
||||||
|
#define SDL_NODISCARD __attribute__((warn_unused_result))
|
||||||
|
#elif defined(_MSC_VER) && (_MSC_VER >= 1700)
|
||||||
|
#define SDL_NODISCARD _Check_return_
|
||||||
|
#else
|
||||||
|
#define SDL_NODISCARD
|
||||||
|
#endif /* C++17 or C23 */
|
||||||
|
#endif /* SDL_NODISCARD not defined */
|
||||||
|
|
||||||
|
#ifndef SDL_MALLOC
|
||||||
|
#if defined(__GNUC__) && (__GNUC__ >= 3)
|
||||||
|
#define SDL_MALLOC __attribute__((malloc))
|
||||||
|
/** FIXME
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
|
#define SDL_MALLOC __declspec(allocator) __desclspec(restrict)
|
||||||
|
**/
|
||||||
|
#else
|
||||||
|
#define SDL_MALLOC
|
||||||
|
#endif
|
||||||
|
#endif /* SDL_MALLOC not defined */
|
||||||
|
|
||||||
|
#ifndef SDL_ALLOC_SIZE
|
||||||
|
#if (defined(__clang__) && __clang_major__ >= 4) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))
|
||||||
|
#define SDL_ALLOC_SIZE(p) __attribute__((alloc_size(p)))
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
|
#define SDL_ALLOC_SIZE(p)
|
||||||
|
#else
|
||||||
|
#define SDL_ALLOC_SIZE(p)
|
||||||
|
#endif
|
||||||
|
#endif /* SDL_ALLOC_SIZE not defined */
|
||||||
|
|
||||||
|
#ifndef SDL_ALLOC_SIZE2
|
||||||
|
#if (defined(__clang__) && __clang_major__ >= 4) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))
|
||||||
|
#define SDL_ALLOC_SIZE2(p1, p2) __attribute__((alloc_size(p1, p2)))
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
|
#define SDL_ALLOC_SIZE2(p1, p2)
|
||||||
|
#else
|
||||||
|
#define SDL_ALLOC_SIZE2(p1, p2)
|
||||||
|
#endif
|
||||||
|
#endif /* SDL_ALLOC_SIZE2 not defined */
|
||||||
@@ -28,25 +28,14 @@
|
|||||||
#ifndef SDL_bits_h_
|
#ifndef SDL_bits_h_
|
||||||
#define SDL_bits_h_
|
#define SDL_bits_h_
|
||||||
|
|
||||||
#include <SDL2/SDL_stdinc.h>
|
#include <SDL3/SDL_stdinc.h>
|
||||||
|
|
||||||
#include <SDL2/begin_code.h>
|
#include <SDL3/SDL_begin_code.h>
|
||||||
/* Set up for C function definitions, even when using C++ */
|
/* Set up for C function definitions, even when using C++ */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_bits.h
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the index of the most significant bit. Result is undefined when called
|
|
||||||
* with 0. This operation can also be stated as "count leading zeroes" and
|
|
||||||
* "log base 2".
|
|
||||||
*
|
|
||||||
* \return the index of the most significant bit, or -1 if the value is 0.
|
|
||||||
*/
|
|
||||||
#if defined(__WATCOMC__) && defined(__386__)
|
#if defined(__WATCOMC__) && defined(__386__)
|
||||||
extern __inline int _SDL_bsr_watcom(Uint32);
|
extern __inline int _SDL_bsr_watcom(Uint32);
|
||||||
#pragma aux _SDL_bsr_watcom = \
|
#pragma aux _SDL_bsr_watcom = \
|
||||||
@@ -57,13 +46,24 @@ extern __inline int _SDL_bsr_watcom(Uint32);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use this function to get the index of the most significant (set) bit in a
|
* Get the index of the most significant (set) bit in a 32-bit number.
|
||||||
*
|
*
|
||||||
* \param x the number to find the MSB of.
|
* Result is undefined when called with 0. This operation can also be stated
|
||||||
* \returns the index of the most significant bit of x, or -1 if x is 0.
|
* 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
|
||||||
|
* embedded in the calling program and the linker and dynamic loader will not
|
||||||
|
* be able to find this function inside SDL itself).
|
||||||
|
*
|
||||||
|
* \param x the 32-bit value to examine.
|
||||||
|
* \returns the index of the most significant bit, or -1 if the value is 0.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
*/
|
*/
|
||||||
SDL_FORCE_INLINE int
|
SDL_FORCE_INLINE int SDL_MostSignificantBitIndex32(Uint32 x)
|
||||||
SDL_MostSignificantBitIndex32(Uint32 x)
|
|
||||||
{
|
{
|
||||||
#if defined(__GNUC__) && (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
|
#if defined(__GNUC__) && (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
|
||||||
/* Count Leading Zeroes builtin in GCC.
|
/* Count Leading Zeroes builtin in GCC.
|
||||||
@@ -78,10 +78,10 @@ SDL_MostSignificantBitIndex32(Uint32 x)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return _SDL_bsr_watcom(x);
|
return _SDL_bsr_watcom(x);
|
||||||
#elif defined(_MSC_VER)
|
#elif defined(_MSC_VER) && _MSC_VER >= 1400
|
||||||
unsigned long index;
|
unsigned long index;
|
||||||
if (_BitScanReverse(&index, x)) {
|
if (_BitScanReverse(&index, x)) {
|
||||||
return index;
|
return (int)index;
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
#else
|
#else
|
||||||
@@ -112,21 +112,36 @@ SDL_MostSignificantBitIndex32(Uint32 x)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_FORCE_INLINE SDL_bool
|
/**
|
||||||
SDL_HasExactlyOneBitSet32(Uint32 x)
|
* Determine if a unsigned 32-bit value has exactly one bit set.
|
||||||
|
*
|
||||||
|
* If there are no bits set (`x` is zero), or more than one bit set, this
|
||||||
|
* returns false. If any one bit is exclusively set, this returns true.
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* embedded in the calling program and the linker and dynamic loader will not
|
||||||
|
* be able to find this function inside SDL itself).
|
||||||
|
*
|
||||||
|
* \param x the 32-bit value to examine.
|
||||||
|
* \returns true if exactly one bit is set in `x`, false otherwise.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
SDL_FORCE_INLINE bool SDL_HasExactlyOneBitSet32(Uint32 x)
|
||||||
{
|
{
|
||||||
if (x && !(x & (x - 1))) {
|
if (x && !(x & (x - 1))) {
|
||||||
return SDL_TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
return SDL_FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
/* Ends C function definitions when using C++ */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#include <SDL2/close_code.h>
|
#include <SDL3/SDL_close_code.h>
|
||||||
|
|
||||||
#endif /* SDL_bits_h_ */
|
#endif /* SDL_bits_h_ */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
||||||
@@ -22,58 +22,68 @@
|
|||||||
/**
|
/**
|
||||||
* # CategoryBlendmode
|
* # CategoryBlendmode
|
||||||
*
|
*
|
||||||
* Header file declaring the SDL_BlendMode enumeration
|
* Blend modes decide how two colors will mix together. There are both
|
||||||
|
* standard modes for basic needs and a means to create custom modes,
|
||||||
|
* dictating what sort of math to do on what color components.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef SDL_blendmode_h_
|
#ifndef SDL_blendmode_h_
|
||||||
#define SDL_blendmode_h_
|
#define SDL_blendmode_h_
|
||||||
|
|
||||||
#include <SDL2/begin_code.h>
|
#include <SDL3/SDL_stdinc.h>
|
||||||
|
|
||||||
|
#include <SDL3/SDL_begin_code.h>
|
||||||
/* Set up for C function definitions, even when using C++ */
|
/* Set up for C function definitions, even when using C++ */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The blend mode used in SDL_RenderCopy() and drawing operations.
|
* A set of blend modes used in drawing operations.
|
||||||
|
*
|
||||||
|
* These predefined blend modes are supported everywhere.
|
||||||
|
*
|
||||||
|
* Additional values may be obtained from SDL_ComposeCustomBlendMode.
|
||||||
|
*
|
||||||
|
* \since This datatype is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_ComposeCustomBlendMode
|
||||||
*/
|
*/
|
||||||
typedef enum SDL_BlendMode
|
typedef Uint32 SDL_BlendMode;
|
||||||
{
|
|
||||||
SDL_BLENDMODE_NONE = 0x00000000, /**< no blending
|
|
||||||
dstRGBA = srcRGBA */
|
|
||||||
SDL_BLENDMODE_BLEND = 0x00000001, /**< alpha blending
|
|
||||||
dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA))
|
|
||||||
dstA = srcA + (dstA * (1-srcA)) */
|
|
||||||
SDL_BLENDMODE_ADD = 0x00000002, /**< additive blending
|
|
||||||
dstRGB = (srcRGB * srcA) + dstRGB
|
|
||||||
dstA = dstA */
|
|
||||||
SDL_BLENDMODE_MOD = 0x00000004, /**< color modulate
|
|
||||||
dstRGB = srcRGB * dstRGB
|
|
||||||
dstA = dstA */
|
|
||||||
SDL_BLENDMODE_MUL = 0x00000008, /**< color multiply
|
|
||||||
dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA))
|
|
||||||
dstA = dstA */
|
|
||||||
SDL_BLENDMODE_INVALID = 0x7FFFFFFF
|
|
||||||
|
|
||||||
/* Additional custom blend modes can be returned by SDL_ComposeCustomBlendMode() */
|
#define SDL_BLENDMODE_NONE 0x00000000u /**< no blending: dstRGBA = srcRGBA */
|
||||||
|
#define SDL_BLENDMODE_BLEND 0x00000001u /**< alpha blending: dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA)), dstA = srcA + (dstA * (1-srcA)) */
|
||||||
} SDL_BlendMode;
|
#define SDL_BLENDMODE_BLEND_PREMULTIPLIED 0x00000010u /**< pre-multiplied alpha blending: dstRGBA = srcRGBA + (dstRGBA * (1-srcA)) */
|
||||||
|
#define SDL_BLENDMODE_ADD 0x00000002u /**< additive blending: dstRGB = (srcRGB * srcA) + dstRGB, dstA = dstA */
|
||||||
|
#define SDL_BLENDMODE_ADD_PREMULTIPLIED 0x00000020u /**< pre-multiplied additive blending: dstRGB = srcRGB + dstRGB, dstA = dstA */
|
||||||
|
#define SDL_BLENDMODE_MOD 0x00000004u /**< color modulate: dstRGB = srcRGB * dstRGB, dstA = dstA */
|
||||||
|
#define SDL_BLENDMODE_MUL 0x00000008u /**< color multiply: dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA)), dstA = dstA */
|
||||||
|
#define SDL_BLENDMODE_INVALID 0x7FFFFFFFu
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The blend operation used when combining source and destination pixel
|
* The blend operation used when combining source and destination pixel
|
||||||
* components
|
* components.
|
||||||
|
*
|
||||||
|
* \since This enum is available since SDL 3.2.0.
|
||||||
*/
|
*/
|
||||||
typedef enum SDL_BlendOperation
|
typedef enum SDL_BlendOperation
|
||||||
{
|
{
|
||||||
SDL_BLENDOPERATION_ADD = 0x1, /**< dst + src: supported by all renderers */
|
SDL_BLENDOPERATION_ADD = 0x1, /**< dst + src: supported by all renderers */
|
||||||
SDL_BLENDOPERATION_SUBTRACT = 0x2, /**< src - dst : supported by D3D9, D3D11, OpenGL, OpenGLES */
|
SDL_BLENDOPERATION_SUBTRACT = 0x2, /**< src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan */
|
||||||
SDL_BLENDOPERATION_REV_SUBTRACT = 0x3, /**< dst - src : supported by D3D9, D3D11, OpenGL, OpenGLES */
|
SDL_BLENDOPERATION_REV_SUBTRACT = 0x3, /**< dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan */
|
||||||
SDL_BLENDOPERATION_MINIMUM = 0x4, /**< min(dst, src) : supported by D3D9, D3D11 */
|
SDL_BLENDOPERATION_MINIMUM = 0x4, /**< min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan */
|
||||||
SDL_BLENDOPERATION_MAXIMUM = 0x5 /**< max(dst, src) : supported by D3D9, D3D11 */
|
SDL_BLENDOPERATION_MAXIMUM = 0x5 /**< max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan */
|
||||||
} SDL_BlendOperation;
|
} SDL_BlendOperation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The normalized factor used to multiply pixel components
|
* The normalized factor used to multiply pixel components.
|
||||||
|
*
|
||||||
|
* The blend factors are multiplied with the pixels from a drawing operation
|
||||||
|
* (src) and the pixels from the render target (dst) before the blend
|
||||||
|
* operation. The comma-separated factors listed above are always applied in
|
||||||
|
* the component order red, green, blue, and alpha.
|
||||||
|
*
|
||||||
|
* \since This enum is available since SDL 3.2.0.
|
||||||
*/
|
*/
|
||||||
typedef enum SDL_BlendFactor
|
typedef enum SDL_BlendFactor
|
||||||
{
|
{
|
||||||
@@ -130,23 +140,16 @@ typedef enum SDL_BlendFactor
|
|||||||
* either SDL_SetRenderDrawBlendMode or SDL_SetTextureBlendMode. They will
|
* either SDL_SetRenderDrawBlendMode or SDL_SetTextureBlendMode. They will
|
||||||
* return with an error if the blend mode is not supported.
|
* return with an error if the blend mode is not supported.
|
||||||
*
|
*
|
||||||
* This list describes the support of custom blend modes for each renderer in
|
* This list describes the support of custom blend modes for each renderer.
|
||||||
* SDL 2.0.6. All renderers support the four blend modes listed in the
|
* All renderers support the four blend modes listed in the SDL_BlendMode
|
||||||
* SDL_BlendMode enumeration.
|
* enumeration.
|
||||||
*
|
*
|
||||||
* - **direct3d**: Supports all operations with all factors. However, some
|
* - **direct3d**: Supports all operations with all factors. However, some
|
||||||
* factors produce unexpected results with `SDL_BLENDOPERATION_MINIMUM` and
|
* factors produce unexpected results with `SDL_BLENDOPERATION_MINIMUM` and
|
||||||
* `SDL_BLENDOPERATION_MAXIMUM`.
|
* `SDL_BLENDOPERATION_MAXIMUM`.
|
||||||
* - **direct3d11**: Same as Direct3D 9.
|
* - **direct3d11**: Same as Direct3D 9.
|
||||||
* - **opengl**: Supports the `SDL_BLENDOPERATION_ADD` operation with all
|
* - **opengl**: Supports the `SDL_BLENDOPERATION_ADD` operation with all
|
||||||
* factors. OpenGL versions 1.1, 1.2, and 1.3 do not work correctly with SDL
|
* factors. OpenGL versions 1.1, 1.2, and 1.3 do not work correctly here.
|
||||||
* 2.0.6.
|
|
||||||
* - **opengles**: Supports the `SDL_BLENDOPERATION_ADD` operation with all
|
|
||||||
* factors. Color and alpha factors need to be the same. OpenGL ES 1
|
|
||||||
* implementation specific: May also support `SDL_BLENDOPERATION_SUBTRACT`
|
|
||||||
* and `SDL_BLENDOPERATION_REV_SUBTRACT`. May support color and alpha
|
|
||||||
* operations being different from each other. May support color and alpha
|
|
||||||
* factors being different from each other.
|
|
||||||
* - **opengles2**: Supports the `SDL_BLENDOPERATION_ADD`,
|
* - **opengles2**: Supports the `SDL_BLENDOPERATION_ADD`,
|
||||||
* `SDL_BLENDOPERATION_SUBTRACT`, `SDL_BLENDOPERATION_REV_SUBTRACT`
|
* `SDL_BLENDOPERATION_SUBTRACT`, `SDL_BLENDOPERATION_REV_SUBTRACT`
|
||||||
* operations with all factors.
|
* operations with all factors.
|
||||||
@@ -174,14 +177,16 @@ typedef enum SDL_BlendFactor
|
|||||||
* \returns an SDL_BlendMode that represents the chosen factors and
|
* \returns an SDL_BlendMode that represents the chosen factors and
|
||||||
* operations.
|
* operations.
|
||||||
*
|
*
|
||||||
* \since This function is available since SDL 2.0.6.
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_SetRenderDrawBlendMode
|
* \sa SDL_SetRenderDrawBlendMode
|
||||||
* \sa SDL_GetRenderDrawBlendMode
|
* \sa SDL_GetRenderDrawBlendMode
|
||||||
* \sa SDL_SetTextureBlendMode
|
* \sa SDL_SetTextureBlendMode
|
||||||
* \sa SDL_GetTextureBlendMode
|
* \sa SDL_GetTextureBlendMode
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC SDL_BlendMode SDLCALL SDL_ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor,
|
extern SDL_DECLSPEC SDL_BlendMode SDLCALL SDL_ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor,
|
||||||
SDL_BlendFactor dstColorFactor,
|
SDL_BlendFactor dstColorFactor,
|
||||||
SDL_BlendOperation colorOperation,
|
SDL_BlendOperation colorOperation,
|
||||||
SDL_BlendFactor srcAlphaFactor,
|
SDL_BlendFactor srcAlphaFactor,
|
||||||
@@ -192,8 +197,6 @@ extern DECLSPEC SDL_BlendMode SDLCALL SDL_ComposeCustomBlendMode(SDL_BlendFactor
|
|||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#include <SDL2/close_code.h>
|
#include <SDL3/SDL_close_code.h>
|
||||||
|
|
||||||
#endif /* SDL_blendmode_h_ */
|
#endif /* SDL_blendmode_h_ */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
||||||
@@ -0,0 +1,519 @@
|
|||||||
|
/*
|
||||||
|
Simple DirectMedia Layer
|
||||||
|
Copyright (C) 1997-2025 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* # CategoryCamera
|
||||||
|
*
|
||||||
|
* Video capture for the SDL library.
|
||||||
|
*
|
||||||
|
* This API lets apps read input from video sources, like webcams. Camera
|
||||||
|
* devices can be enumerated, queried, and opened. Once opened, it will
|
||||||
|
* provide SDL_Surface objects as new frames of video come in. These surfaces
|
||||||
|
* can be uploaded to an SDL_Texture or processed as pixels in memory.
|
||||||
|
*
|
||||||
|
* Several platforms will alert the user if an app tries to access a camera,
|
||||||
|
* and some will present a UI asking the user if your application should be
|
||||||
|
* allowed to obtain images at all, which they can deny. A successfully opened
|
||||||
|
* camera will not provide images until permission is granted. Applications,
|
||||||
|
* after opening a camera device, can see if they were granted access by
|
||||||
|
* either polling with the SDL_GetCameraPermissionState() function, or waiting
|
||||||
|
* for an SDL_EVENT_CAMERA_DEVICE_APPROVED or SDL_EVENT_CAMERA_DEVICE_DENIED
|
||||||
|
* event. Platforms that don't have any user approval process will report
|
||||||
|
* approval immediately.
|
||||||
|
*
|
||||||
|
* Note that SDL cameras only provide video as individual frames; they will
|
||||||
|
* not provide full-motion video encoded in a movie file format, although an
|
||||||
|
* app is free to encode the acquired frames into any format it likes. It also
|
||||||
|
* does not provide audio from the camera hardware through this API; not only
|
||||||
|
* do many webcams not have microphones at all, many people--from streamers to
|
||||||
|
* people on Zoom calls--will want to use a separate microphone regardless of
|
||||||
|
* the camera. In any case, recorded audio will be available through SDL's
|
||||||
|
* audio API no matter what hardware provides the microphone.
|
||||||
|
*
|
||||||
|
* ## Camera gotchas
|
||||||
|
*
|
||||||
|
* Consumer-level camera hardware tends to take a little while to warm up,
|
||||||
|
* once the device has been opened. Generally most camera apps have some sort
|
||||||
|
* of UI to take a picture (a button to snap a pic while a preview is showing,
|
||||||
|
* some sort of multi-second countdown for the user to pose, like a photo
|
||||||
|
* booth), which puts control in the users' hands, or they are intended to
|
||||||
|
* stay on for long times (Pokemon Go, etc).
|
||||||
|
*
|
||||||
|
* It's not uncommon that a newly-opened camera will provide a couple of
|
||||||
|
* completely black frames, maybe followed by some under-exposed images. If
|
||||||
|
* taking a single frame automatically, or recording video from a camera's
|
||||||
|
* input without the user initiating it from a preview, it could be wise to
|
||||||
|
* drop the first several frames (if not the first several _seconds_ worth of
|
||||||
|
* frames!) before using images from a camera.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SDL_camera_h_
|
||||||
|
#define SDL_camera_h_
|
||||||
|
|
||||||
|
#include <SDL3/SDL_stdinc.h>
|
||||||
|
#include <SDL3/SDL_error.h>
|
||||||
|
#include <SDL3/SDL_pixels.h>
|
||||||
|
#include <SDL3/SDL_properties.h>
|
||||||
|
#include <SDL3/SDL_surface.h>
|
||||||
|
|
||||||
|
#include <SDL3/SDL_begin_code.h>
|
||||||
|
/* Set up for C function definitions, even when using C++ */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is a unique ID for a camera device for the time it is connected to the
|
||||||
|
* system, and is never reused for the lifetime of the application.
|
||||||
|
*
|
||||||
|
* If the device is disconnected and reconnected, it will get a new ID.
|
||||||
|
*
|
||||||
|
* The value 0 is an invalid ID.
|
||||||
|
*
|
||||||
|
* \since This datatype is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_GetCameras
|
||||||
|
*/
|
||||||
|
typedef Uint32 SDL_CameraID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The opaque structure used to identify an opened SDL camera.
|
||||||
|
*
|
||||||
|
* \since This struct is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
typedef struct SDL_Camera SDL_Camera;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The details of an output format for a camera device.
|
||||||
|
*
|
||||||
|
* Cameras often support multiple formats; each one will be encapsulated in
|
||||||
|
* this struct.
|
||||||
|
*
|
||||||
|
* \since This struct is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_GetCameraSupportedFormats
|
||||||
|
* \sa SDL_GetCameraFormat
|
||||||
|
*/
|
||||||
|
typedef struct SDL_CameraSpec
|
||||||
|
{
|
||||||
|
SDL_PixelFormat format; /**< Frame format */
|
||||||
|
SDL_Colorspace colorspace; /**< Frame colorspace */
|
||||||
|
int width; /**< Frame width */
|
||||||
|
int height; /**< Frame height */
|
||||||
|
int framerate_numerator; /**< Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds) */
|
||||||
|
int framerate_denominator; /**< Frame rate demoninator ((num / denom) == FPS, (denom / num) == duration in seconds) */
|
||||||
|
} SDL_CameraSpec;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The position of camera in relation to system device.
|
||||||
|
*
|
||||||
|
* \since This enum is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_GetCameraPosition
|
||||||
|
*/
|
||||||
|
typedef enum SDL_CameraPosition
|
||||||
|
{
|
||||||
|
SDL_CAMERA_POSITION_UNKNOWN,
|
||||||
|
SDL_CAMERA_POSITION_FRONT_FACING,
|
||||||
|
SDL_CAMERA_POSITION_BACK_FACING
|
||||||
|
} SDL_CameraPosition;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use this function to get the number of built-in camera drivers.
|
||||||
|
*
|
||||||
|
* This function returns a hardcoded number. This never returns a negative
|
||||||
|
* value; if there are no drivers compiled into this build of SDL, this
|
||||||
|
* function returns zero. The presence of a driver in this list does not mean
|
||||||
|
* it will function, it just means SDL is capable of interacting with that
|
||||||
|
* interface. For example, a build of SDL might have v4l2 support, but if
|
||||||
|
* there's no kernel support available, SDL's v4l2 driver would fail if used.
|
||||||
|
*
|
||||||
|
* By default, SDL tries all drivers, in its preferred order, until one is
|
||||||
|
* found to be usable.
|
||||||
|
*
|
||||||
|
* \returns the number of built-in camera drivers.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_GetCameraDriver
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC int SDLCALL SDL_GetNumCameraDrivers(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use this function to get the name of a built in camera driver.
|
||||||
|
*
|
||||||
|
* The list of camera drivers is given in the order that they are normally
|
||||||
|
* initialized by default; the drivers that seem more reasonable to choose
|
||||||
|
* first (as far as the SDL developers believe) are earlier in the list.
|
||||||
|
*
|
||||||
|
* The names of drivers are all simple, low-ASCII identifiers, like "v4l2",
|
||||||
|
* "coremedia" or "android". These never have Unicode characters, and are not
|
||||||
|
* meant to be proper names.
|
||||||
|
*
|
||||||
|
* \param index the index of the camera driver; the value ranges from 0 to
|
||||||
|
* SDL_GetNumCameraDrivers() - 1.
|
||||||
|
* \returns the name of the camera driver at the requested index, or NULL if
|
||||||
|
* an invalid index was specified.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_GetNumCameraDrivers
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC const char * SDLCALL SDL_GetCameraDriver(int index);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the name of the current camera driver.
|
||||||
|
*
|
||||||
|
* The names of drivers are all simple, low-ASCII identifiers, like "v4l2",
|
||||||
|
* "coremedia" or "android". These never have Unicode characters, and are not
|
||||||
|
* meant to be proper names.
|
||||||
|
*
|
||||||
|
* \returns the name of the current camera driver or NULL if no driver has
|
||||||
|
* been initialized.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC const char * SDLCALL SDL_GetCurrentCameraDriver(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a list of currently connected camera devices.
|
||||||
|
*
|
||||||
|
* \param count a pointer filled in with the number of cameras returned, may
|
||||||
|
* be NULL.
|
||||||
|
* \returns a 0 terminated array of camera instance IDs or NULL on failure;
|
||||||
|
* call SDL_GetError() for more information. This should be freed
|
||||||
|
* with SDL_free() when it is no longer needed.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_OpenCamera
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC SDL_CameraID * SDLCALL SDL_GetCameras(int *count);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the list of native formats/sizes a camera supports.
|
||||||
|
*
|
||||||
|
* This returns a list of all formats and frame sizes that a specific camera
|
||||||
|
* can offer. This is useful if your app can accept a variety of image formats
|
||||||
|
* and sizes and so want to find the optimal spec that doesn't require
|
||||||
|
* conversion.
|
||||||
|
*
|
||||||
|
* This function isn't strictly required; if you call SDL_OpenCamera with a
|
||||||
|
* NULL spec, SDL will choose a native format for you, and if you instead
|
||||||
|
* specify a desired format, it will transparently convert to the requested
|
||||||
|
* format on your behalf.
|
||||||
|
*
|
||||||
|
* If `count` is not NULL, it will be filled with the number of elements in
|
||||||
|
* the returned array.
|
||||||
|
*
|
||||||
|
* Note that it's legal for a camera to supply an empty list. This is what
|
||||||
|
* will happen on Emscripten builds, since that platform won't tell _anything_
|
||||||
|
* about available cameras until you've opened one, and won't even tell if
|
||||||
|
* there _is_ a camera until the user has given you permission to check
|
||||||
|
* through a scary warning popup.
|
||||||
|
*
|
||||||
|
* \param instance_id the camera device instance ID.
|
||||||
|
* \param count a pointer filled in with the number of elements in the list,
|
||||||
|
* may be NULL.
|
||||||
|
* \returns a NULL terminated array of pointers to SDL_CameraSpec or NULL on
|
||||||
|
* failure; call SDL_GetError() for more information. This is a
|
||||||
|
* single allocation that should be freed with SDL_free() when it is
|
||||||
|
* no longer needed.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_GetCameras
|
||||||
|
* \sa SDL_OpenCamera
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC SDL_CameraSpec ** SDLCALL SDL_GetCameraSupportedFormats(SDL_CameraID instance_id, int *count);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the human-readable device name for a camera.
|
||||||
|
*
|
||||||
|
* \param instance_id the camera device instance ID.
|
||||||
|
* \returns a human-readable device name 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.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_GetCameras
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC const char * SDLCALL SDL_GetCameraName(SDL_CameraID instance_id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the position of the camera in relation to the system.
|
||||||
|
*
|
||||||
|
* Most platforms will report UNKNOWN, but mobile devices, like phones, can
|
||||||
|
* often make a distinction between cameras on the front of the device (that
|
||||||
|
* points towards the user, for taking "selfies") and cameras on the back (for
|
||||||
|
* filming in the direction the user is facing).
|
||||||
|
*
|
||||||
|
* \param instance_id the camera device instance ID.
|
||||||
|
* \returns the position of the camera on the system hardware.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_GetCameras
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC SDL_CameraPosition SDLCALL SDL_GetCameraPosition(SDL_CameraID instance_id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open a video recording device (a "camera").
|
||||||
|
*
|
||||||
|
* You can open the device with any reasonable spec, and if the hardware can't
|
||||||
|
* directly support it, it will convert data seamlessly to the requested
|
||||||
|
* format. This might incur overhead, including scaling of image data.
|
||||||
|
*
|
||||||
|
* If you would rather accept whatever format the device offers, you can pass
|
||||||
|
* a NULL spec here and it will choose one for you (and you can use
|
||||||
|
* SDL_Surface's conversion/scaling functions directly if necessary).
|
||||||
|
*
|
||||||
|
* You can call SDL_GetCameraFormat() to get the actual data format if passing
|
||||||
|
* a NULL spec here. You can see the exact specs a device can support without
|
||||||
|
* conversion with SDL_GetCameraSupportedFormats().
|
||||||
|
*
|
||||||
|
* SDL will not attempt to emulate framerate; it will try to set the hardware
|
||||||
|
* to the rate closest to the requested speed, but it won't attempt to limit
|
||||||
|
* or duplicate frames artificially; call SDL_GetCameraFormat() to see the
|
||||||
|
* actual framerate of the opened the device, and check your timestamps if
|
||||||
|
* this is crucial to your app!
|
||||||
|
*
|
||||||
|
* Note that the camera is not usable until the user approves its use! On some
|
||||||
|
* platforms, the operating system will prompt the user to permit access to
|
||||||
|
* the camera, and they can choose Yes or No at that point. Until they do, the
|
||||||
|
* camera will not be usable. The app should either wait for an
|
||||||
|
* SDL_EVENT_CAMERA_DEVICE_APPROVED (or SDL_EVENT_CAMERA_DEVICE_DENIED) event,
|
||||||
|
* or poll SDL_GetCameraPermissionState() occasionally until it returns
|
||||||
|
* non-zero. On platforms that don't require explicit user approval (and
|
||||||
|
* perhaps in places where the user previously permitted access), the approval
|
||||||
|
* event might come immediately, but it might come seconds, minutes, or hours
|
||||||
|
* later!
|
||||||
|
*
|
||||||
|
* \param instance_id the camera device instance ID.
|
||||||
|
* \param spec the desired format for data the device will provide. Can be
|
||||||
|
* NULL.
|
||||||
|
* \returns an SDL_Camera object 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.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_GetCameras
|
||||||
|
* \sa SDL_GetCameraFormat
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC SDL_Camera * SDLCALL SDL_OpenCamera(SDL_CameraID instance_id, const SDL_CameraSpec *spec);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Query if camera access has been approved by the user.
|
||||||
|
*
|
||||||
|
* Cameras will not function between when the device is opened by the app and
|
||||||
|
* when the user permits access to the hardware. On some platforms, this
|
||||||
|
* presents as a popup dialog where the user has to explicitly approve access;
|
||||||
|
* on others the approval might be implicit and not alert the user at all.
|
||||||
|
*
|
||||||
|
* This function can be used to check the status of that approval. It will
|
||||||
|
* return 0 if still waiting for user response, 1 if the camera is approved
|
||||||
|
* for use, and -1 if the user denied access.
|
||||||
|
*
|
||||||
|
* Instead of polling with this function, you can wait for a
|
||||||
|
* SDL_EVENT_CAMERA_DEVICE_APPROVED (or SDL_EVENT_CAMERA_DEVICE_DENIED) event
|
||||||
|
* in the standard SDL event loop, which is guaranteed to be sent once when
|
||||||
|
* permission to use the camera is decided.
|
||||||
|
*
|
||||||
|
* If a camera is declined, there's nothing to be done but call
|
||||||
|
* SDL_CloseCamera() to dispose of it.
|
||||||
|
*
|
||||||
|
* \param camera the opened camera device to query.
|
||||||
|
* \returns -1 if user denied access to the camera, 1 if user approved access,
|
||||||
|
* 0 if no decision has been made yet.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_OpenCamera
|
||||||
|
* \sa SDL_CloseCamera
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC int SDLCALL SDL_GetCameraPermissionState(SDL_Camera *camera);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the instance ID of an opened camera.
|
||||||
|
*
|
||||||
|
* \param camera an SDL_Camera to query.
|
||||||
|
* \returns the instance ID of the specified camera on success or 0 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.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_OpenCamera
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC SDL_CameraID SDLCALL SDL_GetCameraID(SDL_Camera *camera);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the properties associated with an opened camera.
|
||||||
|
*
|
||||||
|
* \param camera the SDL_Camera obtained from SDL_OpenCamera().
|
||||||
|
* \returns a valid property ID on success or 0 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.2.0.
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetCameraProperties(SDL_Camera *camera);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the spec that a camera is using when generating images.
|
||||||
|
*
|
||||||
|
* Note that this might not be the native format of the hardware, as SDL might
|
||||||
|
* be converting to this format behind the scenes.
|
||||||
|
*
|
||||||
|
* If the system is waiting for the user to approve access to the camera, as
|
||||||
|
* some platforms require, this will return false, but this isn't necessarily
|
||||||
|
* a fatal error; you should either wait for an
|
||||||
|
* SDL_EVENT_CAMERA_DEVICE_APPROVED (or SDL_EVENT_CAMERA_DEVICE_DENIED) event,
|
||||||
|
* or poll SDL_GetCameraPermissionState() occasionally until it returns
|
||||||
|
* non-zero.
|
||||||
|
*
|
||||||
|
* \param camera opened camera device.
|
||||||
|
* \param spec the SDL_CameraSpec to be initialized by this function.
|
||||||
|
* \returns true on success or false 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.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_OpenCamera
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC bool SDLCALL SDL_GetCameraFormat(SDL_Camera *camera, SDL_CameraSpec *spec);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Acquire a frame.
|
||||||
|
*
|
||||||
|
* The frame is a memory pointer to the image data, whose size and format are
|
||||||
|
* given by the spec requested when opening the device.
|
||||||
|
*
|
||||||
|
* This is a non blocking API. If there is a frame available, a non-NULL
|
||||||
|
* surface is returned, and timestampNS will be filled with a non-zero value.
|
||||||
|
*
|
||||||
|
* Note that an error case can also return NULL, but a NULL by itself is
|
||||||
|
* normal and just signifies that a new frame is not yet available. Note that
|
||||||
|
* even if a camera device fails outright (a USB camera is unplugged while in
|
||||||
|
* use, etc), SDL will send an event separately to notify the app, but
|
||||||
|
* continue to provide blank frames at ongoing intervals until
|
||||||
|
* SDL_CloseCamera() is called, so real failure here is almost always an out
|
||||||
|
* of memory condition.
|
||||||
|
*
|
||||||
|
* After use, the frame should be released with SDL_ReleaseCameraFrame(). If
|
||||||
|
* you don't do this, the system may stop providing more video!
|
||||||
|
*
|
||||||
|
* Do not call SDL_DestroySurface() on the returned surface! It must be given
|
||||||
|
* back to the camera subsystem with SDL_ReleaseCameraFrame!
|
||||||
|
*
|
||||||
|
* If the system is waiting for the user to approve access to the camera, as
|
||||||
|
* some platforms require, this will return NULL (no frames available); you
|
||||||
|
* should either wait for an SDL_EVENT_CAMERA_DEVICE_APPROVED (or
|
||||||
|
* SDL_EVENT_CAMERA_DEVICE_DENIED) event, or poll
|
||||||
|
* SDL_GetCameraPermissionState() occasionally until it returns non-zero.
|
||||||
|
*
|
||||||
|
* \param camera opened camera device.
|
||||||
|
* \param timestampNS a pointer filled in with the frame's timestamp, or 0 on
|
||||||
|
* error. Can be NULL.
|
||||||
|
* \returns a new frame of video on success, NULL if none is currently
|
||||||
|
* available.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_ReleaseCameraFrame
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_AcquireCameraFrame(SDL_Camera *camera, Uint64 *timestampNS);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Release a frame of video acquired from a camera.
|
||||||
|
*
|
||||||
|
* Let the back-end re-use the internal buffer for camera.
|
||||||
|
*
|
||||||
|
* This function _must_ be called only on surface objects returned by
|
||||||
|
* SDL_AcquireCameraFrame(). This function should be called as quickly as
|
||||||
|
* possible after acquisition, as SDL keeps a small FIFO queue of surfaces for
|
||||||
|
* video frames; if surfaces aren't released in a timely manner, SDL may drop
|
||||||
|
* upcoming video frames from the camera.
|
||||||
|
*
|
||||||
|
* If the app needs to keep the surface for a significant time, they should
|
||||||
|
* make a copy of it and release the original.
|
||||||
|
*
|
||||||
|
* The app should not use the surface again after calling this function;
|
||||||
|
* assume the surface is freed and the pointer is invalid.
|
||||||
|
*
|
||||||
|
* \param camera opened camera device.
|
||||||
|
* \param frame the video frame surface to release.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_AcquireCameraFrame
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC void SDLCALL SDL_ReleaseCameraFrame(SDL_Camera *camera, SDL_Surface *frame);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use this function to shut down camera processing and close the camera
|
||||||
|
* device.
|
||||||
|
*
|
||||||
|
* \param camera opened camera device.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread, but no
|
||||||
|
* thread may reference `device` once this function is called.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_OpenCamera
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC void SDLCALL SDL_CloseCamera(SDL_Camera *camera);
|
||||||
|
|
||||||
|
/* Ends C function definitions when using C++ */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#include <SDL3/SDL_close_code.h>
|
||||||
|
|
||||||
|
#endif /* SDL_camera_h_ */
|
||||||
@@ -0,0 +1,331 @@
|
|||||||
|
/*
|
||||||
|
Simple DirectMedia Layer
|
||||||
|
Copyright (C) 1997-2025 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* # CategoryClipboard
|
||||||
|
*
|
||||||
|
* SDL provides access to the system clipboard, both for reading information
|
||||||
|
* from other processes and publishing information of its own.
|
||||||
|
*
|
||||||
|
* This is not just text! SDL apps can access and publish data by mimetype.
|
||||||
|
*
|
||||||
|
* ## Basic use (text)
|
||||||
|
*
|
||||||
|
* Obtaining and publishing simple text to the system clipboard is as easy as
|
||||||
|
* calling SDL_GetClipboardText() and SDL_SetClipboardText(), respectively.
|
||||||
|
* These deal with C strings in UTF-8 encoding. Data transmission and encoding
|
||||||
|
* conversion is completely managed by SDL.
|
||||||
|
*
|
||||||
|
* ## Clipboard callbacks (data other than text)
|
||||||
|
*
|
||||||
|
* Things get more complicated when the clipboard contains something other
|
||||||
|
* than text. Not only can the system clipboard contain data of any type, in
|
||||||
|
* some cases it can contain the same data in different formats! For example,
|
||||||
|
* an image painting app might let the user copy a graphic to the clipboard,
|
||||||
|
* and offers it in .BMP, .JPG, or .PNG format for other apps to consume.
|
||||||
|
*
|
||||||
|
* Obtaining clipboard data ("pasting") like this is a matter of calling
|
||||||
|
* SDL_GetClipboardData() and telling it the mimetype of the data you want.
|
||||||
|
* But how does one know if that format is available? SDL_HasClipboardData()
|
||||||
|
* can report if a specific mimetype is offered, and
|
||||||
|
* SDL_GetClipboardMimeTypes() can provide the entire list of mimetypes
|
||||||
|
* available, so the app can decide what to do with the data and what formats
|
||||||
|
* it can support.
|
||||||
|
*
|
||||||
|
* Setting the clipboard ("copying") to arbitrary data is done with
|
||||||
|
* SDL_SetClipboardData. The app does not provide the data in this call, but
|
||||||
|
* rather the mimetypes it is willing to provide and a callback function.
|
||||||
|
* During the callback, the app will generate the data. This allows massive
|
||||||
|
* data sets to be provided to the clipboard, without any data being copied
|
||||||
|
* before it is explicitly requested. More specifically, it allows an app to
|
||||||
|
* offer data in multiple formats without providing a copy of all of them
|
||||||
|
* upfront. If the app has an image that it could provide in PNG or JPG
|
||||||
|
* format, it doesn't have to encode it to either of those unless and until
|
||||||
|
* something tries to paste it.
|
||||||
|
*
|
||||||
|
* ## Primary Selection
|
||||||
|
*
|
||||||
|
* The X11 and Wayland video targets have a concept of the "primary selection"
|
||||||
|
* in addition to the usual clipboard. This is generally highlighted (but not
|
||||||
|
* explicitly copied) text from various apps. SDL offers APIs for this through
|
||||||
|
* SDL_GetPrimarySelectionText() and SDL_SetPrimarySelectionText(). SDL offers
|
||||||
|
* these APIs on platforms without this concept, too, but only so far that it
|
||||||
|
* will keep a copy of a string that the app sets for later retrieval; the
|
||||||
|
* operating system will not ever attempt to change the string externally if
|
||||||
|
* it doesn't support a primary selection.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SDL_clipboard_h_
|
||||||
|
#define SDL_clipboard_h_
|
||||||
|
|
||||||
|
#include <SDL3/SDL_stdinc.h>
|
||||||
|
#include <SDL3/SDL_error.h>
|
||||||
|
|
||||||
|
#include <SDL3/SDL_begin_code.h>
|
||||||
|
/* Set up for C function definitions, even when using C++ */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Function prototypes */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Put UTF-8 text into the clipboard.
|
||||||
|
*
|
||||||
|
* \param text the text to store in the clipboard.
|
||||||
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
|
* information.
|
||||||
|
*
|
||||||
|
* \threadsafety This function should only be called on the main thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_GetClipboardText
|
||||||
|
* \sa SDL_HasClipboardText
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC bool SDLCALL SDL_SetClipboardText(const char *text);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get UTF-8 text from the clipboard.
|
||||||
|
*
|
||||||
|
* This function returns an empty string if there is not enough memory left
|
||||||
|
* for a copy of the clipboard's content.
|
||||||
|
*
|
||||||
|
* \returns the clipboard text on success or an empty string on failure; call
|
||||||
|
* SDL_GetError() for more information. This should be freed with
|
||||||
|
* SDL_free() when it is no longer needed.
|
||||||
|
*
|
||||||
|
* \threadsafety This function should only be called on the main thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_HasClipboardText
|
||||||
|
* \sa SDL_SetClipboardText
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC char * SDLCALL SDL_GetClipboardText(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Query whether the clipboard exists and contains a non-empty text string.
|
||||||
|
*
|
||||||
|
* \returns true if the clipboard has text, or false if it does not.
|
||||||
|
*
|
||||||
|
* \threadsafety This function should only be called on the main thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_GetClipboardText
|
||||||
|
* \sa SDL_SetClipboardText
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC bool SDLCALL SDL_HasClipboardText(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Put UTF-8 text into the primary selection.
|
||||||
|
*
|
||||||
|
* \param text the text to store in the primary selection.
|
||||||
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
|
* information.
|
||||||
|
*
|
||||||
|
* \threadsafety This function should only be called on the main thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_GetPrimarySelectionText
|
||||||
|
* \sa SDL_HasPrimarySelectionText
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC bool SDLCALL SDL_SetPrimarySelectionText(const char *text);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get UTF-8 text from the primary selection.
|
||||||
|
*
|
||||||
|
* This function returns an empty string if there is not enough memory left
|
||||||
|
* for a copy of the primary selection's content.
|
||||||
|
*
|
||||||
|
* \returns the primary selection text on success or an empty string on
|
||||||
|
* failure; call SDL_GetError() for more information. This should be
|
||||||
|
* freed with SDL_free() when it is no longer needed.
|
||||||
|
*
|
||||||
|
* \threadsafety This function should only be called on the main thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_HasPrimarySelectionText
|
||||||
|
* \sa SDL_SetPrimarySelectionText
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC char * SDLCALL SDL_GetPrimarySelectionText(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Query whether the primary selection exists and contains a non-empty text
|
||||||
|
* string.
|
||||||
|
*
|
||||||
|
* \returns true if the primary selection has text, or false if it does not.
|
||||||
|
*
|
||||||
|
* \threadsafety This function should only be called on the main thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_GetPrimarySelectionText
|
||||||
|
* \sa SDL_SetPrimarySelectionText
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC bool SDLCALL SDL_HasPrimarySelectionText(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback function that will be called when data for the specified mime-type
|
||||||
|
* is requested by the OS.
|
||||||
|
*
|
||||||
|
* The callback function is called with NULL as the mime_type when the
|
||||||
|
* clipboard is cleared or new data is set. The clipboard is automatically
|
||||||
|
* cleared in SDL_Quit().
|
||||||
|
*
|
||||||
|
* \param userdata a pointer to the provided user data.
|
||||||
|
* \param mime_type the requested mime-type.
|
||||||
|
* \param size a pointer filled in with the length of the returned data.
|
||||||
|
* \returns a pointer to the data for the provided mime-type. Returning NULL
|
||||||
|
* or setting the length to 0 will cause no data to be sent to the
|
||||||
|
* "receiver". It is up to the receiver to handle this. Essentially
|
||||||
|
* returning no data is more or less undefined behavior and may cause
|
||||||
|
* breakage in receiving applications. The returned data will not be
|
||||||
|
* freed, so it needs to be retained and dealt with internally.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_SetClipboardData
|
||||||
|
*/
|
||||||
|
typedef const void *(SDLCALL *SDL_ClipboardDataCallback)(void *userdata, const char *mime_type, size_t *size);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback function that will be called when the clipboard is cleared, or when new
|
||||||
|
* data is set.
|
||||||
|
*
|
||||||
|
* \param userdata a pointer to the provided user data.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_SetClipboardData
|
||||||
|
*/
|
||||||
|
typedef void (SDLCALL *SDL_ClipboardCleanupCallback)(void *userdata);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Offer clipboard data to the OS.
|
||||||
|
*
|
||||||
|
* Tell the operating system that the application is offering clipboard data
|
||||||
|
* for each of the provided mime-types. Once another application requests the
|
||||||
|
* data the callback function will be called, allowing it to generate and
|
||||||
|
* respond with the data for the requested mime-type.
|
||||||
|
*
|
||||||
|
* The size of text data does not include any terminator, and the text does
|
||||||
|
* not need to be null-terminated (e.g., you can directly copy a portion of a
|
||||||
|
* document).
|
||||||
|
*
|
||||||
|
* \param callback a function pointer to the function that provides the
|
||||||
|
* clipboard data.
|
||||||
|
* \param cleanup a function pointer to the function that cleans up the
|
||||||
|
* clipboard data.
|
||||||
|
* \param userdata an opaque pointer that will be forwarded to the callbacks.
|
||||||
|
* \param mime_types a list of mime-types that are being offered. SDL copies the given list.
|
||||||
|
* \param num_mime_types the number of mime-types in the mime_types list.
|
||||||
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
|
* information.
|
||||||
|
*
|
||||||
|
* \threadsafety This function should only be called on the main thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_ClearClipboardData
|
||||||
|
* \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);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clear the clipboard data.
|
||||||
|
*
|
||||||
|
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||||
|
* information.
|
||||||
|
*
|
||||||
|
* \threadsafety This function should only be called on the main thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_SetClipboardData
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC bool SDLCALL SDL_ClearClipboardData(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the data from the clipboard for a given mime type.
|
||||||
|
*
|
||||||
|
* The size of text data does not include the terminator, but the text is
|
||||||
|
* guaranteed to be null-terminated.
|
||||||
|
*
|
||||||
|
* \param mime_type the mime type to read from the clipboard.
|
||||||
|
* \param size a pointer filled in with the length of the returned data.
|
||||||
|
* \returns the retrieved data buffer or NULL on failure; call SDL_GetError()
|
||||||
|
* for more information. This should be freed with SDL_free() when it
|
||||||
|
* is no longer needed.
|
||||||
|
*
|
||||||
|
* \threadsafety This function should only be called on the main thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_HasClipboardData
|
||||||
|
* \sa SDL_SetClipboardData
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC void * SDLCALL SDL_GetClipboardData(const char *mime_type, size_t *size);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Query whether there is data in the clipboard for the provided mime type.
|
||||||
|
*
|
||||||
|
* \param mime_type the mime type to check for data.
|
||||||
|
* \returns true if data exists in the clipboard for the provided mime type,
|
||||||
|
* false if it does not.
|
||||||
|
*
|
||||||
|
* \threadsafety This function should only be called on the main thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_SetClipboardData
|
||||||
|
* \sa SDL_GetClipboardData
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC bool SDLCALL SDL_HasClipboardData(const char *mime_type);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve the list of mime types available in the clipboard.
|
||||||
|
*
|
||||||
|
* \param num_mime_types a pointer filled with the number of mime types, may
|
||||||
|
* be NULL.
|
||||||
|
* \returns a null-terminated array of strings with mime types, or NULL on
|
||||||
|
* failure; call SDL_GetError() for more information. This should be
|
||||||
|
* freed with SDL_free() when it is no longer needed.
|
||||||
|
*
|
||||||
|
* \threadsafety This function should only be called on the main thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_SetClipboardData
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC char ** SDLCALL SDL_GetClipboardMimeTypes(size_t *num_mime_types);
|
||||||
|
|
||||||
|
/* Ends C function definitions when using C++ */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#include <SDL3/SDL_close_code.h>
|
||||||
|
|
||||||
|
#endif /* SDL_clipboard_h_ */
|
||||||
@@ -19,15 +19,16 @@
|
|||||||
3. This notice may not be removed or altered from any source distribution.
|
3. This notice may not be removed or altered from any source distribution.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* \file close_code.h
|
* This file reverses the effects of SDL_begin_code.h and should be included
|
||||||
|
* after you finish any function and structure declarations in your headers.
|
||||||
*
|
*
|
||||||
* This file reverses the effects of begin_code.h and should be included
|
* SDL's headers use this; applications generally should not include this
|
||||||
* after you finish any function and structure declarations in your headers
|
* header directly.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef SDL_begin_code_h
|
#ifndef SDL_begin_code_h
|
||||||
#error close_code.h included without matching begin_code.h
|
#error SDL_close_code.h included without matching SDL_begin_code.h
|
||||||
#endif
|
#endif
|
||||||
#undef SDL_begin_code_h
|
#undef SDL_begin_code_h
|
||||||
|
|
||||||
@@ -18,3 +18,5 @@
|
|||||||
misrepresented as being the original software.
|
misrepresented as being the original software.
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
3. This notice may not be removed or altered from any source distribution.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Header file containing SDL's license. */
|
||||||
@@ -0,0 +1,353 @@
|
|||||||
|
/*
|
||||||
|
Simple DirectMedia Layer
|
||||||
|
Copyright (C) 1997-2025 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* WIKI CATEGORY: CPUInfo */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* # CategoryCPUInfo
|
||||||
|
*
|
||||||
|
* CPU feature detection for SDL.
|
||||||
|
*
|
||||||
|
* These functions are largely concerned with reporting if the system has
|
||||||
|
* access to various SIMD instruction sets, but also has other important info
|
||||||
|
* to share, such as system RAM size and number of logical CPU cores.
|
||||||
|
*
|
||||||
|
* CPU instruction set checks, like SDL_HasSSE() and SDL_HasNEON(), are
|
||||||
|
* available on all platforms, even if they don't make sense (an ARM processor
|
||||||
|
* will never have SSE and an x86 processor will never have NEON, for example,
|
||||||
|
* but these functions still exist and will simply return false in these
|
||||||
|
* cases).
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SDL_cpuinfo_h_
|
||||||
|
#define SDL_cpuinfo_h_
|
||||||
|
|
||||||
|
#include <SDL3/SDL_stdinc.h>
|
||||||
|
|
||||||
|
#include <SDL3/SDL_begin_code.h>
|
||||||
|
/* Set up for C function definitions, even when using C++ */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A guess for the cacheline size used for padding.
|
||||||
|
*
|
||||||
|
* Most x86 processors have a 64 byte cache line. The 64-bit PowerPC
|
||||||
|
* processors have a 128 byte cache line. We use the larger value to be
|
||||||
|
* generally safe.
|
||||||
|
*
|
||||||
|
* \since This macro is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
#define SDL_CACHELINE_SIZE 128
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the number of logical CPU cores available.
|
||||||
|
*
|
||||||
|
* \returns the total number of logical CPU cores. On CPUs that include
|
||||||
|
* technologies such as hyperthreading, the number of logical cores
|
||||||
|
* may be more than the number of physical cores.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC int SDLCALL SDL_GetNumLogicalCPUCores(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine the L1 cache line size of the CPU.
|
||||||
|
*
|
||||||
|
* This is useful for determining multi-threaded structure padding or SIMD
|
||||||
|
* prefetch sizes.
|
||||||
|
*
|
||||||
|
* \returns the L1 cache line size of the CPU, in bytes.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC int SDLCALL SDL_GetCPUCacheLineSize(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the CPU has AltiVec features.
|
||||||
|
*
|
||||||
|
* This always returns false on CPUs that aren't using PowerPC instruction
|
||||||
|
* sets.
|
||||||
|
*
|
||||||
|
* \returns true if the CPU has AltiVec features or false if not.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC bool SDLCALL SDL_HasAltiVec(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the CPU has MMX features.
|
||||||
|
*
|
||||||
|
* This always returns false on CPUs that aren't using Intel instruction sets.
|
||||||
|
*
|
||||||
|
* \returns true if the CPU has MMX features or false if not.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC bool SDLCALL SDL_HasMMX(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the CPU has SSE features.
|
||||||
|
*
|
||||||
|
* This always returns false on CPUs that aren't using Intel instruction sets.
|
||||||
|
*
|
||||||
|
* \returns true if the CPU has SSE features or false if not.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_HasSSE2
|
||||||
|
* \sa SDL_HasSSE3
|
||||||
|
* \sa SDL_HasSSE41
|
||||||
|
* \sa SDL_HasSSE42
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC bool SDLCALL SDL_HasSSE(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the CPU has SSE2 features.
|
||||||
|
*
|
||||||
|
* This always returns false on CPUs that aren't using Intel instruction sets.
|
||||||
|
*
|
||||||
|
* \returns true if the CPU has SSE2 features or false if not.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_HasSSE
|
||||||
|
* \sa SDL_HasSSE3
|
||||||
|
* \sa SDL_HasSSE41
|
||||||
|
* \sa SDL_HasSSE42
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC bool SDLCALL SDL_HasSSE2(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the CPU has SSE3 features.
|
||||||
|
*
|
||||||
|
* This always returns false on CPUs that aren't using Intel instruction sets.
|
||||||
|
*
|
||||||
|
* \returns true if the CPU has SSE3 features or false if not.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_HasSSE
|
||||||
|
* \sa SDL_HasSSE2
|
||||||
|
* \sa SDL_HasSSE41
|
||||||
|
* \sa SDL_HasSSE42
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC bool SDLCALL SDL_HasSSE3(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the CPU has SSE4.1 features.
|
||||||
|
*
|
||||||
|
* This always returns false on CPUs that aren't using Intel instruction sets.
|
||||||
|
*
|
||||||
|
* \returns true if the CPU has SSE4.1 features or false if not.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_HasSSE
|
||||||
|
* \sa SDL_HasSSE2
|
||||||
|
* \sa SDL_HasSSE3
|
||||||
|
* \sa SDL_HasSSE42
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC bool SDLCALL SDL_HasSSE41(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the CPU has SSE4.2 features.
|
||||||
|
*
|
||||||
|
* This always returns false on CPUs that aren't using Intel instruction sets.
|
||||||
|
*
|
||||||
|
* \returns true if the CPU has SSE4.2 features or false if not.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_HasSSE
|
||||||
|
* \sa SDL_HasSSE2
|
||||||
|
* \sa SDL_HasSSE3
|
||||||
|
* \sa SDL_HasSSE41
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC bool SDLCALL SDL_HasSSE42(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the CPU has AVX features.
|
||||||
|
*
|
||||||
|
* This always returns false on CPUs that aren't using Intel instruction sets.
|
||||||
|
*
|
||||||
|
* \returns true if the CPU has AVX features or false if not.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_HasAVX2
|
||||||
|
* \sa SDL_HasAVX512F
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC bool SDLCALL SDL_HasAVX(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the CPU has AVX2 features.
|
||||||
|
*
|
||||||
|
* This always returns false on CPUs that aren't using Intel instruction sets.
|
||||||
|
*
|
||||||
|
* \returns true if the CPU has AVX2 features or false if not.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_HasAVX
|
||||||
|
* \sa SDL_HasAVX512F
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC bool SDLCALL SDL_HasAVX2(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the CPU has AVX-512F (foundation) features.
|
||||||
|
*
|
||||||
|
* This always returns false on CPUs that aren't using Intel instruction sets.
|
||||||
|
*
|
||||||
|
* \returns true if the CPU has AVX-512F features or false if not.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_HasAVX
|
||||||
|
* \sa SDL_HasAVX2
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC bool SDLCALL SDL_HasAVX512F(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the CPU has ARM SIMD (ARMv6) features.
|
||||||
|
*
|
||||||
|
* This is different from ARM NEON, which is a different instruction set.
|
||||||
|
*
|
||||||
|
* This always returns false on CPUs that aren't using ARM instruction sets.
|
||||||
|
*
|
||||||
|
* \returns true if the CPU has ARM SIMD features or false if not.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_HasNEON
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC bool SDLCALL SDL_HasARMSIMD(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the CPU has NEON (ARM SIMD) features.
|
||||||
|
*
|
||||||
|
* This always returns false on CPUs that aren't using ARM instruction sets.
|
||||||
|
*
|
||||||
|
* \returns true if the CPU has ARM NEON features or false if not.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC bool SDLCALL SDL_HasNEON(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the CPU has LSX (LOONGARCH SIMD) features.
|
||||||
|
*
|
||||||
|
* This always returns false on CPUs that aren't using LOONGARCH instruction
|
||||||
|
* sets.
|
||||||
|
*
|
||||||
|
* \returns true if the CPU has LOONGARCH LSX features or false if not.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC bool SDLCALL SDL_HasLSX(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the CPU has LASX (LOONGARCH SIMD) features.
|
||||||
|
*
|
||||||
|
* This always returns false on CPUs that aren't using LOONGARCH instruction
|
||||||
|
* sets.
|
||||||
|
*
|
||||||
|
* \returns true if the CPU has LOONGARCH LASX features or false if not.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC bool SDLCALL SDL_HasLASX(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the amount of RAM configured in the system.
|
||||||
|
*
|
||||||
|
* \returns the amount of RAM configured in the system in MiB.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC int SDLCALL SDL_GetSystemRAM(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Report the alignment this system needs for SIMD allocations.
|
||||||
|
*
|
||||||
|
* This will return the minimum number of bytes to which a pointer must be
|
||||||
|
* aligned to be compatible with SIMD instructions on the current machine. For
|
||||||
|
* example, if the machine supports SSE only, it will return 16, but if it
|
||||||
|
* supports AVX-512F, it'll return 64 (etc). This only reports values for
|
||||||
|
* instruction sets SDL knows about, so if your SDL build doesn't have
|
||||||
|
* SDL_HasAVX512F(), then it might return 16 for the SSE support it sees and
|
||||||
|
* not 64 for the AVX-512 instructions that exist but SDL doesn't know about.
|
||||||
|
* Plan accordingly.
|
||||||
|
*
|
||||||
|
* \returns the alignment in bytes needed for available, known SIMD
|
||||||
|
* instructions.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_aligned_alloc
|
||||||
|
* \sa SDL_aligned_free
|
||||||
|
*/
|
||||||
|
extern SDL_DECLSPEC size_t SDLCALL SDL_GetSIMDAlignment(void);
|
||||||
|
|
||||||
|
/* Ends C function definitions when using C++ */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#include <SDL3/SDL_close_code.h>
|
||||||
|
|
||||||
|
#endif /* SDL_cpuinfo_h_ */
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user