├── .gitattributes
├── .github
└── workflows
│ └── doxygen.yml
├── .gitignore
├── .gitmodules
├── .vscode
├── c_cpp_properties.json
├── launch.json
├── settings.json
└── tasks.json
├── BUILDING.md
├── CMakeLists.txt
├── Doxyfile
├── Makefile
├── README.md
├── assets
├── images
│ ├── logo
│ │ ├── logo.png
│ │ ├── logoBlue.png
│ │ ├── logoC.png
│ │ ├── logoCyan.png
│ │ ├── logoGreen.png
│ │ ├── logoRed.png
│ │ └── logoYellow.png
│ └── ui
│ │ └── cursor.png
└── sounds
│ ├── flixel.mp3
│ └── flixel.ogg
├── examples
├── Makefile
├── State.hpp
├── assets
│ ├── Saul.png
│ └── troll.png
├── main.cpp
└── to check memory leaks.txt
├── include
└── flixel++
│ ├── Common.hpp
│ ├── FlxAnimation.hpp
│ ├── FlxAssets.hpp
│ ├── FlxBackends.hpp
│ ├── FlxBasic.hpp
│ ├── FlxColor.hpp
│ ├── FlxG.hpp
│ ├── FlxGame.hpp
│ ├── FlxGraphic.hpp
│ ├── FlxGroup.hpp
│ ├── FlxHttp.hpp
│ ├── FlxKeyboard.hpp
│ ├── FlxLog.hpp
│ ├── FlxMacros.hpp
│ ├── FlxManagers.hpp
│ ├── FlxMouse.hpp
│ ├── FlxNet.hpp
│ ├── FlxObject.hpp
│ ├── FlxPoint.hpp
│ ├── FlxRect.hpp
│ ├── FlxScript.hpp
│ ├── FlxSound.hpp
│ ├── FlxSplash.hpp
│ ├── FlxSprite.hpp
│ ├── FlxState.hpp
│ ├── FlxText.hpp
│ ├── FlxUtils.hpp
│ ├── SDL_Backports.hpp
│ └── platform
│ ├── 3ds.h
│ ├── pc.h
│ ├── platform.h
│ └── wii.h
├── mk
├── 3ds.mk
├── FindGLEW.cmake
├── FindGLFW.cmake
├── FindLibVorbisfile.cmake
├── FindSDL2_image.cmake
├── FindSDL2_ttf.cmake
├── FindSDL_image.cmake
├── FindSDL_ttf.cmake
├── FindSOIL.cmake
├── pc.mk
├── switch.mk
└── wii.mk
├── source
├── FlxAnimation.cpp
├── FlxAssets.cpp
├── FlxBackends.cpp
├── FlxBasic.cpp
├── FlxColor.cpp
├── FlxGame.cpp
├── FlxGraphic.cpp
├── FlxGroup.cpp
├── FlxHttp.cpp
├── FlxKeyboard.cpp
├── FlxLog.cpp
├── FlxManagers.cpp
├── FlxMouse.cpp
├── FlxNet.cpp
├── FlxObject.cpp
├── FlxPoint.cpp
├── FlxRect.cpp
├── FlxScript.cpp
├── FlxSound.cpp
├── FlxSplash.cpp
├── FlxSprite.cpp
├── FlxState.cpp
├── FlxText.cpp
├── FlxUtils.cpp
├── SDL_Backports.cpp
└── assets
│ ├── cursor.h
│ ├── flixel.h
│ ├── logoBlue.h
│ ├── logoC.h
│ ├── logoCyan.h
│ ├── logoGreen.h
│ ├── logoRed.h
│ ├── logoYellow.h
│ └── vcr.h
└── workflows
└── doxygen.yml
/.gitattributes:
--------------------------------------------------------------------------------
1 | source/assets/* linguist-vendored
2 | mk/*.cmake linguist-vendored
--------------------------------------------------------------------------------
/.github/workflows/doxygen.yml:
--------------------------------------------------------------------------------
1 | name: Doxygen GitHub Pages Deploy Action
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 |
8 | jobs:
9 | deploy:
10 | runs-on: ubuntu-latest
11 | steps:
12 | - uses: DenverCoder1/doxygen-github-pages-action@v1.2.0
13 | with:
14 | github_token: ${{ secrets.GITHUB_TOKEN }}
15 | branch: gh-pages
16 | folder: docs/html
17 | config_file: Doxyfile
18 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | obj/
2 | build/
3 | include/flixel++/Test.hpp
4 | source/main.cpp
5 | release/
6 | debug/
7 | examples/example
8 | .vscode/*.log
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "bundles/tinyxml2"]
2 | path = bundles/tinyxml2
3 | url = https://github.com/leethomason/tinyxml2
4 |
--------------------------------------------------------------------------------
/.vscode/c_cpp_properties.json:
--------------------------------------------------------------------------------
1 | {
2 | "configurations": [
3 | {
4 | "name": "Linux",
5 | "includePath": [
6 | "${workspaceFolder}/include",
7 | "/opt/devkitpro/portlibs/ppc/include",
8 | "/opt/devkitpro/libctru/include"
9 | ],
10 | "defines": ["FLIXEL_SDL"],
11 | "compilerPath": "/usr/bin/clang",
12 | "cStandard": "c17",
13 | "cppStandard": "c++14",
14 | "intelliSenseMode": "linux-clang-x64",
15 | "configurationProvider": "ms-vscode.makefile-tools"
16 | }
17 | ],
18 | "version": 4
19 | }
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": "(gdb) Launch",
9 | "type": "cppdbg",
10 | "request": "launch",
11 | "program": "${workspaceFolder}/examples/example",
12 | "args": [],
13 | "stopAtEntry": false,
14 | "cwd": "${workspaceFolder}",
15 | "environment": [{
16 | "name": "LD_LIBRARY_PATH",
17 | "value": "${workspaceFolder}/build"
18 | }],
19 | "externalConsole": false,
20 | "MIMode": "gdb",
21 | "setupCommands": [
22 | {
23 | "description": "Enable pretty-printing for gdb",
24 | "text": "-enable-pretty-printing",
25 | "ignoreFailures": true
26 | },
27 | {
28 | "description": "Set Disassembly Flavor to Intel",
29 | "text": "-gdb-set disassembly-flavor intel",
30 | "ignoreFailures": true
31 | }
32 | ]
33 | }
34 |
35 | ]
36 | }
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "makefile.extensionOutputFolder": "./.vscode",
3 | "files.associations": {
4 | "ostream": "cpp",
5 | "*.tcc": "cpp",
6 | "cctype": "cpp",
7 | "clocale": "cpp",
8 | "cmath": "cpp",
9 | "compare": "cpp",
10 | "concepts": "cpp",
11 | "cstdint": "cpp",
12 | "cstdio": "cpp",
13 | "cstdlib": "cpp",
14 | "cwchar": "cpp",
15 | "cwctype": "cpp",
16 | "map": "cpp",
17 | "vector": "cpp",
18 | "exception": "cpp",
19 | "initializer_list": "cpp",
20 | "iosfwd": "cpp",
21 | "iostream": "cpp",
22 | "istream": "cpp",
23 | "limits": "cpp",
24 | "new": "cpp",
25 | "numbers": "cpp",
26 | "stdexcept": "cpp",
27 | "streambuf": "cpp",
28 | "string": "cpp",
29 | "string_view": "cpp",
30 | "system_error": "cpp",
31 | "tuple": "cpp",
32 | "type_traits": "cpp",
33 | "typeinfo": "cpp",
34 | "array": "cpp",
35 | "bit": "cpp",
36 | "unordered_map": "cpp",
37 | "functional": "cpp",
38 | "numeric": "cpp",
39 | "utility": "cpp"
40 | },
41 | "cmake.configureOnOpen": true
42 | }
--------------------------------------------------------------------------------
/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | "tasks": [
3 | {
4 | "type": "cppbuild",
5 | "label": "C/C++: g++ build active file",
6 | "command": "/usr/bin/g++",
7 | "args": [
8 | "-fdiagnostics-color=always",
9 | "-g",
10 | "${file}",
11 | "-o",
12 | "${fileDirname}/${fileBasenameNoExtension}"
13 | ],
14 | "options": {
15 | "cwd": "${fileDirname}"
16 | },
17 | "problemMatcher": [
18 | "$gcc"
19 | ],
20 | "group": {
21 | "kind": "build",
22 | "isDefault": true
23 | },
24 | "detail": "Task generated by Debugger."
25 | }
26 | ],
27 | "version": "2.0.0"
28 | }
--------------------------------------------------------------------------------
/BUILDING.md:
--------------------------------------------------------------------------------
1 | # PC
2 | ## Linux
3 | You will need the following dependencies:
4 | - SDL2
5 | - SDL2_image
6 | - SDL2_ttf
7 | - OpenAL
8 | - libvorbis
9 | - gcc
10 | - make
11 | - cmake
12 |
13 | 1. Run ``make pc``
14 | 1.1. Run ``make pc PLATFORM=1`` for compiling with SDL 1.2
15 | 1.2. Run ``make pc PLATFORM=2`` for compiling with SDL 2
16 | 1.3. Run ``make pc PLATFORM=3`` for compiling with SDL 2 and OpenGL
17 |
18 | 2. Run ``make install`` (with root permissions)
19 |
20 | After installing, libflixel++.so will be placed in /usr/lib/ and the neccessary headers will be placed in /usr/include/flixel++
21 |
22 | To change the framework(s):
23 | 1. Run ``make uninstall`` (if did make install)
24 | 2. Run ``make clean``
25 | 3. Follow the instructions above
26 |
27 | ## Windows
28 | Should theoretically support Windows?
29 |
30 | # Consoles
31 | ## Nintendo Switch (WIP)
32 |
--------------------------------------------------------------------------------
/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.14)
2 |
3 | list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_SOURCE_DIR}/mk")
4 |
5 | set(CMAKE_DEBUG_POSTFIX d)
6 | set(CMAKE_CXX_FLAGS_RELEASE "-O3")
7 |
8 | message(STATUS "Source dir: ${CMAKE_SOURCE_DIR}")
9 |
10 | project(flixel++, VERSION 0.1.0)
11 | include_directories("include/")
12 | include_directories("bundles/tinyxml2/")
13 | file (GLOB_RECURSE FLIXEL_FILES CONFIGURE_DEPENDS "source/*.cpp" "bundles/tinyxml2/tinyxml2.cpp")
14 |
15 | if(DEFINED SDL_LEGACY)
16 | add_definitions(-DSDL_LEGACY)
17 | find_package(SDL_image REQUIRED)
18 | include_directories(${SDLIMAGE_INCLUDE_DIRS})
19 |
20 | find_package(SDL_ttf REQUIRED)
21 | include_directories(${SDLTTF_INCLUDE_DIRS})
22 |
23 | find_package(SDL REQUIRED)
24 | include_directories(${SDL_INCLUDE_DIRS})
25 | endif()
26 | if(DEFINED SDL)
27 | find_package(SDL2_image REQUIRED)
28 | include_directories(${SDL2IMAGE_INCLUDE_DIRS})
29 |
30 | find_package(SDL2_ttf REQUIRED)
31 | include_directories(${SDL2TTF_INCLUDE_DIRS})
32 |
33 | find_package(SDL2 REQUIRED)
34 | include_directories(${SDL2_INCLUDE_DIRS})
35 | endif()
36 | if(DEFINED OPENGL)
37 | find_package(SDL2 REQUIRED)
38 | include_directories(${SDL2_INCLUDE_DIRS})
39 |
40 | find_package(OpenGL REQUIRED)
41 |
42 | find_package(glfw3 3.3 REQUIRED)
43 | include_directories(${GLFW_INCLUDE_DIRS})
44 |
45 | find_package(SOIL REQUIRED)
46 | include_directories(${SOIL_INCLUDE_DIRS})
47 |
48 | find_package(GLEW REQUIRED)
49 | include_directories(${GLEW_INCLUDE_DIRS})
50 | endif()
51 |
52 |
53 | find_package(CURL REQUIRED)
54 | include_directories(${CURL_INCLUDE_DIRS})
55 |
56 | find_package(OpenAL REQUIRED)
57 | include_directories(${OPENAL_INCLUDE_DIR})
58 |
59 | find_package(LibVorbisfile REQUIRED)
60 | include_directories(${VORBIS_INCLUDE_DIR})
61 |
62 | find_package(CURL REQUIRED)
63 | include_directories(${CURL_INCLUDE_DIR})
64 |
65 | add_library(flixel++ SHARED ${FLIXEL_FILES})
66 |
67 | if(DEFINED SDL_LEGACY)
68 | target_link_libraries(flixel++ ${SDL_LIBRARIES})
69 | target_link_libraries(flixel++ ${SDL_IMAGE_LIBRARIES})
70 | target_link_libraries(flixel++ ${SDL_TTF_LIBRARIES})
71 | endif()
72 | if(DEFINED SDL)
73 | target_link_libraries(flixel++ ${SDL2_LIBRARIES})
74 | target_link_libraries(flixel++ ${SDL2_IMAGE_LIBRARIES})
75 | target_link_libraries(flixel++ ${SDL2_TTF_LIBRARIES})
76 | endif()
77 | if(DEFINED OPENGL)
78 | target_link_libraries(flixel++ ${SDL2_LIBRARIES})
79 | target_link_libraries(flixel++ ${GLEW_LIBRARIES})
80 | target_link_libraries(flixel++ ${OPENGL_LIBRARY})
81 | target_link_libraries(flixel++ ${GLFW_LIBRARY})
82 | target_link_libraries(flixel++ ${SOIL_LIBRARY})
83 | endif()
84 |
85 |
86 | target_link_libraries(flixel++ ${CURL_LIBRARIES})
87 | target_link_libraries(flixel++ ${OPENAL_LIBRARY})
88 | target_link_libraries(flixel++ ${VORBISFILE_LIBRARY})
89 | target_link_libraries(flixel++ ${CURL_LIBRARY})
90 |
91 | install(TARGETS flixel++ DESTINATION lib)
92 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | #!/usr/bin/make -f
2 | all:
3 | @echo "Specify what platform you want to build"
4 | pc:
5 | ifeq ($(PLATFORM),1)
6 | @mkdir -p build
7 | @cd build && cmake -DSDL_LEGACY=1 .. && make
8 |
9 | else ifeq ($(PLATFORM),2)
10 | @mkdir -p build
11 | @cd build && cmake -DSDL=1 .. && make
12 |
13 | else ifeq ($(PLATFORM),3)
14 | @mkdir -p build
15 | @cd build && cmake -DOPENGL=1 .. && make
16 |
17 |
18 | endif
19 |
20 | install:
21 | rm -rf /usr/include/flixel++
22 | rm -rf /usr/lib/libflixel++.so
23 | cp -r include/flixel++/ /usr/include
24 | cp -r build/libflixel++.so /usr/lib/libflixel++.so
25 | uninstall:
26 | rm -rf /usr/include/flixel++
27 | rm -rf /usr/lib/libflixel++.so
28 | switch:
29 | @mkdir -p build/switch
30 | @make -f mk/switch.mk
31 | 3ds:
32 | @mkdir -p build/3ds
33 | @make -f mk/3ds.mk
34 | wii:
35 | @mkdir -p build/wii
36 | @make -f mk/wii.mk
37 | clean:
38 | rm -rf build/
39 | rm -rf obj/
40 | @make -f mk/switch.mk clean
41 | example:
42 | @make -f examples/Makefile
43 | LD_LIBRARY_PATH="./build/" examples/example
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | # flixel++
14 |
15 | flixel++ is a port of Adam "Atomic" Saltsman's Flixel library originally created for ActionScript 3.
16 |
17 | flixel++ is a work in progess, things might change or break.
18 |
19 | ## Cloning
20 | Make sure you clone with submodules OR it will not work as the needed submodules are not there.
21 |
22 | ```
23 | git clone --recursive https://github.com/coolfren/flixelplusplus
24 | ```
25 |
26 | If you already cloned it:
27 | ```
28 | git submodule update --init --recursive
29 | ```
30 | ## Building
31 | Refer to BUILDING.md for instructions.
32 |
--------------------------------------------------------------------------------
/assets/images/logo/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coolfren/flixelplusplus/f0e4638a816e55086950d4adfe7c8cd442c6fceb/assets/images/logo/logo.png
--------------------------------------------------------------------------------
/assets/images/logo/logoBlue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coolfren/flixelplusplus/f0e4638a816e55086950d4adfe7c8cd442c6fceb/assets/images/logo/logoBlue.png
--------------------------------------------------------------------------------
/assets/images/logo/logoC.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coolfren/flixelplusplus/f0e4638a816e55086950d4adfe7c8cd442c6fceb/assets/images/logo/logoC.png
--------------------------------------------------------------------------------
/assets/images/logo/logoCyan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coolfren/flixelplusplus/f0e4638a816e55086950d4adfe7c8cd442c6fceb/assets/images/logo/logoCyan.png
--------------------------------------------------------------------------------
/assets/images/logo/logoGreen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coolfren/flixelplusplus/f0e4638a816e55086950d4adfe7c8cd442c6fceb/assets/images/logo/logoGreen.png
--------------------------------------------------------------------------------
/assets/images/logo/logoRed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coolfren/flixelplusplus/f0e4638a816e55086950d4adfe7c8cd442c6fceb/assets/images/logo/logoRed.png
--------------------------------------------------------------------------------
/assets/images/logo/logoYellow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coolfren/flixelplusplus/f0e4638a816e55086950d4adfe7c8cd442c6fceb/assets/images/logo/logoYellow.png
--------------------------------------------------------------------------------
/assets/images/ui/cursor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coolfren/flixelplusplus/f0e4638a816e55086950d4adfe7c8cd442c6fceb/assets/images/ui/cursor.png
--------------------------------------------------------------------------------
/assets/sounds/flixel.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coolfren/flixelplusplus/f0e4638a816e55086950d4adfe7c8cd442c6fceb/assets/sounds/flixel.mp3
--------------------------------------------------------------------------------
/assets/sounds/flixel.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coolfren/flixelplusplus/f0e4638a816e55086950d4adfe7c8cd442c6fceb/assets/sounds/flixel.ogg
--------------------------------------------------------------------------------
/examples/Makefile:
--------------------------------------------------------------------------------
1 | all:
2 | g++ examples/main.cpp -Lbuild/ -lflixel++ -o examples/example -Iexamples/ -Iinclude/ -O3
3 |
4 |
--------------------------------------------------------------------------------
/examples/State.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "flixel++/FlxState.hpp"
3 | #include "flixel++/FlxSprite.hpp"
4 | #include "flixel++/FlxAssets.hpp"
5 | #include "flixel++/FlxSound.hpp"
6 | #include "flixel++/FlxNet.hpp"
7 | #include "flixel++/FlxG.hpp"
8 | #include "flixel++/FlxText.hpp"
9 | #include "flixel++/FlxMacros.hpp"
10 | #include "flixel++/FlxHttp.hpp"
11 | class PlayState : public Flx::State
12 | {
13 | public:
14 | PlayState(){};
15 | ~PlayState(){};
16 | Flx::Sprite *sprite;
17 | Flx::Text *text;
18 | Flx::Http *http;
19 | Flx::Sound* flixelSound;
20 |
21 | float time = 0.0f;
22 | float offsetX = 0.0f, offsetY = 0.0f;
23 | void create()
24 | {
25 | http = new Flx::Http("https://pastebin.com/raw/j9cs4GWP");
26 | trace(http->storage);
27 |
28 | sprite = new Flx::Sprite(0, 0);
29 | if (http->storage == "saul goodman")
30 | {
31 | sprite->loadGraphic("examples/assets/Saul.png");
32 | sprite->setGraphicSize(800, 800);
33 | }
34 | else
35 | {
36 | sprite->loadGraphic("assets/images/logo/logo.png");
37 | sprite->setGraphicSize(240, 240);
38 | }
39 |
40 | sprite->screenCenter();
41 | add(sprite);
42 |
43 | text = new Flx::Text(0, 100, "i am a piece of text!");
44 | if (http->storage == "saul goodman")
45 | {
46 | text->screenCenter();
47 | text->setText(http->storage + " V1.0");
48 | }
49 | else
50 | {
51 | text->x = (Flx::Globals::width / 2);
52 | text->setText("i am a piece of new text!");
53 | }
54 | add(text);
55 |
56 | if (http->storage == "saul goodman")
57 | {
58 | Flx::Globals::mouse->loadGraphic("examples/assets/troll.png");
59 | }
60 |
61 | flixelSound = new Flx::Sound();
62 | flixelSound->load("assets/sounds/flixel.ogg");
63 | flixelSound->play();
64 |
65 | };
66 | virtual void update()
67 | {
68 | sprite->x += cos(time) + offsetX * 2;
69 | sprite->y += sin(time) + offsetY * 2;
70 | text->x -= cos(time) - offsetX * 2;
71 | text->y -= sin(time) - offsetY * 2;
72 |
73 | time += 0.05f;
74 |
75 | Flx::State::update();
76 | }
77 | };
--------------------------------------------------------------------------------
/examples/assets/Saul.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coolfren/flixelplusplus/f0e4638a816e55086950d4adfe7c8cd442c6fceb/examples/assets/Saul.png
--------------------------------------------------------------------------------
/examples/assets/troll.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coolfren/flixelplusplus/f0e4638a816e55086950d4adfe7c8cd442c6fceb/examples/assets/troll.png
--------------------------------------------------------------------------------
/examples/main.cpp:
--------------------------------------------------------------------------------
1 | #include "State.hpp"
2 | #include "flixel++/FlxGame.hpp"
3 |
4 | int main(int argc, char** argv)
5 | {
6 | Flx::Game* game = new Flx::Game("Flixel++", 640, 480, 60.0f, new PlayState(), false);
7 | game->start();
8 | return 0;
9 | }
--------------------------------------------------------------------------------
/examples/to check memory leaks.txt:
--------------------------------------------------------------------------------
1 | valgrind --tool=memcheck -s ls -lflixel++ ./examples/example
--------------------------------------------------------------------------------
/include/flixel++/Common.hpp:
--------------------------------------------------------------------------------
1 | #ifndef COMMON_HPP
2 | #define COMMON_HPP
3 | #include
4 | #include
5 | #include