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.

Topics - madcat

Pages: [1]
Graphics / SFML Android - RenderTexture Problem
« on: September 27, 2017, 08:40:20 pm »
Why do I have two different visual results for
  • the Shapes
  • the RenderTexture dump with a Sprite

the screenshot is taken from the Android Emulator (API 26), app launched through Android Studio
using SFML 2.4.2

not the difference of blending of the top (white, alpha = 50%) square on the grey square (grey 50% alpha=100%)
  • the left group is drawn using a RenderTexture applied to a Sprite
  • the right group is drawn directly
min code
void App::loop()
    // FULLSCREEN mode + autoRotate ON
    sf::RenderWindow window(sf::VideoMode::getFullscreenModes().front(), "Alpha-WeirdAlpha", sf::Style::Fullscreen | sf::Style::Resize);

    // simple
    sf::RectangleShape rbg(sf::Vector2f(400.f, 400.f));
    rbg.setPosition(50.f, 50.f);
    sf::RectangleShape rfg(sf::Vector2f(200.f, 200.f));
    rfg.setPosition(25.f, 25.f);

    // create render texture
    sf::RenderTexture rt;
    rt.create(500, 500);



    sf::Sprite sprRT(rt.getTexture());


    sf::View view = window.getDefaultView();

    while (window.isOpen())
      sf::Event event;

      while (window.pollEvent(event))
        switch (event.type)
          case sf::Event::Closed:
          case sf::Event::Resized: {
            view.setSize(event.size.width, event.size.height);
            view.setCenter(event.size.width / 2, event.size.height / 2);
          } break;
          default: break;


source code here http://github.com/MoVoDesign/SFML_Android_RenderTexture.git

General / SFML and Android how to get internalDataPath?
« on: September 09, 2017, 05:25:15 pm »
Hi everyone,

Using the NDK,
I'm trying to get the Activity's internal Data Path from main(arg, argv)


int man(int arg, char **argv)
  // here I want activity->internalDataPath
  string path( /* ??? */ );
in main(argc, argv)

I've changed MainAndroid to send it as an argument to a mainAndroid(const char* s)
but it's sort of nasty...
is there any clean way?

I've seen this post as well https://en.sfml-dev.org/forums/index.php?topic=13716.240 but it's also a bit violent.

Anybody knows a way that doesn't require modifying the SFML source code?


General discussions / Android Studio 2.3.3 + SFML 2.4.2 - Hell again.
« on: August 26, 2017, 02:26:03 pm »
Hi You All,

has anyone had any success building a minimal SFML example that can actually be built and run on the emulator?

I've tried the tutorial on GitHub (here: https://github.com/SFML/SFML/wiki/Tutorial:-Building-SFML-for-Android) - with no success since those **** people at Google decided to force you to go through their ugly IDE: Android Studio.

So I've spent so far 36h on the problem and I believe that I'm getting closer: the best lead I've found so far is here in the forum and t AlexAUT's SFML-AndroidStudio-Template (here: https://github.com/AlexAUT/SFML-AndroidStudio-Template).

There's also a this basic yet rather rich article on dev.android: https://developer.android.com/studio/projects/add-native-code.html#create-sources

So I started from these places and I am painfully trying to merge two of their examples
  • Native Activity - using <android_native_app_glue.h>
  • Native Lists (Hello libs)[/i]

from there I hope to find a way to bring in the static and shared libs for SFML.

did I mention that Java irks me?
Any clue is welcome!

SFML projects / TacWars a puzzle/RPG using SFML for IOS/OSX
« on: August 22, 2017, 04:25:19 pm »
Armed with Axes, Bows and Magic, you lead an army of brave Dwarven Warriors to battle against ugly Goblins and spooky Skeletons in this addictive Puzzle/RPG. Steal Tactics from your Enemies and unleash their power on the battlefield for maximum impact!

key features:
- A Match 3 Puzzle Game. Use your skill to match tokens creatively to outwit your enemy.
- Collect up to 20 special attacks to destroy your opponents.
- RPG fans can gain experience from wins and strengthen their armies.
- Confront enemies with different levels of intelligence, from the daft to obnoxiously shrewd.
- Adorable characters with cartoony violence at every slash and turn!
- Option to play in story mode or in duel mode with an interesting array of baddies.

More on http://movo-design.com

Available now for MacOSX and IOS on iTunes App Store and Mac Apple Store

Android and Windows ports under development...

General / Extlibs sources?
« on: August 19, 2017, 02:02:42 pm »
Hello, nice one.

I'm actually trying to build an IOS app ans send it to the App Store.
the SFML libs compile nicely with bitcode and arm7 arm64 architectures.

I'd like to now if there is a link to the sources (github?) of the extlibs used by SFML.
because I'm required (and so is anyone who wants send an app to the Apple Store) to enable bitcode for
each one of them, and it isn't done by default.

I sent a quick mail to Lukas D├╝rrenberger/eXpl0it3r at his webstite contact email because he's the wiz at the IOS port, but I wouldn't mind helping where I can.
hence my question about which projects are the one providing the extlibs.


P.S. mail daemon just informed me that contact@ is dead. no more eXpl0it3r there.

System / loading resource through a thread with SFML 2.2
« on: April 07, 2015, 03:03:45 pm »
Hi, after upgrading to SFML 2.2 - I recompiled my code (with Xcode on OSX 10.9) and suddenly get a BAD ACCESS when the program exits.  :(

Based on Nexus' comments, I put here the minimal code to generate the problem (the result I get is attached below)
#include <SFML/Graphics/Texture.hpp>
#include <SFML/System/Thread.hpp>
#include <SFML/System/Lock.hpp>
#include <SFML/System/Mutex.hpp>
sf::Mutex gMutex;

//--- threaded F()
void tF(sf::Texture* apTex)
{ sf::Lock lock(gMutex);

//=== MAIN
int main(int, char const**)
  sf::Texture texture;
  sf::Thread thread(&tF, &texture);
  return 0;

It worked fine with SFML 2.1
Am I doing something wrong?

Graphics / VertexArray, setTextureRect and setRepeated
« on: September 11, 2014, 09:10:11 am »

I was wondering if there's a way to associate a repeated texture taken from a tilemap to a VertexArray.
I'm designing asteroids as non convex triangle based objects and I have a sort of texmap with different repeatable rock textures + some sticker-style graphics to overlay on my polygonal asteroids (extra craters, space base, smashed alien...)

I don't seem to find a straightforward way to do it....
is there a way to fix a textureRectangle when assigning the texture at the state level?

state.texture = ??


I was playing with the idea of implementing multiple lives in the game example developed in the book.
My idea was to add a new state NewPlaneState that will shortcut the controls of the GameState but animate the main plane into position.

The trouble I encounter is that this new state will have to access mPlane of World

Any idea about how to get about that in a clean fashion?

General / SFML Book/How to use the Mouse to control an entity
« on: August 19, 2014, 10:35:44 am »
I was playing with the example and I thought, hey! Is there any elegant way to modify the existing Command structure to control the plane with the mouse as well as the keyboard.

The problem of course is that the mouse x,y or the delta movement has to be sent with the command action every Command.
That's where I got stuck.


Pages: [1]