Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - foo

Pages: 1 [2]
16
Update includes more segues you can use directly into your apps with a single include statement.

Activities can support their own views.

namespace swoosh:: now has ActionList and action item types to add even more control and polish to your apps.

Read more here

17
SFML projects / Re: Isometric Minesweeper
« on: November 06, 2018, 05:15:44 pm »
Cool! Will there be any twists to the minesweeper rules?

18
SFML projects / Re: My menu
« on: November 06, 2018, 05:14:36 pm »
It looks good! There's not much else you can do besides making a reusable activity for all the different menu subscreens you'll have. You don't want to have your main loop _filled_ with your entire app's logic. That gets messy and hard to maintain.

Consider using Swoosh for this case.

Swoosh has an Activity class that you can fill your menu's setup, update, draw, and enter/exit functions to make very lively applications. It also has segue support so you can transition from one menu item to the next with Sliding, Fading, and you can create your own.

It's super easy to use and you won't need to link any libraries or DLLs.

19
Updated 10/12/2020 to reflect latest 1.2.4 API

There had to be a way to manage cool screen transitions as easy as possible in C++ without too much difficulty.

There wasn't until now Swoosh, the mini library that immediately adds 100x polish to your game.

Fork the project at https://github.com/TheMaverickProgrammer/Swoosh.

LICENSED under The zlib/libpng License.



Swoosh is easy to integrate and makes your game look pro. Just checkout the super simple game example that ships with it.

See the full video https://streamable.com/qb023.



The example project comes with 20+ header-only custom segue effects you can copy and paste directly into your project and it'll just work.



Using segues is as easy as calling push or pop and providing the intent. The intent is a specialized nested class designed to be human readable. Just see for yourself:

ActivityController controller;
controller.push<MainMenuScene>();

...

// User selects settings
using types::segue;
controller.push<segue<SlideInLeft>::to<AppSettingsScene>>();
 

Popping is the same way.

controller.pop();
controller.pop<segue<SlideIn>>();
 

And if you're making a legend of zelda clone and the player teleports out of a series of deep dungeons back to overworld... there's a function for that too

bool found = controller.rewind<segue<SlideIn>::to<LOZOverworld>>();

if(!found) {
    // Perhaps we're already in overworld. Certain teleport items cannot be used!
}
 

Take a peak at the full source code for the demo project:
Source Code



Swoosh comes with other useful utilities specifically but not limited to games.

  • function bool doesCollide(a, b)
  • function double angleTo(subject, target)
  • function vector2 direction(target, dest)
  • function void setOrigin(sprite, fx, fy)

See the rest here:
https://github.com/TheMaverickProgrammer/Swoosh/wiki/Namespaces



May this be as useful to you as it is meant to be!

20
Java / SFML for android Gradle Build Fails
« on: October 12, 2018, 11:12:12 pm »
I'm using NDK r18, SFML 2.5, Android API 24, Clang on MacOSX. STL=c++_shared.

And I made sure the STL value was the same across cmake and the generated makefiles.

I followed both the SFML official guide and a template found here on the forums. Both end with the same error. I'll show the command line example from the official guide only:

Here is the output

