├── .gitattributes
├── .github
└── workflows
│ └── build.yaml
├── .gitignore
├── .vscode
├── app.drawio
├── c_cpp_properties.json
├── commandbar.json
├── issues.todo
├── launch.json
├── settings.json
├── tasks.json
└── todo.todo
├── LICENSE
├── Makefile
├── README.md
├── config.ini
├── imgui.ini
├── include
├── SDL.h
├── SDL_assert.h
├── SDL_atomic.h
├── SDL_audio.h
├── SDL_bits.h
├── SDL_blendmode.h
├── SDL_clipboard.h
├── SDL_config.h
├── SDL_cpuinfo.h
├── SDL_egl.h
├── SDL_endian.h
├── SDL_error.h
├── SDL_events.h
├── SDL_filesystem.h
├── SDL_gamecontroller.h
├── SDL_gesture.h
├── SDL_guid.h
├── SDL_haptic.h
├── SDL_hidapi.h
├── SDL_hints.h
├── SDL_image.h
├── SDL_joystick.h
├── SDL_keyboard.h
├── SDL_keycode.h
├── SDL_loadso.h
├── SDL_locale.h
├── SDL_log.h
├── SDL_main.h
├── SDL_messagebox.h
├── SDL_metal.h
├── SDL_misc.h
├── SDL_mouse.h
├── SDL_mutex.h
├── SDL_name.h
├── SDL_opengl.h
├── SDL_opengl_glext.h
├── SDL_opengles.h
├── SDL_opengles2.h
├── SDL_opengles2_gl2.h
├── SDL_opengles2_gl2ext.h
├── SDL_opengles2_gl2platform.h
├── SDL_opengles2_khrplatform.h
├── SDL_pixels.h
├── SDL_platform.h
├── SDL_power.h
├── SDL_quit.h
├── SDL_rect.h
├── SDL_render.h
├── SDL_revision.h
├── SDL_rwops.h
├── SDL_scancode.h
├── SDL_sensor.h
├── SDL_shape.h
├── SDL_stdinc.h
├── SDL_surface.h
├── SDL_system.h
├── SDL_syswm.h
├── SDL_test.h
├── SDL_test_assert.h
├── SDL_test_common.h
├── SDL_test_compare.h
├── SDL_test_crc32.h
├── SDL_test_font.h
├── SDL_test_fuzzer.h
├── SDL_test_harness.h
├── SDL_test_images.h
├── SDL_test_log.h
├── SDL_test_md5.h
├── SDL_test_memory.h
├── SDL_test_random.h
├── SDL_thread.h
├── SDL_timer.h
├── SDL_touch.h
├── SDL_ttf.h
├── SDL_types.h
├── SDL_version.h
├── SDL_video.h
├── SDL_vulkan.h
├── begin_code.h
└── close_code.h
├── lib
├── cmake
│ ├── SDL2
│ │ ├── sdl2-config-version.cmake
│ │ └── sdl2-config.cmake
│ ├── SDL2_image
│ │ ├── sdl2_image-config-version.cmake
│ │ └── sdl2_image-config.cmake
│ └── SDL2_ttf
│ │ ├── sdl2_ttf-config-version.cmake
│ │ └── sdl2_ttf-config.cmake
├── libSDL2.a
├── libSDL2.dll.a
├── libSDL2.la
├── libSDL2_image.a
├── libSDL2_image.dll.a
├── libSDL2_image.la
├── libSDL2_test.a
├── libSDL2_test.la
├── libSDL2_ttf.a
├── libSDL2_ttf.dll.a
├── libSDL2_ttf.la
├── libSDL2main.a
├── libSDL2main.la
└── pkgconfig
│ ├── SDL2_image.pc
│ ├── SDL2_ttf.pc
│ └── sdl2.pc
├── media
├── $05151959.gif
├── commandbar.png
└── interface.png
├── res
├── atlas.aseprite
├── font
│ ├── arial.TTF
│ ├── jetbrains.ttf
│ └── pixolleta.ttf
├── icon
│ ├── icon.ico
│ ├── icon.rc
│ └── icon.res
├── logo.aseprite
├── main.aseprite
├── main_scene.aseprite
├── new_scene.aseprite
├── sprites
│ ├── Slice 1.png
│ ├── core
│ │ ├── logger.png
│ │ └── logo.png
│ ├── file.png
│ ├── file_selected.png
│ ├── folder.png
│ ├── folder_selected.png
│ ├── hover.png
│ ├── main_scene.png
│ ├── new_file.png
│ ├── ready_bar.png
│ ├── stop_bar.png
│ └── stop_vfx.png
└── spritesheet.aseprite
├── scripts_dlls
├── SDL2.dll
├── SDL2_image.dll
├── SDL2_ttf.dll
├── installer.nsi
├── modern_installer.nsi
├── setup.bat
├── ship.bat
├── update_res.bat
└── windows_installer_translations.nsi
├── settings.ini
└── src
├── Core
├── App.cpp
├── App.hpp
├── Assert.h
├── DataLoader.cpp
├── DataLoader.hpp
├── IniHandler.cpp
├── IniHandler.hpp
└── main.cpp
├── Entity
├── Enemy.cpp
├── Enemy.hpp
├── Entity.cpp
├── Entity.hpp
├── FileEntity.cpp
└── FileEntity.hpp
├── ImGui
├── imconfig.h
├── imgui.cpp
├── imgui.h
├── imgui_demo.cpp
├── imgui_draw.cpp
├── imgui_impl_sdl.cpp
├── imgui_impl_sdl.h
├── imgui_impl_sdlrenderer.cpp
├── imgui_impl_sdlrenderer.h
├── imgui_internal.h
├── imgui_tables.cpp
├── imgui_widgets.cpp
├── imstb_rectpack.h
├── imstb_textedit.h
├── imstb_truetype.h
├── tinyfiledialogs.cpp
└── tinyfiledialogs.h
├── Renderer
├── AppGui.cpp
├── AppGui.hpp
├── AssetsObject.hpp
├── Atlas.cpp
├── Atlas.hpp
├── Camera.cpp
├── Camera.hpp
├── EntityRenderer.cpp
├── EntityRenderer.hpp
├── ParticleSystem.cpp
└── ParticleSystem.hpp
├── Resources
├── AssetData.cpp
├── AssetData.hpp
├── Resources.cpp
└── Resources.hpp
├── Scenes
├── GameScene.cpp
├── GameScene.hpp
├── IntroScene.cpp
├── IntroScene.hpp
├── MainScene.cpp
├── MainScene.hpp
├── PartialScene.cpp
├── PartialScene.hpp
├── Scene.cpp
├── Scene.hpp
├── Scenes.hpp
├── TestPartialScene.cpp
└── TestPartialScene.hpp
├── Tools
├── Cooldown.cpp
├── Cooldown.hpp
├── Logger.cpp
├── Logger.hpp
├── Reader.cpp
└── Reader.hpp
└── Utils
├── Common.hpp
├── Gizmos.cpp
├── Gizmos.hpp
├── Math.cpp
├── Math.hpp
├── Mouse.cpp
├── Mouse.hpp
├── Sprite.hpp
├── inicpp.h
└── random.hpp
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/.github/workflows/build.yaml:
--------------------------------------------------------------------------------
1 | name: C++ SDL Build and Test
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 | pull_request:
8 | branches:
9 | - main
10 |
11 | jobs:
12 | build:
13 | runs-on: windows-latest
14 |
15 | steps:
16 | - name: Checkout code
17 | uses: actions/checkout@v2
18 |
19 | - name: Build application
20 | run: make compile
21 |
--------------------------------------------------------------------------------
/.vscode/app.drawio:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/.vscode/c_cpp_properties.json:
--------------------------------------------------------------------------------
1 | {
2 | "configurations": [
3 | {
4 | "name": "Win32",
5 | "includePath": [
6 | "${workspaceFolder}/**",
7 | "${workspaceFolder}/*",
8 | "${workspaceFolder}/include"
9 | ],
10 | "defines": [
11 | "_DEBUG",
12 | "UNICODE",
13 | "_UNICODE"
14 | ],
15 | "windowsSdkVersion": "10.0.19041.0",
16 | "compilerPath": "C:/mingw64/bin/g++.exe",
17 | "cStandard": "c17",
18 | "cppStandard": "c++17",
19 | "intelliSenseMode": "windows-msvc-x64",
20 | "configurationProvider": "ms-vscode.makefile-tools"
21 | }
22 | ],
23 | "version": 4
24 | }
--------------------------------------------------------------------------------
/.vscode/commandbar.json:
--------------------------------------------------------------------------------
1 | {
2 | "skipTerminateQuickPick": true,
3 | "skipSwitchToOutput": false,
4 | "skipErrorMessage": true,
5 | "commands": [
6 | {
7 | "text": "⚙️ First setup",
8 | "color": "#cfdd40",
9 | "command": "${workspaceFolder}/scripts_dlls/setup.bat",
10 | "alignment": "right",
11 | "skipTerminateQuickPick": false,
12 | "priority": 0
13 | },
14 | {
15 | "text": "🚀 Update res",
16 | "color": "#cfdd40",
17 | "command": "${workspaceFolder}/scripts_dlls/update_res.bat",
18 | "alignment": "right",
19 | "skipTerminateQuickPick": false,
20 | "priority": 0
21 | },
22 | {
23 | "text": "💼 Debug",
24 | "color": "#cfdd40",
25 | "command": "mingw32-make -j debug",
26 | "alignment": "right",
27 | "skipTerminateQuickPick": false,
28 | "priority": 0
29 | },
30 | {
31 | "text": "💼 Build",
32 | "color": "#cfdd40",
33 | "command": "${workspaceFolder}/scripts_dlls/ship.bat",
34 | "alignment": "right",
35 | "skipTerminateQuickPick": false,
36 | "priority": 0
37 | }
38 | ]
39 | }
40 |
--------------------------------------------------------------------------------
/.vscode/issues.todo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/.vscode/issues.todo
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "0.2.0",
3 | "configurations": [
4 | {
5 | "name": "(Windows) Launch",
6 | "type": "cppdbg",
7 | "request": "launch",
8 | "program": "${workspaceFolder}/.build/twitter-gif-maker_debug.exe",
9 | "args": [],
10 | "stopAtEntry": false,
11 | "sourceFileMap": {
12 | "${workspaceFolder}/.build": "${workspaceFolder}\\bin"
13 | },
14 | "cwd": "${workspaceFolder}",
15 | "environment": [{ "name": "config", "value": "Debug" }],
16 | "miDebuggerPath": "C:\\mingw64\\bin\\gdb.exe",
17 | "MIMode": "gdb",
18 | "setupCommands": [
19 | {
20 | "description": "Enable pretty-printing for gdb",
21 | "text": "-enable-pretty-printing",
22 | "ignoreFailures": true
23 | },
24 | {
25 | "description": "Set Disassembly Flavor to Intel",
26 | "text": "-gdb-set disassembly-flavor intel",
27 | "ignoreFailures": true
28 | }
29 | ],
30 | "externalConsole": false,
31 | "windows": {
32 | "program": "${workspaceFolder}/.build/twitter-gif-maker_debug.exe",
33 | "stopAtEntry": false
34 | },
35 | "preLaunchTask": "build"
36 | }
37 | ]
38 | }
39 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "files.associations": {
3 | "algorithm": "cpp",
4 | "atomic": "cpp",
5 | "bit": "cpp",
6 | "cctype": "cpp",
7 | "clocale": "cpp",
8 | "cmath": "cpp",
9 | "codecvt": "cpp",
10 | "compare": "cpp",
11 | "concepts": "cpp",
12 | "cstddef": "cpp",
13 | "cstdint": "cpp",
14 | "cstdio": "cpp",
15 | "cstdlib": "cpp",
16 | "cstring": "cpp",
17 | "ctime": "cpp",
18 | "cwchar": "cpp",
19 | "exception": "cpp",
20 | "fstream": "cpp",
21 | "functional": "cpp",
22 | "initializer_list": "cpp",
23 | "ios": "cpp",
24 | "iosfwd": "cpp",
25 | "iostream": "cpp",
26 | "istream": "cpp",
27 | "iterator": "cpp",
28 | "limits": "cpp",
29 | "list": "cpp",
30 | "locale": "cpp",
31 | "map": "cpp",
32 | "memory": "cpp",
33 | "new": "cpp",
34 | "optional": "cpp",
35 | "ostream": "cpp",
36 | "ratio": "cpp",
37 | "set": "cpp",
38 | "sstream": "cpp",
39 | "stdexcept": "cpp",
40 | "streambuf": "cpp",
41 | "string": "cpp",
42 | "system_error": "cpp",
43 | "tuple": "cpp",
44 | "type_traits": "cpp",
45 | "typeinfo": "cpp",
46 | "unordered_map": "cpp",
47 | "utility": "cpp",
48 | "vector": "cpp",
49 | "xfacet": "cpp",
50 | "xhash": "cpp",
51 | "xiosbase": "cpp",
52 | "xlocale": "cpp",
53 | "xlocbuf": "cpp",
54 | "xlocinfo": "cpp",
55 | "xlocmes": "cpp",
56 | "xlocmon": "cpp",
57 | "xlocnum": "cpp",
58 | "xloctime": "cpp",
59 | "xmemory": "cpp",
60 | "xstddef": "cpp",
61 | "xstring": "cpp",
62 | "xtr1common": "cpp",
63 | "xtree": "cpp",
64 | "xutility": "cpp",
65 | "filesystem": "cpp",
66 | "array": "cpp",
67 | "mutex": "cpp",
68 | "regex": "cpp",
69 | "stop_token": "cpp",
70 | "thread": "cpp",
71 | "charconv": "cpp",
72 | "format": "cpp",
73 | "chrono": "cpp",
74 | "forward_list": "cpp",
75 | "iomanip": "cpp",
76 | "random": "cpp",
77 | "*.tcc": "cpp",
78 | "cstdarg": "cpp",
79 | "cwctype": "cpp",
80 | "deque": "cpp",
81 | "memory_resource": "cpp",
82 | "numeric": "cpp",
83 | "string_view": "cpp",
84 | "numbers": "cpp",
85 | "span": "cpp",
86 | "cinttypes": "cpp",
87 | "variant": "cpp",
88 | "semaphore": "cpp"
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0.0",
3 | "tasks": [
4 | {
5 | "label": "build",
6 | "type": "shell",
7 | "command": "mingw32-make",
8 | "args": ["-j", "debug", "DEBUG=true"],
9 | "group": "build",
10 | "problemMatcher": []
11 | },
12 | {
13 | "type": "cppbuild",
14 | "label": "C/C++: g++.exe build active file",
15 | "command": "C:/mingw64/bin/g++.exe",
16 | "args": [
17 | "-fdiagnostics-color=always",
18 | "-g",
19 | "${file}",
20 | "-o",
21 | "${fileDirname}\\${fileBasenameNoExtension}.exe"
22 | ],
23 | "options": {
24 | "cwd": "C:/mingw64/bin"
25 | },
26 | "problemMatcher": ["$gcc"],
27 | "group": {
28 | "kind": "build",
29 | "isDefault": true
30 | },
31 | "detail": "Task generated by Debugger."
32 | }
33 | ]
34 | }
35 |
--------------------------------------------------------------------------------
/.vscode/todo.todo:
--------------------------------------------------------------------------------
1 | - App logo/visuals
2 | - Tinker the logo @done
3 | - Create the logo @done
4 | - File image for the drag and drop menu @done
5 | - Folder image for the destination menu @done
6 | - Export all the single assets in a spritesheet @done
7 | - Animation for the ready/stop state @done
8 | - Button to remove the selected file @done
9 | - Convert button @done
10 |
11 | - App architecture
12 | - Fix the .dlls for release @done
13 | - Fonts cleanup @done
14 |
15 | - App features
16 | - Button to select the file @done
17 | - Button to start the convert @done
18 | - Button to remove the current file @done
19 | - Show file name in the drag and drop menu @done
20 | - Show folder name in the dest menu like parent\\folder @done
21 | - Stop the program from working while converting @done
22 | - Change app name @done
23 | - Create and change icon for the app @done
24 |
25 | - App last touches
26 | - Features new screenshot
27 | - GIF
28 | - Link the badges to the repo
29 | - Write some tests to do
30 | - Clean the repo
31 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2024 Gustavo Domingues
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | # set the App name
2 | NAME = twitter-gif-maker
3 | # set compiler
4 | CC = g++ -std=c++17
5 | # set all the files needed
6 | #CPP = .\src\Entity/*.cpp .\src\Scenes/*.cpp
7 | # imgui dependencies
8 | BIN = bin/*.o
9 | DEBUG_FLAGS = -DF_ENABLE_ASSERTS -DF_ENABLE_DEBUG
10 |
11 | bin_dir:
12 | mkdir bin
13 |
14 | imgui_o: $(patsubst src/ImGui/%.cpp,bin/%.o,$(wildcard src/ImGui/*.cpp))
15 | app_o: $(patsubst src/Core/%.cpp,bin/%.o,$(wildcard src/Core/*.cpp))
16 | entity_o : $(patsubst src/Entity/%.cpp,bin/%.o,$(wildcard src/Entity/*.cpp))
17 | renderer_o : $(patsubst src/Renderer/%.cpp,bin/%.o,$(wildcard src/Renderer/*.cpp))
18 | resources_o : $(patsubst src/Resources/%.cpp,bin/%.o,$(wildcard src/Resources/*.cpp))
19 | scenes_o : $(patsubst src/Scenes/%.cpp,bin/%.o,$(wildcard src/Scenes/*.cpp))
20 | tools_o : $(patsubst src/Tools/%.cpp,bin/%.o,$(wildcard src/Tools/*.cpp))
21 | utils_o : $(patsubst src/Utils/%.cpp,bin/%.o,$(wildcard src/Utils/*.cpp))
22 |
23 | # Rule to build all .cpp files in the src/ImGui folder
24 | bin/%.o: src/ImGui/%.cpp
25 | $(CC) $(if $(filter true,$(DEBUG)),-g $(DEBUG_FLAGS)) -Iinclude -Iinclude/sdl -Iinclude/headers -Llib -c $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $< -o $@
26 |
27 | bin/%.o: src/Core/%.cpp
28 | $(CC) $(if $(filter true,$(DEBUG)),-g $(DEBUG_FLAGS)) -Iinclude -Iinclude/sdl -Iinclude/headers -Llib -c $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $< -o $@
29 |
30 | bin/%.o: src/Entity/%.cpp
31 | $(CC) $(if $(filter true,$(DEBUG)),-g $(DEBUG_FLAGS)) -Iinclude -Iinclude/sdl -Iinclude/headers -Llib -c $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $< -o $@
32 |
33 | bin/%.o: src/Renderer/%.cpp
34 | $(CC) $(if $(filter true,$(DEBUG)),-g $(DEBUG_FLAGS)) -Iinclude -Iinclude/sdl -Iinclude/headers -Llib -c $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $< -o $@
35 |
36 | bin/%.o: src/Resources/%.cpp
37 | $(CC) $(if $(filter true,$(DEBUG)),-g $(DEBUG_FLAGS)) -Iinclude -Iinclude/sdl -Iinclude/headers -Llib -c $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $< -o $@
38 |
39 | bin/%.o: src/Scenes/%.cpp
40 | $(CC) $(if $(filter true,$(DEBUG)),-g $(DEBUG_FLAGS)) -Iinclude -Iinclude/sdl -Iinclude/headers -Llib -c $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $< -o $@
41 |
42 | bin/%.o: src/Tools/%.cpp
43 | $(CC) $(if $(filter true,$(DEBUG)),-g $(DEBUG_FLAGS)) -Iinclude -Iinclude/sdl -Iinclude/headers -Llib -c $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $< -o $@
44 |
45 | bin/%.o: src/Utils/%.cpp
46 | $(CC) $(if $(filter true,$(DEBUG)),-g $(DEBUG_FLAGS)) -Iinclude -Iinclude/sdl -Iinclude/headers -Llib -c $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $< -o $@
47 |
48 | debug: imgui_o app_o entity_o renderer_o resources_o scenes_o tools_o utils_o
49 | ${CC} -g -Wall -static-libstdc++ -static-libgcc -Iinclude -Iinclude/sdl -Iinclude/headers -Llib -o .build/${NAME}_debug.exe ${BIN} res/icon/icon.res -lstdc++fs -lmingw32 -lSDL2main -lSDL2 -lSDL2_image -lSDL2_ttf -lole32 -mwindows -mconsole
50 |
51 | build: imgui_o app_o entity_o renderer_o resources_o scenes_o tools_o utils_o
52 | ${CC} -s -finline-functions -flto -static-libstdc++ -static-libgcc -Iinclude -Iinclude/sdl -Iinclude/headers -Llib -o .release/${NAME}.exe ${BIN} res/icon/icon.res -lstdc++fs -lmingw32 -lSDL2main -lSDL2 -lSDL2_image -lSDL2_ttf -lole32 -mwindows -O2
53 |
54 | compile: bin_dir imgui_o app_o entity_o renderer_o resources_o scenes_o tools_o utils_o
55 | ${CC} -Wall -static-libstdc++ -static-libgcc -Iinclude -Iinclude/sdl -Iinclude/headers -Llib -o ${NAME}_debug ${BIN} res/icon/icon.res -lstdc++fs -lmingw32 -lSDL2main -lSDL2 -lSDL2_image -lSDL2_ttf -lole32 -mwindows -mconsole
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | X-Gif-Maker
6 |
7 |
8 |
9 | 
10 | 
11 |
12 |
13 |
14 | _Turn your videos into GIFs in a snap! Customize settings to shrink file sizes, suitable for sharing on social media platforms._
15 |
16 | ## Introduction
17 |
18 | This is a revamped version of my [Twitter-Gif-Maker Tool](https://github.com/bigasdev/Twitter-Gif-Maker), which I originally created a while back to support my game development posts on Twitter.
19 |
20 | The purpose of this project was to refine and test my work-in-progress framework called Fortress, and to optimize the tool with an elegant interface for easier usability.
21 |
22 |
23 |
24 | This gif was created with X-Gif-Maker!
25 |
26 |
27 | ## Features
28 |
29 |
30 |
31 | - Straightforward usage: simply drag and drop your file or select it to convert it to a .gif format, saving it to any folder.
32 | - Options to adjust your .gif quality and width.
33 | - Shortcut keys provided for all actions for quick iterations.
34 | - Utilizes multithreading to prevent the program from becoming unresponsive during video conversion.
35 | - Beautiful pixel-art UI.
36 |
37 | ## Feedback
38 |
39 | Feel free to send feedback on [Twitter](https://x.com/bigasdev) or file an issue. Feature requests are always welcome.
40 |
41 | If there's anything you'd like to chat about, please feel free to message me at [Discord]()!
42 |
43 | ## Build Process
44 |
45 | You can grab the tool from the Releases section. However if you prefer to check the source code and compile it yourself its pretty simple.
46 |
47 | Currently, the tool is only compatible with Windows. If you are using Windows, ensure that you have [gcc 13.2.0+](https://gcc.gnu.org/gcc-13/) installed.
48 |
49 | After cloning the repository, execute the setup.bat file located in the scripts_dlls folder to configure your .debug and .release folders with the necessary DLLs and resources.
50 |
51 | The SDL and other libraries I use are included in the source code, so you only need to run the following commands to build from the Makefile:
52 |
53 | ```
54 | mingw32-make -j debug
55 | or
56 | mingw32-make release DEBUG=false
57 | ```
58 |
59 | For the release version, I recommend utilizing the **ship.bat** located within the _scripts_dlls folder_, which generates the complete .release folder for you.
60 |
61 | Following the release compilation, you can locate the **modern_installer.nsi** file inside the _scripts_dlls_ folder, which allows you to generate a nice NSIS installer.
62 |
63 | For VSCode users the project has a [commandbar](https://marketplace.visualstudio.com/items?itemName=gsppvo.vscode-commandbar) setup.
64 |
65 |
66 | ## Acknowledgments
67 |
68 | A huge thanks to [NabiKAZ](https://github.com/NabiKAZ) for creating [video2gif](https://github.com/NabiKAZ/video2gif?tab=readme-ov-file), which enables this quick and easy GIF conversion.
69 |
70 | And of course, thanks to the [FFmpeg project](https://github.com/FFmpeg/FFmpeg)
71 |
--------------------------------------------------------------------------------
/config.ini:
--------------------------------------------------------------------------------
1 | [ConvertOneButton]
2 | fileName=config.ini
3 | name=ConvertOneButton
4 | relative_name=null
5 | relative_x=583
6 | relative_y=252
7 | [ConvertionState]
8 | fileName=config.ini
9 | name=ConvertionState
10 | relative_name=null
11 | relative_x=352
12 | relative_y=17
13 | [FileName]
14 | fileName=config.ini
15 | name=FileName
16 | relative_name=null
17 | relative_x=40
18 | relative_y=298
19 | [FolderName]
20 | fileName=config.ini
21 | name=FolderName
22 | relative_name=null
23 | relative_x=562
24 | relative_y=145
25 | [PressE]
26 | fileName=config.ini
27 | name=PressE
28 | relative_name=null
29 | relative_x=70
30 | relative_y=315
31 | [PressF]
32 | fileName=config.ini
33 | name=PressF
34 | relative_name=null
35 | relative_x=590
36 | relative_y=165
37 | [RemoveFile]
38 | fileName=config.ini
39 | name=RemoveFile
40 | relative_name=null
41 | relative_x=115
42 | relative_y=161
43 | [SelectFile]
44 | fileName=config.ini
45 | name=SelectFile
46 | relative_name=null
47 | relative_x=31
48 | relative_y=305
49 | [SelectFolder]
50 | fileName=config.ini
51 | name=SelectFolder
52 | relative_name=null
53 | relative_x=650
54 | relative_y=100
55 | [SpriteTest]
56 | fileName=config.ini
57 | name=SpriteTest
58 | relative_name=null
59 | relative_x=8
60 | relative_y=16
61 | [VideoSettings]
62 | fileName=config.ini
63 | name=VideoSettings
64 | relative_name=null
65 | relative_x=340
66 | relative_y=160
67 | [config]
68 | lastWriteTime=-4720830621000000000
69 | [file]
70 | fileName=config.ini
71 | name=file
72 | relative_name=null
73 | relative_x=122
74 | relative_y=160
75 | [folder]
76 | fileName=config.ini
77 | name=folder
78 | relative_name=null
79 | relative_x=640
80 | relative_y=95
81 | [ready_bar]
82 | fileName=config.ini
83 | name=ready_bar
84 | relative_name=null
85 | relative_x=0
86 | relative_y=0
87 |
--------------------------------------------------------------------------------
/imgui.ini:
--------------------------------------------------------------------------------
1 | [Window][Debug##Default]
2 | Pos=60,60
3 | Size=400,400
4 | Collapsed=0
5 |
6 | [Window][Main Scene]
7 | Pos=250,460
8 | Size=202,32
9 | Collapsed=0
10 |
11 | [Window][Status Bar UI]
12 | Pos=0,364
13 | Size=804,32
14 | Collapsed=0
15 |
16 | [Window][Video Settings]
17 | Pos=340,160
18 | Size=200,600
19 | Collapsed=0
20 |
21 |
--------------------------------------------------------------------------------
/include/SDL_bits.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2023 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_bits.h
24 | *
25 | * Functions for fiddling with bits and bitmasks.
26 | */
27 |
28 | #ifndef SDL_bits_h_
29 | #define SDL_bits_h_
30 |
31 | #include "SDL_stdinc.h"
32 |
33 | #include "begin_code.h"
34 | /* Set up for C function definitions, even when using C++ */
35 | #ifdef __cplusplus
36 | extern "C" {
37 | #endif
38 |
39 | /**
40 | * \file SDL_bits.h
41 | */
42 |
43 | /**
44 | * Get the index of the most significant bit. Result is undefined when called
45 | * with 0. This operation can also be stated as "count leading zeroes" and
46 | * "log base 2".
47 | *
48 | * \return the index of the most significant bit, or -1 if the value is 0.
49 | */
50 | #if defined(__WATCOMC__) && defined(__386__)
51 | extern __inline int _SDL_bsr_watcom(Uint32);
52 | #pragma aux _SDL_bsr_watcom = \
53 | "bsr eax, eax" \
54 | parm [eax] nomemory \
55 | value [eax] \
56 | modify exact [eax] nomemory;
57 | #endif
58 |
59 | SDL_FORCE_INLINE int
60 | SDL_MostSignificantBitIndex32(Uint32 x)
61 | {
62 | #if defined(__GNUC__) && (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
63 | /* Count Leading Zeroes builtin in GCC.
64 | * http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/Other-Builtins.html
65 | */
66 | if (x == 0) {
67 | return -1;
68 | }
69 | return 31 - __builtin_clz(x);
70 | #elif defined(__WATCOMC__) && defined(__386__)
71 | if (x == 0) {
72 | return -1;
73 | }
74 | return _SDL_bsr_watcom(x);
75 | #elif defined(_MSC_VER)
76 | unsigned long index;
77 | if (_BitScanReverse(&index, x)) {
78 | return index;
79 | }
80 | return -1;
81 | #else
82 | /* Based off of Bit Twiddling Hacks by Sean Eron Anderson
83 | * , released in the public domain.
84 | * http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog
85 | */
86 | const Uint32 b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000};
87 | const int S[] = {1, 2, 4, 8, 16};
88 |
89 | int msbIndex = 0;
90 | int i;
91 |
92 | if (x == 0) {
93 | return -1;
94 | }
95 |
96 | for (i = 4; i >= 0; i--)
97 | {
98 | if (x & b[i])
99 | {
100 | x >>= S[i];
101 | msbIndex |= S[i];
102 | }
103 | }
104 |
105 | return msbIndex;
106 | #endif
107 | }
108 |
109 | SDL_FORCE_INLINE SDL_bool
110 | SDL_HasExactlyOneBitSet32(Uint32 x)
111 | {
112 | if (x && !(x & (x - 1))) {
113 | return SDL_TRUE;
114 | }
115 | return SDL_FALSE;
116 | }
117 |
118 | /* Ends C function definitions when using C++ */
119 | #ifdef __cplusplus
120 | }
121 | #endif
122 | #include "close_code.h"
123 |
124 | #endif /* SDL_bits_h_ */
125 |
126 | /* vi: set ts=4 sw=4 expandtab: */
127 |
--------------------------------------------------------------------------------
/include/SDL_clipboard.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2023 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_clipboard.h
24 | *
25 | * Include file for SDL clipboard handling
26 | */
27 |
28 | #ifndef SDL_clipboard_h_
29 | #define SDL_clipboard_h_
30 |
31 | #include "SDL_stdinc.h"
32 |
33 | #include "begin_code.h"
34 | /* Set up for C function definitions, even when using C++ */
35 | #ifdef __cplusplus
36 | extern "C" {
37 | #endif
38 |
39 | /* Function prototypes */
40 |
41 | /**
42 | * Put UTF-8 text into the clipboard.
43 | *
44 | * \param text the text to store in the clipboard
45 | * \returns 0 on success or a negative error code on failure; call
46 | * SDL_GetError() for more information.
47 | *
48 | * \since This function is available since SDL 2.0.0.
49 | *
50 | * \sa SDL_GetClipboardText
51 | * \sa SDL_HasClipboardText
52 | */
53 | extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text);
54 |
55 | /**
56 | * Get UTF-8 text from the clipboard, which must be freed with SDL_free().
57 | *
58 | * This functions returns empty string if there was not enough memory left for
59 | * a copy of the clipboard's content.
60 | *
61 | * \returns the clipboard text on success or an empty string on failure; call
62 | * SDL_GetError() for more information. Caller must call SDL_free()
63 | * on the returned pointer when done with it (even if there was an
64 | * error).
65 | *
66 | * \since This function is available since SDL 2.0.0.
67 | *
68 | * \sa SDL_HasClipboardText
69 | * \sa SDL_SetClipboardText
70 | */
71 | extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void);
72 |
73 | /**
74 | * Query whether the clipboard exists and contains a non-empty text string.
75 | *
76 | * \returns SDL_TRUE if the clipboard has text, or SDL_FALSE if it does not.
77 | *
78 | * \since This function is available since SDL 2.0.0.
79 | *
80 | * \sa SDL_GetClipboardText
81 | * \sa SDL_SetClipboardText
82 | */
83 | extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void);
84 |
85 | /**
86 | * Put UTF-8 text into the primary selection.
87 | *
88 | * \param text the text to store in the primary selection
89 | * \returns 0 on success or a negative error code on failure; call
90 | * SDL_GetError() for more information.
91 | *
92 | * \since This function is available since SDL 2.26.0.
93 | *
94 | * \sa SDL_GetPrimarySelectionText
95 | * \sa SDL_HasPrimarySelectionText
96 | */
97 | extern DECLSPEC int SDLCALL SDL_SetPrimarySelectionText(const char *text);
98 |
99 | /**
100 | * Get UTF-8 text from the primary selection, which must be freed with
101 | * SDL_free().
102 | *
103 | * This functions returns empty string if there was not enough memory left for
104 | * a copy of the primary selection's content.
105 | *
106 | * \returns the primary selection text on success or an empty string on
107 | * failure; call SDL_GetError() for more information. Caller must
108 | * call SDL_free() on the returned pointer when done with it (even if
109 | * there was an error).
110 | *
111 | * \since This function is available since SDL 2.26.0.
112 | *
113 | * \sa SDL_HasPrimarySelectionText
114 | * \sa SDL_SetPrimarySelectionText
115 | */
116 | extern DECLSPEC char * SDLCALL SDL_GetPrimarySelectionText(void);
117 |
118 | /**
119 | * Query whether the primary selection exists and contains a non-empty text
120 | * string.
121 | *
122 | * \returns SDL_TRUE if the primary selection has text, or SDL_FALSE if it
123 | * does not.
124 | *
125 | * \since This function is available since SDL 2.26.0.
126 | *
127 | * \sa SDL_GetPrimarySelectionText
128 | * \sa SDL_SetPrimarySelectionText
129 | */
130 | extern DECLSPEC SDL_bool SDLCALL SDL_HasPrimarySelectionText(void);
131 |
132 |
133 | /* Ends C function definitions when using C++ */
134 | #ifdef __cplusplus
135 | }
136 | #endif
137 | #include "close_code.h"
138 |
139 | #endif /* SDL_clipboard_h_ */
140 |
141 | /* vi: set ts=4 sw=4 expandtab: */
142 |
--------------------------------------------------------------------------------
/include/SDL_error.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2023 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_error.h
24 | *
25 | * Simple error message routines for SDL.
26 | */
27 |
28 | #ifndef SDL_error_h_
29 | #define SDL_error_h_
30 |
31 | #include "SDL_stdinc.h"
32 |
33 | #include "begin_code.h"
34 | /* Set up for C function definitions, even when using C++ */
35 | #ifdef __cplusplus
36 | extern "C" {
37 | #endif
38 |
39 | /* Public functions */
40 |
41 |
42 | /**
43 | * Set the SDL error message for the current thread.
44 | *
45 | * Calling this function will replace any previous error message that was set.
46 | *
47 | * This function always returns -1, since SDL frequently uses -1 to signify an
48 | * failing result, leading to this idiom:
49 | *
50 | * ```c
51 | * if (error_code) {
52 | * return SDL_SetError("This operation has failed: %d", error_code);
53 | * }
54 | * ```
55 | *
56 | * \param fmt a printf()-style message format string
57 | * \param ... additional parameters matching % tokens in the `fmt` string, if
58 | * any
59 | * \returns always -1.
60 | *
61 | * \since This function is available since SDL 2.0.0.
62 | *
63 | * \sa SDL_ClearError
64 | * \sa SDL_GetError
65 | */
66 | extern DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
67 |
68 | /**
69 | * Retrieve a message about the last error that occurred on the current
70 | * thread.
71 | *
72 | * It is possible for multiple errors to occur before calling SDL_GetError().
73 | * Only the last error is returned.
74 | *
75 | * The message is only applicable when an SDL function has signaled an error.
76 | * You must check the return values of SDL function calls to determine when to
77 | * appropriately call SDL_GetError(). You should *not* use the results of
78 | * SDL_GetError() to decide if an error has occurred! Sometimes SDL will set
79 | * an error string even when reporting success.
80 | *
81 | * SDL will *not* clear the error string for successful API calls. You *must*
82 | * check return values for failure cases before you can assume the error
83 | * string applies.
84 | *
85 | * Error strings are set per-thread, so an error set in a different thread
86 | * will not interfere with the current thread's operation.
87 | *
88 | * The returned string is internally allocated and must not be freed by the
89 | * application.
90 | *
91 | * \returns a message with information about the specific error that occurred,
92 | * or an empty string if there hasn't been an error message set since
93 | * the last call to SDL_ClearError(). The message is only applicable
94 | * when an SDL function has signaled an error. You must check the
95 | * return values of SDL function calls to determine when to
96 | * appropriately call SDL_GetError().
97 | *
98 | * \since This function is available since SDL 2.0.0.
99 | *
100 | * \sa SDL_ClearError
101 | * \sa SDL_SetError
102 | */
103 | extern DECLSPEC const char *SDLCALL SDL_GetError(void);
104 |
105 | /**
106 | * Get the last error message that was set for the current thread.
107 | *
108 | * This allows the caller to copy the error string into a provided buffer, but
109 | * otherwise operates exactly the same as SDL_GetError().
110 | *
111 | * \param errstr A buffer to fill with the last error message that was set for
112 | * the current thread
113 | * \param maxlen The size of the buffer pointed to by the errstr parameter
114 | * \returns the pointer passed in as the `errstr` parameter.
115 | *
116 | * \since This function is available since SDL 2.0.14.
117 | *
118 | * \sa SDL_GetError
119 | */
120 | extern DECLSPEC char * SDLCALL SDL_GetErrorMsg(char *errstr, int maxlen);
121 |
122 | /**
123 | * Clear any previous error message for this thread.
124 | *
125 | * \since This function is available since SDL 2.0.0.
126 | *
127 | * \sa SDL_GetError
128 | * \sa SDL_SetError
129 | */
130 | extern DECLSPEC void SDLCALL SDL_ClearError(void);
131 |
132 | /**
133 | * \name Internal error functions
134 | *
135 | * \internal
136 | * Private error reporting function - used internally.
137 | */
138 | /* @{ */
139 | #define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM)
140 | #define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED)
141 | #define SDL_InvalidParamError(param) SDL_SetError("Parameter '%s' is invalid", (param))
142 | typedef enum
143 | {
144 | SDL_ENOMEM,
145 | SDL_EFREAD,
146 | SDL_EFWRITE,
147 | SDL_EFSEEK,
148 | SDL_UNSUPPORTED,
149 | SDL_LASTERROR
150 | } SDL_errorcode;
151 | /* SDL_Error() unconditionally returns -1. */
152 | extern DECLSPEC int SDLCALL SDL_Error(SDL_errorcode code);
153 | /* @} *//* Internal error functions */
154 |
155 | /* Ends C function definitions when using C++ */
156 | #ifdef __cplusplus
157 | }
158 | #endif
159 | #include "close_code.h"
160 |
161 | #endif /* SDL_error_h_ */
162 |
163 | /* vi: set ts=4 sw=4 expandtab: */
164 |
--------------------------------------------------------------------------------
/include/SDL_gesture.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2023 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_gesture.h
24 | *
25 | * Include file for SDL gesture event handling.
26 | */
27 |
28 | #ifndef SDL_gesture_h_
29 | #define SDL_gesture_h_
30 |
31 | #include "SDL_stdinc.h"
32 | #include "SDL_error.h"
33 | #include "SDL_video.h"
34 |
35 | #include "SDL_touch.h"
36 |
37 |
38 | #include "begin_code.h"
39 | /* Set up for C function definitions, even when using C++ */
40 | #ifdef __cplusplus
41 | extern "C" {
42 | #endif
43 |
44 | typedef Sint64 SDL_GestureID;
45 |
46 | /* Function prototypes */
47 |
48 | /**
49 | * Begin recording a gesture on a specified touch device or all touch devices.
50 | *
51 | * If the parameter `touchId` is -1 (i.e., all devices), this function will
52 | * always return 1, regardless of whether there actually are any devices.
53 | *
54 | * \param touchId the touch device id, or -1 for all touch devices
55 | * \returns 1 on success or 0 if the specified device could not be found.
56 | *
57 | * \since This function is available since SDL 2.0.0.
58 | *
59 | * \sa SDL_GetTouchDevice
60 | */
61 | extern DECLSPEC int SDLCALL SDL_RecordGesture(SDL_TouchID touchId);
62 |
63 |
64 | /**
65 | * Save all currently loaded Dollar Gesture templates.
66 | *
67 | * \param dst a SDL_RWops to save to
68 | * \returns the number of saved templates on success or 0 on failure; call
69 | * SDL_GetError() for more information.
70 | *
71 | * \since This function is available since SDL 2.0.0.
72 | *
73 | * \sa SDL_LoadDollarTemplates
74 | * \sa SDL_SaveDollarTemplate
75 | */
76 | extern DECLSPEC int SDLCALL SDL_SaveAllDollarTemplates(SDL_RWops *dst);
77 |
78 | /**
79 | * Save a currently loaded Dollar Gesture template.
80 | *
81 | * \param gestureId a gesture id
82 | * \param dst a SDL_RWops to save to
83 | * \returns 1 on success or 0 on failure; call SDL_GetError() for more
84 | * information.
85 | *
86 | * \since This function is available since SDL 2.0.0.
87 | *
88 | * \sa SDL_LoadDollarTemplates
89 | * \sa SDL_SaveAllDollarTemplates
90 | */
91 | extern DECLSPEC int SDLCALL SDL_SaveDollarTemplate(SDL_GestureID gestureId,SDL_RWops *dst);
92 |
93 |
94 | /**
95 | * Load Dollar Gesture templates from a file.
96 | *
97 | * \param touchId a touch id
98 | * \param src a SDL_RWops to load from
99 | * \returns the number of loaded templates on success or a negative error code
100 | * (or 0) on failure; call SDL_GetError() for more information.
101 | *
102 | * \since This function is available since SDL 2.0.0.
103 | *
104 | * \sa SDL_SaveAllDollarTemplates
105 | * \sa SDL_SaveDollarTemplate
106 | */
107 | extern DECLSPEC int SDLCALL SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src);
108 |
109 | /* Ends C function definitions when using C++ */
110 | #ifdef __cplusplus
111 | }
112 | #endif
113 | #include "close_code.h"
114 |
115 | #endif /* SDL_gesture_h_ */
116 |
117 | /* vi: set ts=4 sw=4 expandtab: */
118 |
--------------------------------------------------------------------------------
/include/SDL_guid.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2023 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_guid.h
24 | *
25 | * Include file for handling ::SDL_GUID values.
26 | */
27 |
28 | #ifndef SDL_guid_h_
29 | #define SDL_guid_h_
30 |
31 | #include "SDL_stdinc.h"
32 | #include "SDL_error.h"
33 |
34 | #include "begin_code.h"
35 | /* Set up for C function definitions, even when using C++ */
36 | #ifdef __cplusplus
37 | extern "C" {
38 | #endif
39 |
40 | /**
41 | * An SDL_GUID is a 128-bit identifier for an input device that
42 | * identifies that device across runs of SDL programs on the same
43 | * platform. If the device is detached and then re-attached to a
44 | * different port, or if the base system is rebooted, the device
45 | * should still report the same GUID.
46 | *
47 | * GUIDs are as precise as possible but are not guaranteed to
48 | * distinguish physically distinct but equivalent devices. For
49 | * example, two game controllers from the same vendor with the same
50 | * product ID and revision may have the same GUID.
51 | *
52 | * GUIDs may be platform-dependent (i.e., the same device may report
53 | * different GUIDs on different operating systems).
54 | */
55 | typedef struct {
56 | Uint8 data[16];
57 | } SDL_GUID;
58 |
59 | /* Function prototypes */
60 |
61 | /**
62 | * Get an ASCII string representation for a given ::SDL_GUID.
63 | *
64 | * You should supply at least 33 bytes for pszGUID.
65 | *
66 | * \param guid the ::SDL_GUID you wish to convert to string
67 | * \param pszGUID buffer in which to write the ASCII string
68 | * \param cbGUID the size of pszGUID
69 | *
70 | * \since This function is available since SDL 2.24.0.
71 | *
72 | * \sa SDL_GUIDFromString
73 | */
74 | extern DECLSPEC void SDLCALL SDL_GUIDToString(SDL_GUID guid, char *pszGUID, int cbGUID);
75 |
76 | /**
77 | * Convert a GUID string into a ::SDL_GUID structure.
78 | *
79 | * Performs no error checking. If this function is given a string containing
80 | * an invalid GUID, the function will silently succeed, but the GUID generated
81 | * will not be useful.
82 | *
83 | * \param pchGUID string containing an ASCII representation of a GUID
84 | * \returns a ::SDL_GUID structure.
85 | *
86 | * \since This function is available since SDL 2.24.0.
87 | *
88 | * \sa SDL_GUIDToString
89 | */
90 | extern DECLSPEC SDL_GUID SDLCALL SDL_GUIDFromString(const char *pchGUID);
91 |
92 | /* Ends C function definitions when using C++ */
93 | #ifdef __cplusplus
94 | }
95 | #endif
96 | #include "close_code.h"
97 |
98 | #endif /* SDL_guid_h_ */
99 |
100 | /* vi: set ts=4 sw=4 expandtab: */
101 |
--------------------------------------------------------------------------------
/include/SDL_loadso.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2023 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_loadso.h
24 | *
25 | * System dependent library loading routines
26 | *
27 | * Some things to keep in mind:
28 | * \li These functions only work on C function names. Other languages may
29 | * have name mangling and intrinsic language support that varies from
30 | * compiler to compiler.
31 | * \li Make sure you declare your function pointers with the same calling
32 | * convention as the actual library function. Your code will crash
33 | * mysteriously if you do not do this.
34 | * \li Avoid namespace collisions. If you load a symbol from the library,
35 | * it is not defined whether or not it goes into the global symbol
36 | * namespace for the application. If it does and it conflicts with
37 | * symbols in your code or other shared libraries, you will not get
38 | * the results you expect. :)
39 | */
40 |
41 | #ifndef SDL_loadso_h_
42 | #define SDL_loadso_h_
43 |
44 | #include "SDL_stdinc.h"
45 | #include "SDL_error.h"
46 |
47 | #include "begin_code.h"
48 | /* Set up for C function definitions, even when using C++ */
49 | #ifdef __cplusplus
50 | extern "C" {
51 | #endif
52 |
53 | /**
54 | * Dynamically load a shared object.
55 | *
56 | * \param sofile a system-dependent name of the object file
57 | * \returns an opaque pointer to the object handle or NULL if there was an
58 | * error; call SDL_GetError() for more information.
59 | *
60 | * \since This function is available since SDL 2.0.0.
61 | *
62 | * \sa SDL_LoadFunction
63 | * \sa SDL_UnloadObject
64 | */
65 | extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile);
66 |
67 | /**
68 | * Look up the address of the named function in a shared object.
69 | *
70 | * This function pointer is no longer valid after calling SDL_UnloadObject().
71 | *
72 | * This function can only look up C function names. Other languages may have
73 | * name mangling and intrinsic language support that varies from compiler to
74 | * compiler.
75 | *
76 | * Make sure you declare your function pointers with the same calling
77 | * convention as the actual library function. Your code will crash
78 | * mysteriously if you do not do this.
79 | *
80 | * If the requested function doesn't exist, NULL is returned.
81 | *
82 | * \param handle a valid shared object handle returned by SDL_LoadObject()
83 | * \param name the name of the function to look up
84 | * \returns a pointer to the function or NULL if there was an error; call
85 | * SDL_GetError() for more information.
86 | *
87 | * \since This function is available since SDL 2.0.0.
88 | *
89 | * \sa SDL_LoadObject
90 | * \sa SDL_UnloadObject
91 | */
92 | extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle,
93 | const char *name);
94 |
95 | /**
96 | * Unload a shared object from memory.
97 | *
98 | * \param handle a valid shared object handle returned by SDL_LoadObject()
99 | *
100 | * \since This function is available since SDL 2.0.0.
101 | *
102 | * \sa SDL_LoadFunction
103 | * \sa SDL_LoadObject
104 | */
105 | extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle);
106 |
107 | /* Ends C function definitions when using C++ */
108 | #ifdef __cplusplus
109 | }
110 | #endif
111 | #include "close_code.h"
112 |
113 | #endif /* SDL_loadso_h_ */
114 |
115 | /* vi: set ts=4 sw=4 expandtab: */
116 |
--------------------------------------------------------------------------------
/include/SDL_locale.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2023 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_locale.h
24 | *
25 | * Include file for SDL locale services
26 | */
27 |
28 | #ifndef _SDL_locale_h
29 | #define _SDL_locale_h
30 |
31 | #include "SDL_stdinc.h"
32 | #include "SDL_error.h"
33 |
34 | #include "begin_code.h"
35 | /* Set up for C function definitions, even when using C++ */
36 | #ifdef __cplusplus
37 | /* *INDENT-OFF* */
38 | extern "C" {
39 | /* *INDENT-ON* */
40 | #endif
41 |
42 |
43 | typedef struct SDL_Locale
44 | {
45 | const char *language; /**< A language name, like "en" for English. */
46 | const char *country; /**< A country, like "US" for America. Can be NULL. */
47 | } SDL_Locale;
48 |
49 | /**
50 | * Report the user's preferred locale.
51 | *
52 | * This returns an array of SDL_Locale structs, the final item zeroed out.
53 | * When the caller is done with this array, it should call SDL_free() on the
54 | * returned value; all the memory involved is allocated in a single block, so
55 | * a single SDL_free() will suffice.
56 | *
57 | * Returned language strings are in the format xx, where 'xx' is an ISO-639
58 | * language specifier (such as "en" for English, "de" for German, etc).
59 | * Country strings are in the format YY, where "YY" is an ISO-3166 country
60 | * code (such as "US" for the United States, "CA" for Canada, etc). Country
61 | * might be NULL if there's no specific guidance on them (so you might get {
62 | * "en", "US" } for American English, but { "en", NULL } means "English
63 | * language, generically"). Language strings are never NULL, except to
64 | * terminate the array.
65 | *
66 | * Please note that not all of these strings are 2 characters; some are three
67 | * or more.
68 | *
69 | * The returned list of locales are in the order of the user's preference. For
70 | * example, a German citizen that is fluent in US English and knows enough
71 | * Japanese to navigate around Tokyo might have a list like: { "de", "en_US",
72 | * "jp", NULL }. Someone from England might prefer British English (where
73 | * "color" is spelled "colour", etc), but will settle for anything like it: {
74 | * "en_GB", "en", NULL }.
75 | *
76 | * This function returns NULL on error, including when the platform does not
77 | * supply this information at all.
78 | *
79 | * This might be a "slow" call that has to query the operating system. It's
80 | * best to ask for this once and save the results. However, this list can
81 | * change, usually because the user has changed a system preference outside of
82 | * your program; SDL will send an SDL_LOCALECHANGED event in this case, if
83 | * possible, and you can call this function again to get an updated copy of
84 | * preferred locales.
85 | *
86 | * \return array of locales, terminated with a locale with a NULL language
87 | * field. Will return NULL on error.
88 | *
89 | * \since This function is available since SDL 2.0.14.
90 | */
91 | extern DECLSPEC SDL_Locale * SDLCALL SDL_GetPreferredLocales(void);
92 |
93 | /* Ends C function definitions when using C++ */
94 | #ifdef __cplusplus
95 | /* *INDENT-OFF* */
96 | }
97 | /* *INDENT-ON* */
98 | #endif
99 | #include "close_code.h"
100 |
101 | #endif /* _SDL_locale_h */
102 |
103 | /* vi: set ts=4 sw=4 expandtab: */
104 |
--------------------------------------------------------------------------------
/include/SDL_metal.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2023 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_metal.h
24 | *
25 | * Header file for functions to creating Metal layers and views on SDL windows.
26 | */
27 |
28 | #ifndef SDL_metal_h_
29 | #define SDL_metal_h_
30 |
31 | #include "SDL_video.h"
32 |
33 | #include "begin_code.h"
34 | /* Set up for C function definitions, even when using C++ */
35 | #ifdef __cplusplus
36 | extern "C" {
37 | #endif
38 |
39 | /**
40 | * \brief A handle to a CAMetalLayer-backed NSView (macOS) or UIView (iOS/tvOS).
41 | *
42 | * \note This can be cast directly to an NSView or UIView.
43 | */
44 | typedef void *SDL_MetalView;
45 |
46 | /**
47 | * \name Metal support functions
48 | */
49 | /* @{ */
50 |
51 | /**
52 | * Create a CAMetalLayer-backed NSView/UIView and attach it to the specified
53 | * window.
54 | *
55 | * On macOS, this does *not* associate a MTLDevice with the CAMetalLayer on
56 | * its own. It is up to user code to do that.
57 | *
58 | * The returned handle can be casted directly to a NSView or UIView. To access
59 | * the backing CAMetalLayer, call SDL_Metal_GetLayer().
60 | *
61 | * \since This function is available since SDL 2.0.12.
62 | *
63 | * \sa SDL_Metal_DestroyView
64 | * \sa SDL_Metal_GetLayer
65 | */
66 | extern DECLSPEC SDL_MetalView SDLCALL SDL_Metal_CreateView(SDL_Window * window);
67 |
68 | /**
69 | * Destroy an existing SDL_MetalView object.
70 | *
71 | * This should be called before SDL_DestroyWindow, if SDL_Metal_CreateView was
72 | * called after SDL_CreateWindow.
73 | *
74 | * \since This function is available since SDL 2.0.12.
75 | *
76 | * \sa SDL_Metal_CreateView
77 | */
78 | extern DECLSPEC void SDLCALL SDL_Metal_DestroyView(SDL_MetalView view);
79 |
80 | /**
81 | * Get a pointer to the backing CAMetalLayer for the given view.
82 | *
83 | * \since This function is available since SDL 2.0.14.
84 | *
85 | * \sa SDL_Metal_CreateView
86 | */
87 | extern DECLSPEC void *SDLCALL SDL_Metal_GetLayer(SDL_MetalView view);
88 |
89 | /**
90 | * Get the size of a window's underlying drawable in pixels (for use with
91 | * setting viewport, scissor & etc).
92 | *
93 | * \param window SDL_Window from which the drawable size should be queried
94 | * \param w Pointer to variable for storing the width in pixels, may be NULL
95 | * \param h Pointer to variable for storing the height in pixels, may be NULL
96 | *
97 | * \since This function is available since SDL 2.0.14.
98 | *
99 | * \sa SDL_GetWindowSize
100 | * \sa SDL_CreateWindow
101 | */
102 | extern DECLSPEC void SDLCALL SDL_Metal_GetDrawableSize(SDL_Window* window, int *w,
103 | int *h);
104 |
105 | /* @} *//* Metal support functions */
106 |
107 | /* Ends C function definitions when using C++ */
108 | #ifdef __cplusplus
109 | }
110 | #endif
111 | #include "close_code.h"
112 |
113 | #endif /* SDL_metal_h_ */
114 |
--------------------------------------------------------------------------------
/include/SDL_misc.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2023 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_misc.h
24 | *
25 | * \brief Include file for SDL API functions that don't fit elsewhere.
26 | */
27 |
28 | #ifndef SDL_misc_h_
29 | #define SDL_misc_h_
30 |
31 | #include "SDL_stdinc.h"
32 |
33 | #include "begin_code.h"
34 |
35 | /* Set up for C function definitions, even when using C++ */
36 | #ifdef __cplusplus
37 | extern "C" {
38 | #endif
39 |
40 | /**
41 | * Open a URL/URI in the browser or other appropriate external application.
42 | *
43 | * Open a URL in a separate, system-provided application. How this works will
44 | * vary wildly depending on the platform. This will likely launch what makes
45 | * sense to handle a specific URL's protocol (a web browser for `http://`,
46 | * etc), but it might also be able to launch file managers for directories and
47 | * other things.
48 | *
49 | * What happens when you open a URL varies wildly as well: your game window
50 | * may lose focus (and may or may not lose focus if your game was fullscreen
51 | * or grabbing input at the time). On mobile devices, your app will likely
52 | * move to the background or your process might be paused. Any given platform
53 | * may or may not handle a given URL.
54 | *
55 | * If this is unimplemented (or simply unavailable) for a platform, this will
56 | * fail with an error. A successful result does not mean the URL loaded, just
57 | * that we launched _something_ to handle it (or at least believe we did).
58 | *
59 | * All this to say: this function can be useful, but you should definitely
60 | * test it on every platform you target.
61 | *
62 | * \param url A valid URL/URI to open. Use `file:///full/path/to/file` for
63 | * local files, if supported.
64 | * \returns 0 on success, or -1 on error; call SDL_GetError() for more
65 | * information.
66 | *
67 | * \since This function is available since SDL 2.0.14.
68 | */
69 | extern DECLSPEC int SDLCALL SDL_OpenURL(const char *url);
70 |
71 | /* Ends C function definitions when using C++ */
72 | #ifdef __cplusplus
73 | }
74 | #endif
75 | #include "close_code.h"
76 |
77 | #endif /* SDL_misc_h_ */
78 |
79 | /* vi: set ts=4 sw=4 expandtab: */
80 |
--------------------------------------------------------------------------------
/include/SDL_name.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2023 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | #ifndef SDLname_h_
23 | #define SDLname_h_
24 |
25 | #if defined(__STDC__) || defined(__cplusplus)
26 | #define NeedFunctionPrototypes 1
27 | #endif
28 |
29 | #define SDL_NAME(X) SDL_##X
30 |
31 | #endif /* SDLname_h_ */
32 |
33 | /* vi: set ts=4 sw=4 expandtab: */
34 |
--------------------------------------------------------------------------------
/include/SDL_opengles.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2023 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_opengles.h
24 | *
25 | * This is a simple file to encapsulate the OpenGL ES 1.X API headers.
26 | */
27 | #include "SDL_config.h"
28 |
29 | #ifdef __IPHONEOS__
30 | #include
31 | #include
32 | #else
33 | #include
34 | #include
35 | #endif
36 |
37 | #ifndef APIENTRY
38 | #define APIENTRY
39 | #endif
40 |
--------------------------------------------------------------------------------
/include/SDL_opengles2.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2023 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_opengles2.h
24 | *
25 | * This is a simple file to encapsulate the OpenGL ES 2.0 API headers.
26 | */
27 | #include "SDL_config.h"
28 |
29 | #if !defined(_MSC_VER) && !defined(SDL_USE_BUILTIN_OPENGL_DEFINITIONS)
30 |
31 | #ifdef __IPHONEOS__
32 | #include
33 | #include
34 | #else
35 | #include
36 | #include
37 | #include
38 | #endif
39 |
40 | #else /* _MSC_VER */
41 |
42 | /* OpenGL ES2 headers for Visual Studio */
43 | #include "SDL_opengles2_khrplatform.h"
44 | #include "SDL_opengles2_gl2platform.h"
45 | #include "SDL_opengles2_gl2.h"
46 | #include "SDL_opengles2_gl2ext.h"
47 |
48 | #endif /* _MSC_VER */
49 |
50 | #ifndef APIENTRY
51 | #define APIENTRY GL_APIENTRY
52 | #endif
53 |
--------------------------------------------------------------------------------
/include/SDL_opengles2_gl2platform.h:
--------------------------------------------------------------------------------
1 | #ifndef __gl2platform_h_
2 | #define __gl2platform_h_
3 |
4 | /*
5 | ** Copyright 2017-2020 The Khronos Group Inc.
6 | ** SPDX-License-Identifier: Apache-2.0
7 | */
8 |
9 | /* Platform-specific types and definitions for OpenGL ES 2.X gl2.h
10 | *
11 | * Adopters may modify khrplatform.h and this file to suit their platform.
12 | * Please contribute modifications back to Khronos as pull requests on the
13 | * public github repository:
14 | * https://github.com/KhronosGroup/OpenGL-Registry
15 | */
16 |
17 | /*#include */
18 |
19 | #ifndef GL_APICALL
20 | #define GL_APICALL KHRONOS_APICALL
21 | #endif
22 |
23 | #ifndef GL_APIENTRY
24 | #define GL_APIENTRY KHRONOS_APIENTRY
25 | #endif
26 |
27 | #endif /* __gl2platform_h_ */
28 |
--------------------------------------------------------------------------------
/include/SDL_power.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2023 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | #ifndef SDL_power_h_
23 | #define SDL_power_h_
24 |
25 | /**
26 | * \file SDL_power.h
27 | *
28 | * Header for the SDL power management routines.
29 | */
30 |
31 | #include "SDL_stdinc.h"
32 |
33 | #include "begin_code.h"
34 | /* Set up for C function definitions, even when using C++ */
35 | #ifdef __cplusplus
36 | extern "C" {
37 | #endif
38 |
39 | /**
40 | * The basic state for the system's power supply.
41 | */
42 | typedef enum
43 | {
44 | SDL_POWERSTATE_UNKNOWN, /**< cannot determine power status */
45 | SDL_POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */
46 | SDL_POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */
47 | SDL_POWERSTATE_CHARGING, /**< Plugged in, charging battery */
48 | SDL_POWERSTATE_CHARGED /**< Plugged in, battery charged */
49 | } SDL_PowerState;
50 |
51 | /**
52 | * Get the current power supply details.
53 | *
54 | * You should never take a battery status as absolute truth. Batteries
55 | * (especially failing batteries) are delicate hardware, and the values
56 | * reported here are best estimates based on what that hardware reports. It's
57 | * not uncommon for older batteries to lose stored power much faster than it
58 | * reports, or completely drain when reporting it has 20 percent left, etc.
59 | *
60 | * Battery status can change at any time; if you are concerned with power
61 | * state, you should call this function frequently, and perhaps ignore changes
62 | * until they seem to be stable for a few seconds.
63 | *
64 | * It's possible a platform can only report battery percentage or time left
65 | * but not both.
66 | *
67 | * \param seconds seconds of battery life left, you can pass a NULL here if
68 | * you don't care, will return -1 if we can't determine a
69 | * value, or we're not running on a battery
70 | * \param percent percentage of battery life left, between 0 and 100, you can
71 | * pass a NULL here if you don't care, will return -1 if we
72 | * can't determine a value, or we're not running on a battery
73 | * \returns an SDL_PowerState enum representing the current battery state.
74 | *
75 | * \since This function is available since SDL 2.0.0.
76 | */
77 | extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *seconds, int *percent);
78 |
79 | /* Ends C function definitions when using C++ */
80 | #ifdef __cplusplus
81 | }
82 | #endif
83 | #include "close_code.h"
84 |
85 | #endif /* SDL_power_h_ */
86 |
87 | /* vi: set ts=4 sw=4 expandtab: */
88 |
--------------------------------------------------------------------------------
/include/SDL_quit.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2023 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_quit.h
24 | *
25 | * Include file for SDL quit event handling.
26 | */
27 |
28 | #ifndef SDL_quit_h_
29 | #define SDL_quit_h_
30 |
31 | #include "SDL_stdinc.h"
32 | #include "SDL_error.h"
33 |
34 | /**
35 | * \file SDL_quit.h
36 | *
37 | * An ::SDL_QUIT event is generated when the user tries to close the application
38 | * window. If it is ignored or filtered out, the window will remain open.
39 | * If it is not ignored or filtered, it is queued normally and the window
40 | * is allowed to close. When the window is closed, screen updates will
41 | * complete, but have no effect.
42 | *
43 | * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt)
44 | * and SIGTERM (system termination request), if handlers do not already
45 | * exist, that generate ::SDL_QUIT events as well. There is no way
46 | * to determine the cause of an ::SDL_QUIT event, but setting a signal
47 | * handler in your application will override the default generation of
48 | * quit events for that signal.
49 | *
50 | * \sa SDL_Quit()
51 | */
52 |
53 | /* There are no functions directly affecting the quit event */
54 |
55 | #define SDL_QuitRequested() \
56 | (SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0))
57 |
58 | #endif /* SDL_quit_h_ */
59 |
--------------------------------------------------------------------------------
/include/SDL_revision.h:
--------------------------------------------------------------------------------
1 | /* Generated by updaterev.sh, do not edit */
2 | #ifdef SDL_VENDOR_INFO
3 | #define SDL_REVISION "SDL-release-2.28.4-0-gcc016b004 (" SDL_VENDOR_INFO ")"
4 | #else
5 | #define SDL_REVISION "SDL-release-2.28.4-0-gcc016b004"
6 | #endif
7 | #define SDL_REVISION_NUMBER 0
8 |
--------------------------------------------------------------------------------
/include/SDL_test.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2023 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_test.h
24 | *
25 | * Include file for SDL test framework.
26 | *
27 | * This code is a part of the SDL2_test library, not the main SDL library.
28 | */
29 |
30 | #ifndef SDL_test_h_
31 | #define SDL_test_h_
32 |
33 | #include "SDL.h"
34 | #include "SDL_test_assert.h"
35 | #include "SDL_test_common.h"
36 | #include "SDL_test_compare.h"
37 | #include "SDL_test_crc32.h"
38 | #include "SDL_test_font.h"
39 | #include "SDL_test_fuzzer.h"
40 | #include "SDL_test_harness.h"
41 | #include "SDL_test_images.h"
42 | #include "SDL_test_log.h"
43 | #include "SDL_test_md5.h"
44 | #include "SDL_test_memory.h"
45 | #include "SDL_test_random.h"
46 |
47 | #include "begin_code.h"
48 | /* Set up for C function definitions, even when using C++ */
49 | #ifdef __cplusplus
50 | extern "C" {
51 | #endif
52 |
53 | /* Global definitions */
54 |
55 | /*
56 | * Note: Maximum size of SDLTest log message is less than SDL's limit
57 | * to ensure we can fit additional information such as the timestamp.
58 | */
59 | #define SDLTEST_MAX_LOGMESSAGE_LENGTH 3584
60 |
61 | /* Ends C function definitions when using C++ */
62 | #ifdef __cplusplus
63 | }
64 | #endif
65 | #include "close_code.h"
66 |
67 | #endif /* SDL_test_h_ */
68 |
69 | /* vi: set ts=4 sw=4 expandtab: */
70 |
--------------------------------------------------------------------------------
/include/SDL_test_assert.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2023 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_test_assert.h
24 | *
25 | * Include file for SDL test framework.
26 | *
27 | * This code is a part of the SDL2_test library, not the main SDL library.
28 | */
29 |
30 | /*
31 | *
32 | * Assert API for test code and test cases
33 | *
34 | */
35 |
36 | #ifndef SDL_test_assert_h_
37 | #define SDL_test_assert_h_
38 |
39 | #include "begin_code.h"
40 | /* Set up for C function definitions, even when using C++ */
41 | #ifdef __cplusplus
42 | extern "C" {
43 | #endif
44 |
45 | /**
46 | * \brief Fails the assert.
47 | */
48 | #define ASSERT_FAIL 0
49 |
50 | /**
51 | * \brief Passes the assert.
52 | */
53 | #define ASSERT_PASS 1
54 |
55 | /**
56 | * \brief Assert that logs and break execution flow on failures.
57 | *
58 | * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0).
59 | * \param assertDescription Message to log with the assert describing it.
60 | */
61 | void SDLTest_Assert(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2);
62 |
63 | /**
64 | * \brief Assert for test cases that logs but does not break execution flow on failures. Updates assertion counters.
65 | *
66 | * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0).
67 | * \param assertDescription Message to log with the assert describing it.
68 | *
69 | * \returns the assertCondition so it can be used to externally to break execution flow if desired.
70 | */
71 | int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2);
72 |
73 | /**
74 | * \brief Explicitly pass without checking an assertion condition. Updates assertion counter.
75 | *
76 | * \param assertDescription Message to log with the assert describing it.
77 | */
78 | void SDLTest_AssertPass(SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(1);
79 |
80 | /**
81 | * \brief Resets the assert summary counters to zero.
82 | */
83 | void SDLTest_ResetAssertSummary(void);
84 |
85 | /**
86 | * \brief Logs summary of all assertions (total, pass, fail) since last reset as INFO or ERROR.
87 | */
88 | void SDLTest_LogAssertSummary(void);
89 |
90 |
91 | /**
92 | * \brief Converts the current assert summary state to a test result.
93 | *
94 | * \returns TEST_RESULT_PASSED, TEST_RESULT_FAILED, or TEST_RESULT_NO_ASSERT
95 | */
96 | int SDLTest_AssertSummaryToTestResult(void);
97 |
98 | #ifdef __cplusplus
99 | }
100 | #endif
101 | #include "close_code.h"
102 |
103 | #endif /* SDL_test_assert_h_ */
104 |
105 | /* vi: set ts=4 sw=4 expandtab: */
106 |
--------------------------------------------------------------------------------
/include/SDL_test_compare.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2023 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_test_compare.h
24 | *
25 | * Include file for SDL test framework.
26 | *
27 | * This code is a part of the SDL2_test library, not the main SDL library.
28 | */
29 |
30 | /*
31 |
32 | Defines comparison functions (i.e. for surfaces).
33 |
34 | */
35 |
36 | #ifndef SDL_test_compare_h_
37 | #define SDL_test_compare_h_
38 |
39 | #include "SDL.h"
40 |
41 | #include "SDL_test_images.h"
42 |
43 | #include "begin_code.h"
44 | /* Set up for C function definitions, even when using C++ */
45 | #ifdef __cplusplus
46 | extern "C" {
47 | #endif
48 |
49 | /**
50 | * \brief Compares a surface and with reference image data for equality
51 | *
52 | * \param surface Surface used in comparison
53 | * \param referenceSurface Test Surface used in comparison
54 | * \param allowable_error Allowable difference (=sum of squared difference for each RGB component) in blending accuracy.
55 | *
56 | * \returns 0 if comparison succeeded, >0 (=number of pixels for which the comparison failed) if comparison failed, -1 if any of the surfaces were NULL, -2 if the surface sizes differ.
57 | */
58 | int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error);
59 |
60 |
61 | /* Ends C function definitions when using C++ */
62 | #ifdef __cplusplus
63 | }
64 | #endif
65 | #include "close_code.h"
66 |
67 | #endif /* SDL_test_compare_h_ */
68 |
69 | /* vi: set ts=4 sw=4 expandtab: */
70 |
--------------------------------------------------------------------------------
/include/SDL_test_crc32.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2023 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_test_crc32.h
24 | *
25 | * Include file for SDL test framework.
26 | *
27 | * This code is a part of the SDL2_test library, not the main SDL library.
28 | */
29 |
30 | /*
31 |
32 | Implements CRC32 calculations (default output is Perl String::CRC32 compatible).
33 |
34 | */
35 |
36 | #ifndef SDL_test_crc32_h_
37 | #define SDL_test_crc32_h_
38 |
39 | #include "begin_code.h"
40 | /* Set up for C function definitions, even when using C++ */
41 | #ifdef __cplusplus
42 | extern "C" {
43 | #endif
44 |
45 |
46 | /* ------------ Definitions --------- */
47 |
48 | /* Definition shared by all CRC routines */
49 |
50 | #ifndef CrcUint32
51 | #define CrcUint32 unsigned int
52 | #endif
53 | #ifndef CrcUint8
54 | #define CrcUint8 unsigned char
55 | #endif
56 |
57 | #ifdef ORIGINAL_METHOD
58 | #define CRC32_POLY 0x04c11db7 /* AUTODIN II, Ethernet, & FDDI */
59 | #else
60 | #define CRC32_POLY 0xEDB88320 /* Perl String::CRC32 compatible */
61 | #endif
62 |
63 | /**
64 | * Data structure for CRC32 (checksum) computation
65 | */
66 | typedef struct {
67 | CrcUint32 crc32_table[256]; /* CRC table */
68 | } SDLTest_Crc32Context;
69 |
70 | /* ---------- Function Prototypes ------------- */
71 |
72 | /**
73 | * \brief Initialize the CRC context
74 | *
75 | * Note: The function initializes the crc table required for all crc calculations.
76 | *
77 | * \param crcContext pointer to context variable
78 | *
79 | * \returns 0 for OK, -1 on error
80 | *
81 | */
82 | int SDLTest_Crc32Init(SDLTest_Crc32Context * crcContext);
83 |
84 |
85 | /**
86 | * \brief calculate a crc32 from a data block
87 | *
88 | * \param crcContext pointer to context variable
89 | * \param inBuf input buffer to checksum
90 | * \param inLen length of input buffer
91 | * \param crc32 pointer to Uint32 to store the final CRC into
92 | *
93 | * \returns 0 for OK, -1 on error
94 | *
95 | */
96 | int SDLTest_Crc32Calc(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32);
97 |
98 | /* Same routine broken down into three steps */
99 | int SDLTest_Crc32CalcStart(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32);
100 | int SDLTest_Crc32CalcEnd(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32);
101 | int SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32);
102 |
103 |
104 | /**
105 | * \brief clean up CRC context
106 | *
107 | * \param crcContext pointer to context variable
108 | *
109 | * \returns 0 for OK, -1 on error
110 | *
111 | */
112 |
113 | int SDLTest_Crc32Done(SDLTest_Crc32Context * crcContext);
114 |
115 |
116 | /* Ends C function definitions when using C++ */
117 | #ifdef __cplusplus
118 | }
119 | #endif
120 | #include "close_code.h"
121 |
122 | #endif /* SDL_test_crc32_h_ */
123 |
124 | /* vi: set ts=4 sw=4 expandtab: */
125 |
--------------------------------------------------------------------------------
/include/SDL_test_harness.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2023 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_test_harness.h
24 | *
25 | * Include file for SDL test framework.
26 | *
27 | * This code is a part of the SDL2_test library, not the main SDL library.
28 | */
29 |
30 | /*
31 | Defines types for test case definitions and the test execution harness API.
32 |
33 | Based on original GSOC code by Markus Kauppila
34 | */
35 |
36 | #ifndef SDL_test_h_arness_h
37 | #define SDL_test_h_arness_h
38 |
39 | #include "begin_code.h"
40 | /* Set up for C function definitions, even when using C++ */
41 | #ifdef __cplusplus
42 | extern "C" {
43 | #endif
44 |
45 |
46 | /* ! Definitions for test case structures */
47 | #define TEST_ENABLED 1
48 | #define TEST_DISABLED 0
49 |
50 | /* ! Definition of all the possible test return values of the test case method */
51 | #define TEST_ABORTED -1
52 | #define TEST_STARTED 0
53 | #define TEST_COMPLETED 1
54 | #define TEST_SKIPPED 2
55 |
56 | /* ! Definition of all the possible test results for the harness */
57 | #define TEST_RESULT_PASSED 0
58 | #define TEST_RESULT_FAILED 1
59 | #define TEST_RESULT_NO_ASSERT 2
60 | #define TEST_RESULT_SKIPPED 3
61 | #define TEST_RESULT_SETUP_FAILURE 4
62 |
63 | /* !< Function pointer to a test case setup function (run before every test) */
64 | typedef void (*SDLTest_TestCaseSetUpFp)(void *arg);
65 |
66 | /* !< Function pointer to a test case function */
67 | typedef int (*SDLTest_TestCaseFp)(void *arg);
68 |
69 | /* !< Function pointer to a test case teardown function (run after every test) */
70 | typedef void (*SDLTest_TestCaseTearDownFp)(void *arg);
71 |
72 | /**
73 | * Holds information about a single test case.
74 | */
75 | typedef struct SDLTest_TestCaseReference {
76 | /* !< Func2Stress */
77 | SDLTest_TestCaseFp testCase;
78 | /* !< Short name (or function name) "Func2Stress" */
79 | const char *name;
80 | /* !< Long name or full description "This test pushes func2() to the limit." */
81 | const char *description;
82 | /* !< Set to TEST_ENABLED or TEST_DISABLED (test won't be run) */
83 | int enabled;
84 | } SDLTest_TestCaseReference;
85 |
86 | /**
87 | * Holds information about a test suite (multiple test cases).
88 | */
89 | typedef struct SDLTest_TestSuiteReference {
90 | /* !< "PlatformSuite" */
91 | const char *name;
92 | /* !< The function that is run before each test. NULL skips. */
93 | SDLTest_TestCaseSetUpFp testSetUp;
94 | /* !< The test cases that are run as part of the suite. Last item should be NULL. */
95 | const SDLTest_TestCaseReference **testCases;
96 | /* !< The function that is run after each test. NULL skips. */
97 | SDLTest_TestCaseTearDownFp testTearDown;
98 | } SDLTest_TestSuiteReference;
99 |
100 |
101 | /**
102 | * \brief Generates a random run seed string for the harness. The generated seed will contain alphanumeric characters (0-9A-Z).
103 | *
104 | * Note: The returned string needs to be deallocated by the caller.
105 | *
106 | * \param length The length of the seed string to generate
107 | *
108 | * \returns the generated seed string
109 | */
110 | char *SDLTest_GenerateRunSeed(const int length);
111 |
112 | /**
113 | * \brief Execute a test suite using the given run seed and execution key.
114 | *
115 | * \param testSuites Suites containing the test case.
116 | * \param userRunSeed Custom run seed provided by user, or NULL to autogenerate one.
117 | * \param userExecKey Custom execution key provided by user, or 0 to autogenerate one.
118 | * \param filter Filter specification. NULL disables. Case sensitive.
119 | * \param testIterations Number of iterations to run each test case.
120 | *
121 | * \returns the test run result: 0 when all tests passed, 1 if any tests failed.
122 | */
123 | int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *userRunSeed, Uint64 userExecKey, const char *filter, int testIterations);
124 |
125 |
126 | /* Ends C function definitions when using C++ */
127 | #ifdef __cplusplus
128 | }
129 | #endif
130 | #include "close_code.h"
131 |
132 | #endif /* SDL_test_h_arness_h */
133 |
134 | /* vi: set ts=4 sw=4 expandtab: */
135 |
--------------------------------------------------------------------------------
/include/SDL_test_images.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2023 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_test_images.h
24 | *
25 | * Include file for SDL test framework.
26 | *
27 | * This code is a part of the SDL2_test library, not the main SDL library.
28 | */
29 |
30 | /*
31 |
32 | Defines some images for tests.
33 |
34 | */
35 |
36 | #ifndef SDL_test_images_h_
37 | #define SDL_test_images_h_
38 |
39 | #include "SDL.h"
40 |
41 | #include "begin_code.h"
42 | /* Set up for C function definitions, even when using C++ */
43 | #ifdef __cplusplus
44 | extern "C" {
45 | #endif
46 |
47 | /**
48 | *Type for test images.
49 | */
50 | typedef struct SDLTest_SurfaceImage_s {
51 | int width;
52 | int height;
53 | unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */
54 | const char *pixel_data;
55 | } SDLTest_SurfaceImage_t;
56 |
57 | /* Test images */
58 | SDL_Surface *SDLTest_ImageBlit(void);
59 | SDL_Surface *SDLTest_ImageBlitColor(void);
60 | SDL_Surface *SDLTest_ImageBlitAlpha(void);
61 | SDL_Surface *SDLTest_ImageBlitBlendAdd(void);
62 | SDL_Surface *SDLTest_ImageBlitBlend(void);
63 | SDL_Surface *SDLTest_ImageBlitBlendMod(void);
64 | SDL_Surface *SDLTest_ImageBlitBlendNone(void);
65 | SDL_Surface *SDLTest_ImageBlitBlendAll(void);
66 | SDL_Surface *SDLTest_ImageFace(void);
67 | SDL_Surface *SDLTest_ImagePrimitives(void);
68 | SDL_Surface *SDLTest_ImagePrimitivesBlend(void);
69 |
70 | /* Ends C function definitions when using C++ */
71 | #ifdef __cplusplus
72 | }
73 | #endif
74 | #include "close_code.h"
75 |
76 | #endif /* SDL_test_images_h_ */
77 |
78 | /* vi: set ts=4 sw=4 expandtab: */
79 |
--------------------------------------------------------------------------------
/include/SDL_test_log.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2023 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_test_log.h
24 | *
25 | * Include file for SDL test framework.
26 | *
27 | * This code is a part of the SDL2_test library, not the main SDL library.
28 | */
29 |
30 | /*
31 | *
32 | * Wrapper to log in the TEST category
33 | *
34 | */
35 |
36 | #ifndef SDL_test_log_h_
37 | #define SDL_test_log_h_
38 |
39 | #include "begin_code.h"
40 | /* Set up for C function definitions, even when using C++ */
41 | #ifdef __cplusplus
42 | extern "C" {
43 | #endif
44 |
45 | /**
46 | * \brief Prints given message with a timestamp in the TEST category and INFO priority.
47 | *
48 | * \param fmt Message to be logged
49 | */
50 | void SDLTest_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
51 |
52 | /**
53 | * \brief Prints given message with a timestamp in the TEST category and the ERROR priority.
54 | *
55 | * \param fmt Message to be logged
56 | */
57 | void SDLTest_LogError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
58 |
59 | /* Ends C function definitions when using C++ */
60 | #ifdef __cplusplus
61 | }
62 | #endif
63 | #include "close_code.h"
64 |
65 | #endif /* SDL_test_log_h_ */
66 |
67 | /* vi: set ts=4 sw=4 expandtab: */
68 |
--------------------------------------------------------------------------------
/include/SDL_test_md5.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2023 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_test_md5.h
24 | *
25 | * Include file for SDL test framework.
26 | *
27 | * This code is a part of the SDL2_test library, not the main SDL library.
28 | */
29 |
30 | /*
31 | ***********************************************************************
32 | ** Header file for implementation of MD5 **
33 | ** RSA Data Security, Inc. MD5 Message-Digest Algorithm **
34 | ** Created: 2/17/90 RLR **
35 | ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version **
36 | ** Revised (for MD5): RLR 4/27/91 **
37 | ** -- G modified to have y&~z instead of y&z **
38 | ** -- FF, GG, HH modified to add in last register done **
39 | ** -- Access pattern: round 2 works mod 5, round 3 works mod 3 **
40 | ** -- distinct additive constant for each step **
41 | ** -- round 4 added, working mod 7 **
42 | ***********************************************************************
43 | */
44 |
45 | /*
46 | ***********************************************************************
47 | ** Message-digest routines: **
48 | ** To form the message digest for a message M **
49 | ** (1) Initialize a context buffer mdContext using MD5Init **
50 | ** (2) Call MD5Update on mdContext and M **
51 | ** (3) Call MD5Final on mdContext **
52 | ** The message digest is now in mdContext->digest[0...15] **
53 | ***********************************************************************
54 | */
55 |
56 | #ifndef SDL_test_md5_h_
57 | #define SDL_test_md5_h_
58 |
59 | #include "begin_code.h"
60 | /* Set up for C function definitions, even when using C++ */
61 | #ifdef __cplusplus
62 | extern "C" {
63 | #endif
64 |
65 | /* ------------ Definitions --------- */
66 |
67 | /* typedef a 32-bit type */
68 | typedef unsigned long int MD5UINT4;
69 |
70 | /* Data structure for MD5 (Message-Digest) computation */
71 | typedef struct {
72 | MD5UINT4 i[2]; /* number of _bits_ handled mod 2^64 */
73 | MD5UINT4 buf[4]; /* scratch buffer */
74 | unsigned char in[64]; /* input buffer */
75 | unsigned char digest[16]; /* actual digest after Md5Final call */
76 | } SDLTest_Md5Context;
77 |
78 | /* ---------- Function Prototypes ------------- */
79 |
80 | /**
81 | * \brief initialize the context
82 | *
83 | * \param mdContext pointer to context variable
84 | *
85 | * Note: The function initializes the message-digest context
86 | * mdContext. Call before each new use of the context -
87 | * all fields are set to zero.
88 | */
89 | void SDLTest_Md5Init(SDLTest_Md5Context * mdContext);
90 |
91 |
92 | /**
93 | * \brief update digest from variable length data
94 | *
95 | * \param mdContext pointer to context variable
96 | * \param inBuf pointer to data array/string
97 | * \param inLen length of data array/string
98 | *
99 | * Note: The function updates the message-digest context to account
100 | * for the presence of each of the characters inBuf[0..inLen-1]
101 | * in the message whose digest is being computed.
102 | */
103 |
104 | void SDLTest_Md5Update(SDLTest_Md5Context * mdContext, unsigned char *inBuf,
105 | unsigned int inLen);
106 |
107 |
108 | /**
109 | * \brief complete digest computation
110 | *
111 | * \param mdContext pointer to context variable
112 | *
113 | * Note: The function terminates the message-digest computation and
114 | * ends with the desired message digest in mdContext.digest[0..15].
115 | * Always call before using the digest[] variable.
116 | */
117 |
118 | void SDLTest_Md5Final(SDLTest_Md5Context * mdContext);
119 |
120 |
121 | /* Ends C function definitions when using C++ */
122 | #ifdef __cplusplus
123 | }
124 | #endif
125 | #include "close_code.h"
126 |
127 | #endif /* SDL_test_md5_h_ */
128 |
129 | /* vi: set ts=4 sw=4 expandtab: */
130 |
--------------------------------------------------------------------------------
/include/SDL_test_memory.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2023 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_test_memory.h
24 | *
25 | * Include file for SDL test framework.
26 | *
27 | * This code is a part of the SDL2_test library, not the main SDL library.
28 | */
29 |
30 | #ifndef SDL_test_memory_h_
31 | #define SDL_test_memory_h_
32 |
33 | #include "begin_code.h"
34 | /* Set up for C function definitions, even when using C++ */
35 | #ifdef __cplusplus
36 | extern "C" {
37 | #endif
38 |
39 |
40 | /**
41 | * \brief Start tracking SDL memory allocations
42 | *
43 | * \note This should be called before any other SDL functions for complete tracking coverage
44 | */
45 | int SDLTest_TrackAllocations(void);
46 |
47 | /**
48 | * \brief Print a log of any outstanding allocations
49 | *
50 | * \note This can be called after SDL_Quit()
51 | */
52 | void SDLTest_LogAllocations(void);
53 |
54 |
55 | /* Ends C function definitions when using C++ */
56 | #ifdef __cplusplus
57 | }
58 | #endif
59 | #include "close_code.h"
60 |
61 | #endif /* SDL_test_memory_h_ */
62 |
63 | /* vi: set ts=4 sw=4 expandtab: */
64 |
--------------------------------------------------------------------------------
/include/SDL_test_random.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2023 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_test_random.h
24 | *
25 | * Include file for SDL test framework.
26 | *
27 | * This code is a part of the SDL2_test library, not the main SDL library.
28 | */
29 |
30 | /*
31 |
32 | A "32-bit Multiply with carry random number generator. Very fast.
33 | Includes a list of recommended multipliers.
34 |
35 | multiply-with-carry generator: x(n) = a*x(n-1) + carry mod 2^32.
36 | period: (a*2^31)-1
37 |
38 | */
39 |
40 | #ifndef SDL_test_random_h_
41 | #define SDL_test_random_h_
42 |
43 | #include "begin_code.h"
44 | /* Set up for C function definitions, even when using C++ */
45 | #ifdef __cplusplus
46 | extern "C" {
47 | #endif
48 |
49 | /* --- Definitions */
50 |
51 | /*
52 | * Macros that return a random number in a specific format.
53 | */
54 | #define SDLTest_RandomInt(c) ((int)SDLTest_Random(c))
55 |
56 | /*
57 | * Context structure for the random number generator state.
58 | */
59 | typedef struct {
60 | unsigned int a;
61 | unsigned int x;
62 | unsigned int c;
63 | unsigned int ah;
64 | unsigned int al;
65 | } SDLTest_RandomContext;
66 |
67 |
68 | /* --- Function prototypes */
69 |
70 | /**
71 | * \brief Initialize random number generator with two integers.
72 | *
73 | * Note: The random sequence of numbers returned by ...Random() is the
74 | * same for the same two integers and has a period of 2^31.
75 | *
76 | * \param rndContext pointer to context structure
77 | * \param xi integer that defines the random sequence
78 | * \param ci integer that defines the random sequence
79 | *
80 | */
81 | void SDLTest_RandomInit(SDLTest_RandomContext * rndContext, unsigned int xi,
82 | unsigned int ci);
83 |
84 | /**
85 | * \brief Initialize random number generator based on current system time.
86 | *
87 | * \param rndContext pointer to context structure
88 | *
89 | */
90 | void SDLTest_RandomInitTime(SDLTest_RandomContext *rndContext);
91 |
92 |
93 | /**
94 | * \brief Initialize random number generator based on current system time.
95 | *
96 | * Note: ...RandomInit() or ...RandomInitTime() must have been called
97 | * before using this function.
98 | *
99 | * \param rndContext pointer to context structure
100 | *
101 | * \returns a random number (32bit unsigned integer)
102 | *
103 | */
104 | unsigned int SDLTest_Random(SDLTest_RandomContext *rndContext);
105 |
106 |
107 | /* Ends C function definitions when using C++ */
108 | #ifdef __cplusplus
109 | }
110 | #endif
111 | #include "close_code.h"
112 |
113 | #endif /* SDL_test_random_h_ */
114 |
115 | /* vi: set ts=4 sw=4 expandtab: */
116 |
--------------------------------------------------------------------------------
/include/SDL_touch.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2023 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_touch.h
24 | *
25 | * Include file for SDL touch event handling.
26 | */
27 |
28 | #ifndef SDL_touch_h_
29 | #define SDL_touch_h_
30 |
31 | #include "SDL_stdinc.h"
32 | #include "SDL_error.h"
33 | #include "SDL_video.h"
34 |
35 | #include "begin_code.h"
36 | /* Set up for C function definitions, even when using C++ */
37 | #ifdef __cplusplus
38 | extern "C" {
39 | #endif
40 |
41 | typedef Sint64 SDL_TouchID;
42 | typedef Sint64 SDL_FingerID;
43 |
44 | typedef enum
45 | {
46 | SDL_TOUCH_DEVICE_INVALID = -1,
47 | SDL_TOUCH_DEVICE_DIRECT, /* touch screen with window-relative coordinates */
48 | SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE, /* trackpad with absolute device coordinates */
49 | SDL_TOUCH_DEVICE_INDIRECT_RELATIVE /* trackpad with screen cursor-relative coordinates */
50 | } SDL_TouchDeviceType;
51 |
52 | typedef struct SDL_Finger
53 | {
54 | SDL_FingerID id;
55 | float x;
56 | float y;
57 | float pressure;
58 | } SDL_Finger;
59 |
60 | /* Used as the device ID for mouse events simulated with touch input */
61 | #define SDL_TOUCH_MOUSEID ((Uint32)-1)
62 |
63 | /* Used as the SDL_TouchID for touch events simulated with mouse input */
64 | #define SDL_MOUSE_TOUCHID ((Sint64)-1)
65 |
66 |
67 | /**
68 | * Get the number of registered touch devices.
69 | *
70 | * On some platforms SDL first sees the touch device if it was actually used.
71 | * Therefore SDL_GetNumTouchDevices() may return 0 although devices are
72 | * available. After using all devices at least once the number will be
73 | * correct.
74 | *
75 | * This was fixed for Android in SDL 2.0.1.
76 | *
77 | * \returns the number of registered touch devices.
78 | *
79 | * \since This function is available since SDL 2.0.0.
80 | *
81 | * \sa SDL_GetTouchDevice
82 | */
83 | extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void);
84 |
85 | /**
86 | * Get the touch ID with the given index.
87 | *
88 | * \param index the touch device index
89 | * \returns the touch ID with the given index on success or 0 if the index is
90 | * invalid; call SDL_GetError() for more information.
91 | *
92 | * \since This function is available since SDL 2.0.0.
93 | *
94 | * \sa SDL_GetNumTouchDevices
95 | */
96 | extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index);
97 |
98 | /**
99 | * Get the touch device name as reported from the driver or NULL if the index
100 | * is invalid.
101 | *
102 | * \since This function is available since SDL 2.0.22.
103 | */
104 | extern DECLSPEC const char* SDLCALL SDL_GetTouchName(int index);
105 |
106 | /**
107 | * Get the type of the given touch device.
108 | *
109 | * \since This function is available since SDL 2.0.10.
110 | */
111 | extern DECLSPEC SDL_TouchDeviceType SDLCALL SDL_GetTouchDeviceType(SDL_TouchID touchID);
112 |
113 | /**
114 | * Get the number of active fingers for a given touch device.
115 | *
116 | * \param touchID the ID of a touch device
117 | * \returns the number of active fingers for a given touch device on success
118 | * or 0 on failure; call SDL_GetError() for more information.
119 | *
120 | * \since This function is available since SDL 2.0.0.
121 | *
122 | * \sa SDL_GetTouchFinger
123 | */
124 | extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID);
125 |
126 | /**
127 | * Get the finger object for specified touch device ID and finger index.
128 | *
129 | * The returned resource is owned by SDL and should not be deallocated.
130 | *
131 | * \param touchID the ID of the requested touch device
132 | * \param index the index of the requested finger
133 | * \returns a pointer to the SDL_Finger object or NULL if no object at the
134 | * given ID and index could be found.
135 | *
136 | * \since This function is available since SDL 2.0.0.
137 | *
138 | * \sa SDL_RecordGesture
139 | */
140 | extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index);
141 |
142 | /* Ends C function definitions when using C++ */
143 | #ifdef __cplusplus
144 | }
145 | #endif
146 | #include "close_code.h"
147 |
148 | #endif /* SDL_touch_h_ */
149 |
150 | /* vi: set ts=4 sw=4 expandtab: */
151 |
--------------------------------------------------------------------------------
/include/SDL_types.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2023 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_types.h
24 | *
25 | * \deprecated
26 | */
27 |
28 | /* DEPRECATED */
29 | #include "SDL_stdinc.h"
30 |
--------------------------------------------------------------------------------
/include/close_code.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2023 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file close_code.h
24 | *
25 | * This file reverses the effects of begin_code.h and should be included
26 | * after you finish any function and structure declarations in your headers
27 | */
28 |
29 | #ifndef SDL_begin_code_h
30 | #error close_code.h included without matching begin_code.h
31 | #endif
32 | #undef SDL_begin_code_h
33 |
34 | /* Reset structure packing at previous byte alignment */
35 | #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__)
36 | #ifdef __BORLANDC__
37 | #pragma nopackwarning
38 | #endif
39 | #pragma pack(pop)
40 | #endif /* Compiler needs structure packing set */
41 |
--------------------------------------------------------------------------------
/lib/cmake/SDL2/sdl2-config-version.cmake:
--------------------------------------------------------------------------------
1 | # sdl2 cmake project-config-version input for ./configure scripts
2 |
3 | set(PACKAGE_VERSION "2.28.4")
4 |
5 | if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
6 | set(PACKAGE_VERSION_COMPATIBLE FALSE)
7 | else()
8 | set(PACKAGE_VERSION_COMPATIBLE TRUE)
9 | if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
10 | set(PACKAGE_VERSION_EXACT TRUE)
11 | endif()
12 | endif()
13 |
--------------------------------------------------------------------------------
/lib/cmake/SDL2_image/sdl2_image-config-version.cmake:
--------------------------------------------------------------------------------
1 | # sdl2_image cmake project-config-version input for ./configure scripts
2 |
3 | set(PACKAGE_VERSION "@MAJOR_VERSION_MACRO@.@MINOR_VERSION_MACRO@.@MICRO_VERSION_MACRO@")
4 |
5 | if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
6 | set(PACKAGE_VERSION_COMPATIBLE FALSE)
7 | else()
8 | set(PACKAGE_VERSION_COMPATIBLE TRUE)
9 | if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
10 | set(PACKAGE_VERSION_EXACT TRUE)
11 | endif()
12 | endif()
13 |
14 |
--------------------------------------------------------------------------------
/lib/cmake/SDL2_image/sdl2_image-config.cmake:
--------------------------------------------------------------------------------
1 | # sdl2_image cmake project-config input for ./configure scripts
2 |
3 | include(FeatureSummary)
4 | set_package_properties(SDL2_image PROPERTIES
5 | URL "https://www.libsdl.org/projects/SDL_image/"
6 | DESCRIPTION "SDL_image is an image file loading library"
7 | )
8 |
9 | set(SDL2_image_FOUND TRUE)
10 |
11 | set(SDL2IMAGE_AVIF 0)
12 | set(SDL2IMAGE_BMP 1)
13 | set(SDL2IMAGE_GIF 1)
14 | set(SDL2IMAGE_JPG 1)
15 | set(SDL2IMAGE_JXL 0)
16 | set(SDL2IMAGE_LBM 1)
17 | set(SDL2IMAGE_PCX 1)
18 | set(SDL2IMAGE_PNG 1)
19 | set(SDL2IMAGE_PNM 1)
20 | set(SDL2IMAGE_QOI 1)
21 | set(SDL2IMAGE_SVG 1)
22 | set(SDL2IMAGE_TGA 1)
23 | set(SDL2IMAGE_TIF 0)
24 | set(SDL2IMAGE_XCF 1)
25 | set(SDL2IMAGE_XPM 1)
26 | set(SDL2IMAGE_XV 1)
27 | set(SDL2IMAGE_WEBP 0)
28 |
29 | set(SDL2IMAGE_JPG_SAVE 1)
30 | set(SDL2IMAGE_PNG_SAVE 1)
31 |
32 | set(SDL2IMAGE_VENDORED FALSE)
33 |
34 | set(SDL2IMAGE_BACKEND_IMAGEIO 0)
35 | set(SDL2IMAGE_BACKEND_STB 1)
36 | set(SDL2IMAGE_BACKEND_WIC 0)
37 |
38 | get_filename_component(prefix "${CMAKE_CURRENT_LIST_DIR}/../../.." ABSOLUTE)
39 | set(exec_prefix "${prefix}")
40 | set(bindir "${exec_prefix}/bin")
41 | set(includedir "${prefix}/include")
42 | set(libdir "${exec_prefix}/lib")
43 | set(_sdl2image_extra_static_libraries " ")
44 | string(STRIP "${_sdl2image_extra_static_libraries}" _sdl2image_extra_static_libraries)
45 |
46 | set(_sdl2image_bindir "${bindir}")
47 | set(_sdl2image_libdir "${libdir}")
48 | set(_sdl2image_incdir "${includedir}/SDL2")
49 |
50 | # Convert _sdl2image_extra_static_libraries to list and keep only libraries
51 | string(REGEX MATCHALL "(-[lm]([-a-zA-Z0-9._]+))|(-Wl,[^ ]*framework[^ ]*)" _sdl2image_extra_static_libraries "${_sdl2image_extra_static_libraries}")
52 | string(REGEX REPLACE "^-l" "" _sdl2image_extra_static_libraries "${_sdl2image_extra_static_libraries}")
53 | string(REGEX REPLACE ";-l" ";" _sdl2image_extra_static_libraries "${_sdl2image_extra_static_libraries}")
54 |
55 | unset(prefix)
56 | unset(exec_prefix)
57 | unset(bindir)
58 | unset(includedir)
59 | unset(libdir)
60 |
61 | include(CMakeFindDependencyMacro)
62 |
63 | if(NOT TARGET SDL2_image::SDL2_image)
64 | add_library(SDL2_image::SDL2_image SHARED IMPORTED)
65 | set_target_properties(SDL2_image::SDL2_image
66 | PROPERTIES
67 | INTERFACE_INCLUDE_DIRECTORIES "${_sdl2image_incdir}"
68 | COMPATIBLE_INTERFACE_BOOL "SDL2_SHARED"
69 | INTERFACE_SDL2_SHARED "ON"
70 | )
71 | if(WIN32)
72 | set_target_properties(SDL2_image::SDL2_image
73 | PROPERTIES
74 | IMPORTED_LOCATION "${_sdl2image_bindir}/SDL2_image.dll"
75 | IMPORTED_IMPLIB "${_sdl2image_libdir}/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2_image.dll${CMAKE_STATIC_LIBRARY_SUFFIX}"
76 | )
77 | else()
78 | set_target_properties(SDL2_image::SDL2_image
79 | PROPERTIES
80 | IMPORTED_LOCATION "${_sdl2image_libdir}/${CMAKE_SHARED_LIBRARY_PREFIX}SDL2_image${CMAKE_SHARED_LIBRARY_SUFFIX}"
81 | )
82 | endif()
83 | endif()
84 |
85 | if(NOT TARGET SDL2_image::SDL2_image-static)
86 | add_library(SDL2_image::SDL2_image-static STATIC IMPORTED)
87 |
88 | set_target_properties(SDL2_image::SDL2_image-static
89 | PROPERTIES
90 | INTERFACE_INCLUDE_DIRECTORIES "${_sdl2image_incdir}"
91 | IMPORTED_LOCATION "${_sdl2image_libdir}/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2_image${CMAKE_STATIC_LIBRARY_SUFFIX}"
92 | INTERFACE_LINK_LIBRARIES "${_sdl2image_extra_static_libraries}"
93 | )
94 | endif()
95 |
96 | unset(_sdl2image_extra_static_libraries)
97 | unset(_sdl2image_bindir)
98 | unset(_sdl2image_libdir)
99 | unset(_sdl2image_incdir)
100 |
--------------------------------------------------------------------------------
/lib/cmake/SDL2_ttf/sdl2_ttf-config-version.cmake:
--------------------------------------------------------------------------------
1 | # sdl2_ttf cmake project-config-version input for ./configure scripts
2 |
3 | set(PACKAGE_VERSION "2.20.2")
4 |
5 | if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
6 | set(PACKAGE_VERSION_COMPATIBLE FALSE)
7 | else()
8 | set(PACKAGE_VERSION_COMPATIBLE TRUE)
9 | if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
10 | set(PACKAGE_VERSION_EXACT TRUE)
11 | endif()
12 | endif()
13 |
--------------------------------------------------------------------------------
/lib/cmake/SDL2_ttf/sdl2_ttf-config.cmake:
--------------------------------------------------------------------------------
1 | # sdl2_ttf cmake project-config input for ./configure scripts
2 |
3 | include(FeatureSummary)
4 | set_package_properties(SDL2_ttf PROPERTIES
5 | URL "https://www.libsdl.org/projects/SDL_ttf/"
6 | DESCRIPTION "Support for TrueType (.ttf) font files with Simple Directmedia Layer"
7 | )
8 |
9 | set(SDL2_ttf_FOUND TRUE)
10 |
11 | set(SDL2TTF_HARFBUZZ 1)
12 | set(SDL2TTF_FREETYPE TRUE)
13 |
14 | set(SDL2TTF_VENDORED 1)
15 |
16 | set(SDL2TTF_SDL2_REQUIRED_VERSION 2.0.10)
17 |
18 | get_filename_component(prefix "${CMAKE_CURRENT_LIST_DIR}/../../.." ABSOLUTE)
19 | set(exec_prefix "${prefix}")
20 | set(bindir "${exec_prefix}/bin")
21 | set(includedir "${prefix}/include")
22 | set(libdir "${exec_prefix}/lib")
23 | set(_sdl2ttf_extra_static_libraries " -lusp10 -lgdi32 -lrpcrt4 -lusp10 -lgdi32 -lrpcrt4")
24 | string(STRIP "${_sdl2ttf_extra_static_libraries}" _sdl2ttf_extra_static_libraries)
25 |
26 | set(_sdl2ttf_bindir "${bindir}")
27 | set(_sdl2ttf_libdir "${libdir}")
28 | set(_sdl2ttf_incdir "${includedir}/SDL2")
29 |
30 | # Convert _sdl2ttf_extra_static_libraries to list and keep only libraries
31 | string(REGEX MATCHALL "(-[lm]([-a-zA-Z0-9._]+))|(-Wl,[^ ]*framework[^ ]*)" _sdl2ttf_extra_static_libraries "${_sdl2ttf_extra_static_libraries}")
32 | string(REGEX REPLACE "^-l" "" _sdl2ttf_extra_static_libraries "${_sdl2ttf_extra_static_libraries}")
33 | string(REGEX REPLACE ";-l" ";" _sdl2ttf_extra_static_libraries "${_sdl2ttf_extra_static_libraries}")
34 |
35 | unset(prefix)
36 | unset(exec_prefix)
37 | unset(bindir)
38 | unset(includedir)
39 | unset(libdir)
40 |
41 | include(CMakeFindDependencyMacro)
42 |
43 | if(NOT TARGET SDL2_ttf::SDL2_ttf)
44 | if(WIN32)
45 | set(_sdl2ttf_dll "${_sdl2ttf_bindir}/SDL2_ttf.dll")
46 | set(_sdl2ttf_imp "${_sdl2ttf_libdir}/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2_ttf.dll${CMAKE_STATIC_LIBRARY_SUFFIX}")
47 | if(EXISTS "${_sdl2ttf_dll}" AND EXISTS "${_sdl2ttf_imp}")
48 | add_library(SDL2_ttf::SDL2_ttf SHARED IMPORTED)
49 | set_target_properties(SDL2_ttf::SDL2_ttf
50 | PROPERTIES
51 | IMPORTED_LOCATION "${_sdl2ttf_dll}"
52 | IMPORTED_IMPLIB "${_sdl2ttf_imp}"
53 | )
54 | endif()
55 | unset(_sdl2ttf_dll)
56 | unset(_sdl2ttf_imp)
57 | else()
58 | set(_sdl2ttf_shl "${_sdl2ttf_libdir}/${CMAKE_SHARED_LIBRARY_PREFIX}SDL2_ttf${CMAKE_SHARED_LIBRARY_SUFFIX}")
59 | if(EXISTS "${_sdl2ttf_shl}")
60 | add_library(SDL2_ttf::SDL2_ttf SHARED IMPORTED)
61 | set_target_properties(SDL2_ttf::SDL2_ttf
62 | PROPERTIES
63 | IMPORTED_LOCATION "${_sdl2ttf_shl}"
64 | )
65 | endif()
66 | endif()
67 | if(TARGET SDL2_ttf::SDL2_ttf)
68 | set_target_properties(SDL2_ttf::SDL2_ttf
69 | PROPERTIES
70 | INTERFACE_INCLUDE_DIRECTORIES "${_sdl2ttf_incdir}"
71 | COMPATIBLE_INTERFACE_BOOL "SDL2_SHARED"
72 | INTERFACE_SDL2_SHARED "ON"
73 | )
74 | endif()
75 | endif()
76 |
77 | if(NOT TARGET SDL2_ttf::SDL2_ttf-static)
78 | set(_sdl2ttf_stl "${_sdl2ttf_libdir}/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2_ttf${CMAKE_STATIC_LIBRARY_SUFFIX}")
79 | if(EXISTS "${_sdl2ttf_stl}")
80 | add_library(SDL2_ttf::SDL2_ttf-static STATIC IMPORTED)
81 | set_target_properties(SDL2_ttf::SDL2_ttf-static
82 | PROPERTIES
83 | INTERFACE_INCLUDE_DIRECTORIES "${_sdl2ttf_incdir}"
84 | IMPORTED_LOCATION "${_sdl2ttf_stl}"
85 | INTERFACE_LINK_LIBRARIES "${_sdl2ttf_extra_static_libraries}"
86 | )
87 | endif()
88 | unset(_sdl2ttf_stl)
89 | endif()
90 |
91 | unset(_sdl2ttf_extra_static_libraries)
92 | unset(_sdl2ttf_bindir)
93 | unset(_sdl2ttf_libdir)
94 | unset(_sdl2ttf_incdir)
95 |
--------------------------------------------------------------------------------
/lib/libSDL2.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/lib/libSDL2.a
--------------------------------------------------------------------------------
/lib/libSDL2.dll.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/lib/libSDL2.dll.a
--------------------------------------------------------------------------------
/lib/libSDL2.la:
--------------------------------------------------------------------------------
1 | # libSDL2.la - a libtool library file
2 | # Generated by libtool (GNU libtool) 2.4.6
3 | #
4 | # Please DO NOT delete this file!
5 | # It is necessary for linking the library.
6 |
7 | # The name that we can dlopen(3).
8 | dlname='../bin/SDL2.dll'
9 |
10 | # Names of this library.
11 | library_names='libSDL2.dll.a'
12 |
13 | # The name of the static archive.
14 | old_library='libSDL2.a'
15 |
16 | # Linker flags that cannot go in dependency_libs.
17 | inherited_linker_flags=''
18 |
19 | # Libraries that this one depends upon.
20 | dependency_libs=' -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lsetupapi -lversion -luuid'
21 |
22 | # Names of additional weak libraries provided by this library
23 | weak_library_names=''
24 |
25 | # Version information for libSDL2.
26 | current=2800
27 | age=2800
28 | revision=4
29 |
30 | # Is this an already installed library?
31 | installed=yes
32 |
33 | # Should we warn about portability when linking against -modules?
34 | shouldnotlink=no
35 |
36 | # Files to dlopen/dlpreopen
37 | dlopen=''
38 | dlpreopen=''
39 |
40 | # Directory that this library needs to be installed in:
41 | libdir='/Users/valve/release/SDL2/SDL2-2.28.4/x86_64-w64-mingw32/lib'
42 |
--------------------------------------------------------------------------------
/lib/libSDL2_image.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/lib/libSDL2_image.a
--------------------------------------------------------------------------------
/lib/libSDL2_image.dll.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/lib/libSDL2_image.dll.a
--------------------------------------------------------------------------------
/lib/libSDL2_image.la:
--------------------------------------------------------------------------------
1 | # libSDL2_image.la - a libtool library file
2 | # Generated by ltmain.sh (GNU libtool) 2.2.6
3 | #
4 | # Please DO NOT delete this file!
5 | # It is necessary for linking the library.
6 |
7 | # The name that we can dlopen(3).
8 | dlname='../bin/SDL2_image.dll'
9 |
10 | # Names of this library.
11 | library_names='libSDL2_image.dll.a'
12 |
13 | # The name of the static archive.
14 | old_library='libSDL2_image.a'
15 |
16 | # Linker flags that can not go in dependency_libs.
17 | inherited_linker_flags=''
18 |
19 | # Libraries that this one depends upon.
20 | dependency_libs=' -L/usr/local/x86_64-w64-mingw32/lib -lmingw32 /usr/local/x86_64-w64-mingw32/lib/libSDL2.la -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lsetupapi -lversion -luuid'
21 |
22 | # Names of additional weak libraries provided by this library
23 | weak_library_names=''
24 |
25 | # Version information for libSDL2_image.
26 | current=600
27 | age=600
28 | revision=3
29 |
30 | # Is this an already installed library?
31 | installed=yes
32 |
33 | # Should we warn about portability when linking against -modules?
34 | shouldnotlink=no
35 |
36 | # Files to dlopen/dlpreopen
37 | dlopen=''
38 | dlpreopen=''
39 |
40 | # Directory that this library needs to be installed in:
41 | libdir='/Users/valve/release/SDL_image/SDL2_image-2.6.3/x86_64-w64-mingw32/lib'
42 |
--------------------------------------------------------------------------------
/lib/libSDL2_test.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/lib/libSDL2_test.a
--------------------------------------------------------------------------------
/lib/libSDL2_test.la:
--------------------------------------------------------------------------------
1 | # libSDL2_test.la - a libtool library file
2 | # Generated by libtool (GNU libtool) 2.4.6
3 | #
4 | # Please DO NOT delete this file!
5 | # It is necessary for linking the library.
6 |
7 | # The name that we can dlopen(3).
8 | dlname=''
9 |
10 | # Names of this library.
11 | library_names=''
12 |
13 | # The name of the static archive.
14 | old_library='libSDL2_test.a'
15 |
16 | # Linker flags that cannot go in dependency_libs.
17 | inherited_linker_flags=''
18 |
19 | # Libraries that this one depends upon.
20 | dependency_libs=''
21 |
22 | # Names of additional weak libraries provided by this library
23 | weak_library_names=''
24 |
25 | # Version information for libSDL2_test.
26 | current=0
27 | age=0
28 | revision=0
29 |
30 | # Is this an already installed library?
31 | installed=yes
32 |
33 | # Should we warn about portability when linking against -modules?
34 | shouldnotlink=no
35 |
36 | # Files to dlopen/dlpreopen
37 | dlopen=''
38 | dlpreopen=''
39 |
40 | # Directory that this library needs to be installed in:
41 | libdir='/Users/valve/release/SDL2/SDL2-2.28.4/x86_64-w64-mingw32/lib'
42 |
--------------------------------------------------------------------------------
/lib/libSDL2_ttf.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/lib/libSDL2_ttf.a
--------------------------------------------------------------------------------
/lib/libSDL2_ttf.dll.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/lib/libSDL2_ttf.dll.a
--------------------------------------------------------------------------------
/lib/libSDL2_ttf.la:
--------------------------------------------------------------------------------
1 | # libSDL2_ttf.la - a libtool library file
2 | # Generated by ltmain.sh (GNU libtool) 2.2.6
3 | #
4 | # Please DO NOT delete this file!
5 | # It is necessary for linking the library.
6 |
7 | # The name that we can dlopen(3).
8 | dlname='../bin/SDL2_ttf.dll'
9 |
10 | # Names of this library.
11 | library_names='libSDL2_ttf.dll.a'
12 |
13 | # The name of the static archive.
14 | old_library='libSDL2_ttf.a'
15 |
16 | # Linker flags that can not go in dependency_libs.
17 | inherited_linker_flags=''
18 |
19 | # Libraries that this one depends upon.
20 | dependency_libs=' -lusp10 -lrpcrt4 -L/usr/local/x86_64-w64-mingw32/lib /usr/local/x86_64-w64-mingw32/lib/libSDL2.la -ldinput8 -ldxguid -ldxerr8 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lsetupapi -lversion -luuid /opt/homebrew/Cellar/mingw-w64/10.0.0_4/toolchain-x86_64/x86_64-w64-mingw32/lib/../lib/libstdc++.la'
21 |
22 | # Names of additional weak libraries provided by this library
23 | weak_library_names=''
24 |
25 | # Version information for libSDL2_ttf.
26 | current=2000
27 | age=2000
28 | revision=2
29 |
30 | # Is this an already installed library?
31 | installed=yes
32 |
33 | # Should we warn about portability when linking against -modules?
34 | shouldnotlink=no
35 |
36 | # Files to dlopen/dlpreopen
37 | dlopen=''
38 | dlpreopen=''
39 |
40 | # Directory that this library needs to be installed in:
41 | libdir='/Users/valve/release/SDL_ttf/SDL2_ttf-2.20.2/x86_64-w64-mingw32/lib'
42 |
--------------------------------------------------------------------------------
/lib/libSDL2main.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/lib/libSDL2main.a
--------------------------------------------------------------------------------
/lib/libSDL2main.la:
--------------------------------------------------------------------------------
1 | # libSDL2main.la - a libtool library file
2 | # Generated by libtool (GNU libtool) 2.4.6
3 | #
4 | # Please DO NOT delete this file!
5 | # It is necessary for linking the library.
6 |
7 | # The name that we can dlopen(3).
8 | dlname=''
9 |
10 | # Names of this library.
11 | library_names=''
12 |
13 | # The name of the static archive.
14 | old_library='libSDL2main.a'
15 |
16 | # Linker flags that cannot go in dependency_libs.
17 | inherited_linker_flags=''
18 |
19 | # Libraries that this one depends upon.
20 | dependency_libs=''
21 |
22 | # Names of additional weak libraries provided by this library
23 | weak_library_names=''
24 |
25 | # Version information for libSDL2main.
26 | current=0
27 | age=0
28 | revision=0
29 |
30 | # Is this an already installed library?
31 | installed=yes
32 |
33 | # Should we warn about portability when linking against -modules?
34 | shouldnotlink=no
35 |
36 | # Files to dlopen/dlpreopen
37 | dlopen=''
38 | dlpreopen=''
39 |
40 | # Directory that this library needs to be installed in:
41 | libdir='/Users/valve/release/SDL2/SDL2-2.28.4/x86_64-w64-mingw32/lib'
42 |
--------------------------------------------------------------------------------
/lib/pkgconfig/SDL2_image.pc:
--------------------------------------------------------------------------------
1 | prefix=/x86_64-w64-mingw32
2 | exec_prefix=${prefix}
3 | libdir=${exec_prefix}/lib
4 | includedir=${prefix}/include
5 |
6 | Name: SDL2_image
7 | Description: image loading library for Simple DirectMedia Layer
8 | Version: 2.6.3
9 | Requires: sdl2 >= 2.0.9
10 | Libs: -L${libdir} -lSDL2_image
11 | Requires.private:
12 | Libs.private:
13 | Cflags: -I${includedir}/SDL2
14 |
15 |
--------------------------------------------------------------------------------
/lib/pkgconfig/SDL2_ttf.pc:
--------------------------------------------------------------------------------
1 | prefix=/x86_64-w64-mingw32
2 | exec_prefix=${prefix}
3 | libdir=${exec_prefix}/lib
4 | includedir=${prefix}/include
5 |
6 | Name: SDL2_ttf
7 | Description: ttf library for Simple DirectMedia Layer with FreeType 2 support
8 | Version: 2.20.2
9 | Requires: sdl2 >= 2.0.10
10 | Libs: -L${libdir} -lSDL2_ttf
11 | Cflags: -I${includedir}/SDL2
12 | Requires.private:
13 | Libs.private: -lusp10 -lgdi32 -lrpcrt4
14 |
--------------------------------------------------------------------------------
/lib/pkgconfig/sdl2.pc:
--------------------------------------------------------------------------------
1 | # sdl pkg-config source file
2 |
3 | prefix=/x86_64-w64-mingw32
4 | exec_prefix=${prefix}
5 | libdir=${exec_prefix}/lib
6 | includedir=${prefix}/include
7 |
8 | Name: sdl2
9 | Description: Simple DirectMedia Layer is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer.
10 | Version: 2.28.4
11 | Requires.private:
12 | Conflicts:
13 | Libs: -L${libdir} -lmingw32 -lSDL2main -lSDL2 -mwindows
14 | Libs.private: -Wl,--dynamicbase -Wl,--nxcompat -Wl,--high-entropy-va -lm -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lsetupapi -lversion -luuid
15 | Cflags: -I${includedir} -I${includedir}/SDL2 -Dmain=SDL_main
16 |
--------------------------------------------------------------------------------
/media/$05151959.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/media/$05151959.gif
--------------------------------------------------------------------------------
/media/commandbar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/media/commandbar.png
--------------------------------------------------------------------------------
/media/interface.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/media/interface.png
--------------------------------------------------------------------------------
/res/atlas.aseprite:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/res/atlas.aseprite
--------------------------------------------------------------------------------
/res/font/arial.TTF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/res/font/arial.TTF
--------------------------------------------------------------------------------
/res/font/jetbrains.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/res/font/jetbrains.ttf
--------------------------------------------------------------------------------
/res/font/pixolleta.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/res/font/pixolleta.ttf
--------------------------------------------------------------------------------
/res/icon/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/res/icon/icon.ico
--------------------------------------------------------------------------------
/res/icon/icon.rc:
--------------------------------------------------------------------------------
1 | id ICON "icon.ico"
--------------------------------------------------------------------------------
/res/icon/icon.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/res/icon/icon.res
--------------------------------------------------------------------------------
/res/logo.aseprite:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/res/logo.aseprite
--------------------------------------------------------------------------------
/res/main.aseprite:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/res/main.aseprite
--------------------------------------------------------------------------------
/res/main_scene.aseprite:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/res/main_scene.aseprite
--------------------------------------------------------------------------------
/res/new_scene.aseprite:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/res/new_scene.aseprite
--------------------------------------------------------------------------------
/res/sprites/Slice 1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/res/sprites/Slice 1.png
--------------------------------------------------------------------------------
/res/sprites/core/logger.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/res/sprites/core/logger.png
--------------------------------------------------------------------------------
/res/sprites/core/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/res/sprites/core/logo.png
--------------------------------------------------------------------------------
/res/sprites/file.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/res/sprites/file.png
--------------------------------------------------------------------------------
/res/sprites/file_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/res/sprites/file_selected.png
--------------------------------------------------------------------------------
/res/sprites/folder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/res/sprites/folder.png
--------------------------------------------------------------------------------
/res/sprites/folder_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/res/sprites/folder_selected.png
--------------------------------------------------------------------------------
/res/sprites/hover.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/res/sprites/hover.png
--------------------------------------------------------------------------------
/res/sprites/main_scene.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/res/sprites/main_scene.png
--------------------------------------------------------------------------------
/res/sprites/new_file.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/res/sprites/new_file.png
--------------------------------------------------------------------------------
/res/sprites/ready_bar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/res/sprites/ready_bar.png
--------------------------------------------------------------------------------
/res/sprites/stop_bar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/res/sprites/stop_bar.png
--------------------------------------------------------------------------------
/res/sprites/stop_vfx.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/res/sprites/stop_vfx.png
--------------------------------------------------------------------------------
/res/spritesheet.aseprite:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/res/spritesheet.aseprite
--------------------------------------------------------------------------------
/scripts_dlls/SDL2.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/scripts_dlls/SDL2.dll
--------------------------------------------------------------------------------
/scripts_dlls/SDL2_image.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/scripts_dlls/SDL2_image.dll
--------------------------------------------------------------------------------
/scripts_dlls/SDL2_ttf.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigasdev/X-Gif-Maker/876258782a284a92d96323014ee0d3ddf49e0742/scripts_dlls/SDL2_ttf.dll
--------------------------------------------------------------------------------
/scripts_dlls/installer.nsi:
--------------------------------------------------------------------------------
1 | ; Set the name of your application
2 | Name "Twitter-Gif-Maker"
3 |
4 | ; Set the default installation directory (e.g., Program Files)
5 | InstallDir "$PROGRAMFILES\Twitter-Gif-Maker"
6 |
7 | ; Define the components
8 | Section "Twitter-Gif-Maker" SEC01
9 | ; Set output path to the installation directory
10 | SetOutPath $INSTDIR
11 |
12 | ; Add all files and subdirectories from your source folder
13 | File /r "C:\Users\Escritorio2\Documents\.code\twitter-gif-maker-fortress\.release\*.*"
14 |
15 | ; Create a desktop shortcut (optional)
16 | CreateShortCut "$DESKTOP\Twitter-Gif-Maker.lnk" "$INSTDIR\Twitter-Gif-Maker.exe"
17 |
18 | ; Optional: Add an uninstaller
19 | WriteUninstaller "$INSTDIR\Uninstall.exe"
20 |
21 | Exec "$INSTDIR\Twitter-Gif-Maker.exe"
22 | SectionEnd
23 |
24 | ; Optional: Uninstaller section
25 | Section "Uninstall"
26 | ; Remove installed files and shortcuts
27 | Delete "$INSTDIR\YourApp.exe"
28 | Delete "$SMPROGRAMS\YourAppName.lnk"
29 | Delete "$DESKTOP\YourAppName.lnk"
30 |
31 | ; Remove installation directory and all its contents
32 | RMDir /r "$INSTDIR"
33 |
34 | ; Remove uninstaller
35 | Delete "$INSTDIR\Uninstall.exe"
36 | SectionEnd
--------------------------------------------------------------------------------
/scripts_dlls/setup.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | mkdir bin
4 | mkdir .build
5 | mkdir .release
6 |
7 | xcopy "SDL2.dll" ".build"
8 | xcopy "SDL2_image.dll" ".build" /i
9 | xcopy "SDL2_ttf.dll" ".build" /i
10 | xcopy "libwinpthread-1.dll" ".build" /i
11 | xcopy "res" ".build/res/" /i /e /y
12 |
13 | xcopy "SDL2.dll" ".release" /i
14 | xcopy "SDL2_image.dll" ".release" /i
15 | xcopy "SDL2_ttf.dll" ".release" /i
16 | xcopy "libwinpthread-1.dll" ".release" /i
17 | xcopy "res" ".release/res/" /i /e /y
--------------------------------------------------------------------------------
/scripts_dlls/ship.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | rem you could also remove the line above, because it might help you to see what happens
3 |
4 | rem /i option is needed to avoid the batch file asking you whether destination folder is a file or a folder
5 | rem /e option is needed to copy also all folders and subfolders
6 | rem /y
7 |
8 | del /Q "bin\*"
9 | xcopy "SDL2.dll" ".release" /i /y
10 | xcopy "SDL2_image.dll" ".release" /i /y
11 | xcopy "SDL2_ttf.dll" ".release" /i /y
12 | xcopy "libwinpthread-1.dll" ".release" /i /y
13 | xcopy "res" ".release/res/" /i /e /y
14 | mingw32-make build DEBUG=false
15 | del /Q "bin\*"
16 | echo Build successful
17 | timeout /t 3
--------------------------------------------------------------------------------
/scripts_dlls/update_res.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | xcopy "res" ".build/res/" /i /e /y
4 | xcopy "res" ".release/res/" /i /e /y
--------------------------------------------------------------------------------
/scripts_dlls/windows_installer_translations.nsi:
--------------------------------------------------------------------------------
1 | ;At start will be searched if the current system language is in this list,
2 | ;if not the first language in this list will be chosen as language
3 | !insertmacro MUI_LANGUAGE "English"
4 | !insertmacro MUI_LANGUAGE "PortugueseBR"
5 |
6 | ;Language strings
7 |
8 | LangString LangStringSecMainComponentName ${LANG_ENGLISH} "Twitter-Gif-Maker"
9 | LangString LangStringSecMainComponentName ${LANG_PortugueseBR} "Twitter-Gif-Maker"
10 |
11 | LangString LangStringSecMainComponentDescription ${LANG_ENGLISH} "Encode and convert videos to gif to use on twitter with ffmpeg"
12 | LangString LangStringSecMainComponentDescription ${LANG_PortugueseBR} "Codifique e converta vídeos para gif para usar no twitter com ffmpeg"
13 |
14 | LangString LangStringSecOptionalComponentName ${LANG_ENGLISH} "Start Menu Shortcuts"
15 | LangString LangStringSecOptionalComponentName ${LANG_PortugueseBR} "Atalhos no menu iniciar"
16 |
17 | LangString LangStringSecOptionalComponentDescription ${LANG_ENGLISH} "Create shortcuts in the start menu"
18 | LangString LangStringSecOptionalComponentDescription ${LANG_PortugueseBR} "Crie atalhos no menu iniciar"
19 |
20 | LangString LangStringUninstallLink ${LANG_ENGLISH} "Uninstall"
21 | LangString LangStringUninstallLink ${LANG_PortugueseBR} "Desinstalar"
22 |
23 | LangString LangStringStartMenuLink ${LANG_ENGLISH} "Twitter-Gif-Maker"
24 | LangString LangStringStartMenuLink ${LANG_PortugueseBR} "Twitter-Gif-Maker"
25 |
26 |
27 | LangString LangStringCustomPageOtherOptionsTitle ${LANG_ENGLISH} "Other Options"
28 | LangString LangStringCustomPageOtherOptionsTitle ${LANG_PortugueseBR} "Outras opções"
29 |
30 | LangString LangStringCustomPageOtherOptionsSubTitle ${LANG_ENGLISH} "Select other options"
31 | LangString LangStringCustomPageOtherOptionsSubTitle ${LANG_PortugueseBR} "Selecione outras opções"
32 |
33 | LangString LangStringCustomPageOtherOptionsCheckboxOpenInstallDir ${LANG_ENGLISH} "Open the install directory"
34 | LangString LangStringCustomPageOtherOptionsCheckboxOpenInstallDir ${LANG_PortugueseBR} "Abra o diretório de instalação"
35 |
36 | LangString LangStringCustomPageOtherOptionsCheckboxOpenWebsite ${LANG_ENGLISH} "Launch the application"
37 | LangString LangStringCustomPageOtherOptionsCheckboxOpenWebsite ${LANG_PortugueseBR} "Iniciar o aplicativo"
--------------------------------------------------------------------------------
/settings.ini:
--------------------------------------------------------------------------------
1 | [Files]
2 | Last opened=C:\Users\Latitude 5480\Documents\.code\Trekton\.build\datatest.ini
3 | Last opened =C:\Users\Latitude 5480\Documents\.code\Trekton\.build\datatest.ini
4 | Last opened :=C:\Users\Latitude 5480\Downloads\data.ini
5 |
--------------------------------------------------------------------------------
/src/Core/App.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "SDL.h"
4 | #include "../Resources/Resources.hpp"
5 | #include
6 | #include "Assert.h"
7 | #include "IniHandler.hpp"
8 | #include "../Renderer/Atlas.hpp"
9 |
10 | class Scene;
11 | //global variables
12 | extern bool debug_mode;
13 |
14 | class App {
15 |
16 | public:
17 |
18 | App();
19 | ~App();
20 |
21 | void init(const char* title, uint32_t xpos, uint32_t ypos, uint32_t width, uint32_t height, bool fullscreen, bool splash_screen);
22 | void load();
23 | void handle_events();
24 | void update(double deltaTime);
25 | void render();
26 | void clean();
27 |
28 | //Functionality
29 | void change_scene(Scene* scene);
30 | void change_to_next_scene();
31 |
32 | //Util methods
33 | void change_background_color(vec3f color);
34 |
35 | //Local getters
36 | vec2f get_window_size();
37 |
38 | //System methods
39 | float get_fps();
40 | void set_fps(float fps);
41 | bool running();
42 |
43 | //Getters
44 | SDL_Window* get_window();
45 | SDL_Renderer* get_renderer();
46 | Resources* get_resources();
47 | Atlas* get_atlas();
48 | IniHandler* get_ini_handler();
49 | TTF_Font* get_main_font();
50 |
51 |
52 | private:
53 | bool m_is_running = false;
54 | bool m_is_loaded = false;
55 | bool m_has_splash_screen = true;
56 |
57 | SDL_Window* m_window = nullptr;
58 | SDL_Renderer* m_renderer = nullptr;
59 | Resources* m_resources_ptr = nullptr;
60 | Atlas* m_atlas_ptr = nullptr;
61 | IniHandler* m_ini_handler_ptr = nullptr;
62 |
63 | //Local
64 | vec2f m_window_size = vec2f(0,0);
65 | vec3f m_window_color = vec3f(26, 25, 50);
66 |
67 | //System
68 | int m_fps = 0;
69 | };
--------------------------------------------------------------------------------
/src/Core/Assert.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | #ifdef F_ENABLE_DEBUG
6 | #endif
7 |
8 | #ifdef F_ENABLE_ASSERTS
9 | #define F_ASSERT(x) { \
10 | if(!(x)){ \
11 | std::cerr << "Assertion Failed: " << #x << std::endl; \
12 | __debugbreak(); \
13 | }\
14 | }
15 | #define F_TEST(x) { std::cerr << "Test: " << #x << std::endl; }
16 | #else
17 | #define F_ASSERT(x)
18 | #define F_TEST(x)
19 | #endif
--------------------------------------------------------------------------------
/src/Core/DataLoader.cpp:
--------------------------------------------------------------------------------
1 | #include "DataLoader.hpp"
2 |
3 | const char *Data_Loader::load_file(const char *filter)
4 | {
5 | char const * lFilterPatterns[1]={filter};
6 | auto file = tinyfd_openFileDialog("Open File", NULL, 1, lFilterPatterns, NULL, 0);
7 |
8 | if (!file) {
9 | std::cout << "No file selected" << std::endl;
10 | return "";
11 | }
12 |
13 | return file;
14 | }
15 |
16 | const char *Data_Loader::load_folder(const char *title)
17 | {
18 | auto folder = tinyfd_selectFolderDialog(title, SDL_GetBasePath());
19 |
20 | if (!folder) {
21 | std::cout << "No folder selected" << std::endl;
22 | return "";
23 | }
24 |
25 | return folder;
26 | }
27 |
--------------------------------------------------------------------------------
/src/Core/DataLoader.hpp:
--------------------------------------------------------------------------------
1 | #ifndef __DATA_LOADER__
2 | #define __DATA_LOADER__
3 |
4 | #include "../ImGui/tinyfiledialogs.h"
5 | #include "SDL.h"
6 |
7 | #include
8 | #include
9 | #include
10 |
11 | namespace Data_Loader{
12 | const char* load_file(const char* filter);
13 | const char* load_folder(const char* title);
14 | }
15 |
16 | #endif
--------------------------------------------------------------------------------
/src/Core/IniHandler.cpp:
--------------------------------------------------------------------------------
1 | #include "IniHandler.hpp"
2 |
3 | #include "Assert.h"
4 |
5 | IniHandler::IniHandler()
6 | {
7 | std::cout << "INFO: Started IniHandler\n";
8 | }
9 |
10 | IniHandler::~IniHandler()
11 | {
12 | }
13 |
14 | void IniHandler::load_ini_files(std::string path)
15 | {
16 | ini::IniFile file;
17 |
18 | file.load(path);
19 |
20 | for(const auto& sectionPair : file){
21 | if(sectionPair.first == "config")continue;
22 |
23 | IniData data;
24 | data.fileName = path;
25 | data.name = sectionPair.first;
26 |
27 |
28 | std::unordered_map fieldMap = {
29 | {"fileName", data.fileName},
30 | {"relative_x", std::to_string(data.relative_x)},
31 | {"relative_y", std::to_string(data.relative_y)},
32 | {"relative_name", data.relative_name},
33 | };
34 |
35 | for(auto& [key,val] : sectionPair.second){
36 |
37 | if(fieldMap.count(key) > 0) {
38 | fieldMap[key] = val.as();
39 | }
40 | }
41 |
42 | data.fileName = fieldMap["fileName"];
43 | data.relative_x = std::stoi(fieldMap["relative_x"]);
44 | data.relative_y = std::stoi(fieldMap["relative_y"]);
45 | data.relative_name = fieldMap["relative_name"];
46 |
47 | F_ASSERT(data.name != "");
48 | ini_files.push_back(data);
49 | }
50 | }
51 |
52 | void IniHandler::update_ini_files()
53 | {
54 | if(ini_files.size() == 0)return;
55 |
56 | ini::IniFile file;
57 |
58 | file.load("config.ini");
59 |
60 | if(file["config"]["lastWriteTime"].as() != std::to_string(std::filesystem::last_write_time("config.ini").time_since_epoch().count())){
61 |
62 | for(auto& ini : ini_files){
63 | if(ini.name == "")continue;
64 |
65 | ini.name = file[ini.name]["name"].as();
66 | ini.relative_x = file[ini.name]["relative_x"].as();
67 | ini.relative_y = file[ini.name]["relative_y"].as();
68 | ini.relative_name = file[ini.name]["relative_name"].as();
69 |
70 | update_ini_file(ini);
71 | }
72 |
73 | file["config"]["lastWriteTime"] = std::to_string(std::filesystem::last_write_time("config.ini").time_since_epoch().count());
74 | file.save("config.ini");
75 | }
76 | }
77 |
78 | void IniHandler::update_ini_file(IniData data)
79 | {
80 | F_ASSERT(data.name != "");
81 | ini::IniFile file;
82 |
83 | if(data.name == "")return;
84 |
85 | file.load(data.fileName);
86 |
87 | file[data.name];
88 | file[data.name]["name"] = data.name;
89 | file[data.name]["fileName"] = data.fileName;
90 | file[data.name]["relative_x"] = std::to_string(data.relative_x);
91 | file[data.name]["relative_y"] = std::to_string(data.relative_y);
92 | file[data.name]["relative_name"] = data.relative_name;
93 |
94 | file.save(data.fileName);
95 | }
96 |
97 | void IniHandler::create_ini_file(IniData data, std::string path)
98 | {
99 | F_ASSERT(data.name != "");
100 |
101 | ini::IniFile file;
102 |
103 | std::cout << "INFO: Creating ini file " << path << data.name << "\n";
104 |
105 | file.load(path);
106 |
107 | file[data.name];
108 | file[data.name]["name"] = data.name;
109 | file[data.name]["fileName"] = data.fileName;
110 | file[data.name]["relative_x"] = std::to_string(data.relative_x);
111 | file[data.name]["relative_y"] = std::to_string(data.relative_y);
112 | file[data.name]["relative_name"] = data.relative_name;
113 |
114 | if(ini_files.size() > 0){
115 | file["config"]["lastWriteTime"] = std::to_string(std::filesystem::last_write_time(data.fileName).time_since_epoch().count());
116 | }
117 |
118 | file.save(path);
119 | ini_files.push_back(data);
120 | }
121 |
122 | IniData* IniHandler::get_ini_data(std::string name)
123 | {
124 | for(auto& ini : ini_files){
125 | if(ini.name == name){
126 | return &ini;
127 | }
128 | }
129 |
130 | IniData data;
131 | data.fileName = "config.ini";
132 | data.name = name;
133 |
134 | create_ini_file(data, "config.ini");
135 |
136 | return &data;
137 | }
138 |
--------------------------------------------------------------------------------
/src/Core/IniHandler.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #ifndef INIHANDLER_HPP
4 | #define INIHANDLER_HPP
5 |
6 | #include "../Utils/inicpp.h"
7 | #include "../Utils/Common.hpp"
8 |
9 | #include
10 | #include
11 | #include
12 | #include