🕹️ Currently working on NasNas, a cross platform 2D game framework for C++ !
madour / nasnas Goto Github PK
View Code? Open in Web Editor NEWAn intuitive and beginner friendly 2D game framework for C++
License: Other
An intuitive and beginner friendly 2D game framework for C++
License: Other
🕹️ Currently working on NasNas, a cross platform 2D game framework for C++ !
I tried to use it on my Raspberry Pi 3B+ using Raspbian Buster, but got the following error when trying to compile:
Scanning dependencies of target NewProject
[ 2%] Building CXX object CMakeFiles/NewProject.dir/src/NasNas/data/AppComponent.cpp.o
[ 5%] Building CXX object CMakeFiles/NewProject.dir/src/NasNas/data/Config.cpp.o
[ 8%] Building CXX object CMakeFiles/NewProject.dir/src/NasNas/data/Arial.cpp.o
[ 10%] Building CXX object CMakeFiles/NewProject.dir/src/NasNas/data/Maths.cpp.o
[ 13%] Building CXX object CMakeFiles/NewProject.dir/src/NasNas/data/Shapes.cpp.o
[ 16%] Building CXX object CMakeFiles/NewProject.dir/src/NasNas/data/ShaderHolder.cpp.o
[ 18%] Building CXX object CMakeFiles/NewProject.dir/src/NasNas/core/App.cpp.o
[ 21%] Building CXX object CMakeFiles/NewProject.dir/src/NasNas/core/Scene.cpp.o
[ 24%] Building CXX object CMakeFiles/NewProject.dir/src/NasNas/core/Layer.cpp.o
[ 27%] Building CXX object CMakeFiles/NewProject.dir/src/NasNas/core/Camera.cpp.o
[ 29%] Building CXX object CMakeFiles/NewProject.dir/src/NasNas/core/Window.cpp.o
[ 32%] Building CXX object CMakeFiles/NewProject.dir/src/NasNas/core/Anim.cpp.o
[ 35%] Building CXX object CMakeFiles/NewProject.dir/src/NasNas/core/Spritesheet.cpp.o
[ 37%] Building CXX object CMakeFiles/NewProject.dir/src/NasNas/core/BitmapText.cpp.o
/home/pi/MeinOrdner/c++/CppGames/NasNasGame-1/src/NasNas/core/BitmapText.cpp: In member function ‘void ns::BitmapText::processString()’:
/home/pi/MeinOrdner/c++/CppGames/NasNasGame-1/src/NasNas/core/BitmapText.cpp:168:27: error: ‘strtok’ is not a member of ‘std’
auto* word = std::strtok(str.data(), " ");
^~~~~~
/home/pi/MeinOrdner/c++/CppGames/NasNasGame-1/src/NasNas/core/BitmapText.cpp:168:27: note: suggested alternative: ‘sort’
auto* word = std::strtok(str.data(), " ");
^~~~~~
sort
/home/pi/MeinOrdner/c++/CppGames/NasNasGame-1/src/NasNas/core/BitmapText.cpp:171:25: error: ‘strtok’ is not a member of ‘std’
word = std::strtok(nullptr, " ");
^~~~~~
/home/pi/MeinOrdner/c++/CppGames/NasNasGame-1/src/NasNas/core/BitmapText.cpp:171:25: note: suggested alternative: ‘sort’
word = std::strtok(nullptr, " ");
^~~~~~
sort
make[2]: *** [CMakeFiles/NewProject.dir/build.make:232: CMakeFiles/NewProject.dir/src/NasNas/core/BitmapText.cpp.o] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/NewProject.dir/all] Fehler 2
make: *** [Makefile:84: all] Fehler 2
Components pools allocated with new
are never deleted.
NasNas/include/NasNas/ecs/Registry.hpp
Line 100 in 4cdf146
Consider using smart pointers to store pools here
NasNas/include/NasNas/ecs/Registry.hpp
Line 107 in 4cdf146
The file path becomes incorrect when path is empty string.
possible fix :
std::string file_path;
if (!path.empty())
file_path = path + "/" + file_name;
else
file_path = file_name;
NasNas/include/NasNas/core/App.hpp
Lines 320 to 331 in 418a00e
Else condition to set the new state callbacks is missing.
Calling ns::android::showToast
from main will cause crash with exception : "Can't toast on a thread that has not called Looper.prepare()"
(here). This happens because the main thread looper is not found (I think ?) when creating the Toast message.
Attempted to use the ALooper solution with no success because we don't have access to the main thread from the SFML Activity unfortunately.
In fact, SFML sets the looper from initializeMain which is called from the custom android main, which itself is ran in new thread.
Possible Solution : access main looper from Java's static method Looper.getMainLooper
and then make the JNI showToaster call from there.
The other solution would be to completely replace sfml-activity by nasnas-activity and call ALooper_prepare from the activity main thread, and setup a pipe to communicate with it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.