Error: undefined reference to 'sf::String::String(char const*, std::__ndk1::locale const&)'
  /Users/maverick/Library/Android/ndk/sources/third_party/sfml/lib/armeabi-v7a/libsfml-main.a(MainAndroid.cpp.o):MainAndroid.cpp:function onDestroy(ANativeActivity*): error: undefined reference to 'std::__node_alloc::_M_deallocate(void*, unsigned int)'
  /Users/maverick/Library/Android/ndk/sources/third_party/sfml/lib/armeabi-v7a/libsfml-main.a(MainAndroid.cpp.o):MainAndroid.cpp:function onDestroy(ANativeActivity*): error: undefined reference to 'std::locale::~locale()'
  /Users/maverick/Library/Android/ndk/sources/third_party/sfml/lib/armeabi-v7a/libsfml-main.a(MainAndroid.cpp.o):MainAndroid.cpp:function onDestroy(ANativeActivity*): error: undefined reference to 'std::__node_alloc::_M_deallocate(void*, unsigned int)'
  /Users/maverick/Library/Android/ndk/sources/third_party/sfml/lib/armeabi-v7a/libsfml-main.a(MainAndroid.cpp.o):MainAndroid.cpp:function onDestroy(ANativeActivity*): error: undefined reference to 'std::locale::~locale()'
  /Users/maverick/Library/Android/ndk/sources/third_party/sfml/lib/armeabi-v7a/libsfml-main.a(MainAndroid.cpp.o):MainAndroid.cpp:function std::basic_streambuf<char, std::char_traits<char> >::~basic_streambuf(): error: undefined reference to 'std::locale::~locale()'
  /Users/maverick/Library/Android/ndk/sources/third_party/sfml/lib/armeabi-v7a/libsfml-main.a(MainAndroid.cpp.o):MainAndroid.cpp:function std::basic_streambuf<char, std::char_traits<char> >::~basic_streambuf(): error: undefined reference to 'std::locale::~locale()'
  /Users/maverick/Library/Android/ndk/sources/third_party/sfml/lib/armeabi-v7a/libsfml-main.a(MainAndroid.cpp.o):MainAndroid.cpp:function std::priv::_Rb_tree<int, std::less<int>, std::pair<int const, sf::Vector2<int> >, std::priv::_Select1st<std::pair<int const, sf::Vector2<int> > >, std::priv::_MapTraitsT<std::pair<int const, sf::Vector2<int> > >, std::allocator<std::pair<int const, sf::Vector2<int> > > >::_M_erase(std::priv::_Rb_tree_node_base*): error: undefined reference to 'std::__node_alloc::_M_deallocate(void*, unsigned int)'
  /Users/maverick/Library/Android/ndk/sources/third_party/sfml/lib/armeabi-v7a/libsfml-main.a(MainAndroid.cpp.o):MainAndroid.cpp:function std::priv::_Rb_tree<int, std::less<int>, std::pair<int const, sf::Vector2<int> >, std::priv::_Select1st<std::pair<int const, sf::Vector2<int> > >, std::priv::_MapTraitsT<std::pair<int const, sf::Vector2<int> > >, std::allocator<std::pair<int const, sf::Vector2<int> > > >::_M_erase(std::priv::_Rb_tree_node_base*): error: undefined reference to 'std::__node_alloc::_M_deallocate(void*, unsigned int)'
  clang++: error: linker command failed with exit code 1 (use -v to see invocation)
  make: *** [/Users/maverick/Code/Forks/SFML/examples/android/app/build/intermediates/ndkBuild/debug/obj/local/armeabi-v7a/libsfml-example.so] Error 1


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

Here is the makefile

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE    := sfml-example

LOCAL_SRC_FILES := main.cpp

LOCAL_SHARED_LIBRARIES := sfml-activity
LOCAL_SHARED_LIBRARIES += sfml-graphics
LOCAL_SHARED_LIBRARIES += sfml-window
LOCAL_SHARED_LIBRARIES += sfml-audio
LOCAL_SHARED_LIBRARIES += sfml-network
LOCAL_SHARED_LIBRARIES += sfml-system
LOCAL_SHARED_LIBRARIES += openal

LOCAL_WHOLE_STATIC_LIBRARIES := sfml-main

include $(BUILD_SHARED_LIBRARY)

$(call import-add-path,/Users/maverick/Library/Android/ndk/sources)
$(call import-module,third_party/sfml)
 

Someone on IRC said it might be link order so I've tried every possible combination. And I know it has to be a specific order: dependent libraries first so graphics then window then audio/network then system. As you can see I have that too.

I tried static and it installed but crashed on startup. Reading the official android C++ docs, they mention static is not suggested and use shared instead.

Help me get this to build and run right on android.

Pages: 1 [2]