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 - AlexAUT

Pages: [1] 2
Feature requests / Update android default project
« on: September 19, 2017, 11:10:40 pm »
The android example still uses the old build system (ADT), because at the time support for the NDK in Android Studio was non existent. Maybe even Android Studio was not released back then ???

Nowadays Android studio has finally integrated good working support for the NDK, via Gradle+Cmake. So we should think about updating the example, or at least offer and android studio project. Because currently it is not simple, easy or fast for a person which does not know something about the build system to get SFML working under android.

There is already a nice template, which works out of the box without any configuration needed (with this PR).

SFML Thread:

For the future it would also be possible to build SFML inside Android Studio. So the user does only need to copy his code into the example and everything will be setup.


Feature requests / Android Studio example project
« on: September 21, 2016, 07:32:17 pm »

as the title says, it would be time for an example project for AndroidStudio (using Gradle) for SFML. I managed to port the android-sfml example to Android Studio 2.2 with Gradle Experimental 0.8.0/2.14.2. It would be nice if you could test it, and give some feedback.

https://github.com/AlexAUT/SFML-AndroidStudio-Template there is a HowTo at the Github Site.

There are currently two problems which requires a fix by Google:
  • Because sfml-activity loads the user's code it's required that the whole sfml-main is available in the shared library file. With normal linkage basically everything from sfml-main gets thrown away by the linker, because no user code does reference any sfml-main's code. In ANT we have WHOLE_STATIC_LIB for this case, in Gradle there is no way to do this yet (see github). So I had to copy some implementation specific files to the userproject (SFMLHack folder). As soon as google supports the -Wl,--whole-archive linker option in the Gradle plugin I could remove these files.
  • Also there is currently no way to link the -d libraries when using a debug build, so the template will always link the release lib files.

If you have any questions about the build system, feel free to ask  :D


Window / OS reporting App is not responding
« on: August 14, 2015, 03:02:24 pm »
I've switched to fedora 22 with the Gnome 3.16.2 desktop enviroment and I noticed that the OS is reporting after 5seconds that my SFML application is not responding anymore, however the app just runs fine when I press "wait".

I tried the lastest release and the current master both produces the same behaviour. I used the "gcc (GCC) 5.1.1 20150618 (Red Hat 5.1.1-4)" to compile SFML. Tell me when I should provide more informations about my systems, could this be related with the xcb change?

Edit1: I'm using the default SFML Window code (So yes, I have a pollEvent loop)


Feature requests / OutputFileStream
« on: July 28, 2015, 06:08:13 pm »

I think this wasn't a problem in the past because we could easily use std::fstream (or C API) to write to files, but with the mobile ports things have changed, at least on android you cannot use std::fstream and the C API only limited. So wouldn't it be nice to have a platform indipendent API to write files?


Feature requests / Add key flags to mouse events
« on: January 22, 2015, 06:07:17 pm »
Currently there are only 2ways to check if a mouse click happened with ctrl/system/alt/shift pressed.

1)Use sf::Keyboard::isKeyPressed() which is bad because the event could be delayed due to heavy load...
2)Track the states of the keys yourself. (Sometimes difficult/cumbersome, depends on the code design of course)

I haven't had a look at the implementation of SFML but i think the state of these keys are cached anyways for the key events?

Edit: Ok the states aren't cached, but it could be done the same way as for the key events.


Network / Call sf::Socket::Disconnect while receiving
« on: October 25, 2014, 05:47:36 pm »
Is the behaviour defined when I call disconnect from a Socket which is currently blocking a other thread because of receive? (Blocking sockets)

In my experience the receive call will return instantly with no data received, but is this behaviour defined, or just implementation luck on OS/Driver level?


SFML website / Link to the documentation at some points in the tutorials
« on: August 26, 2014, 09:30:23 pm »
Yesterday I was looking for the supported file formats by SFML and found this sentece in the "Sprites and textures" tutorial

SFML supports the most common file formats. The full list is available in the API documentation.

I think it would be nice if there is a link to the documentation to see the full list.

Edit1: same for audio would be nice


General discussions / Android Bug Thread
« on: June 21, 2014, 09:42:15 am »
I decided to make a new thread about the Android-port because I don't think mixing Android and iOS is a good idea.

As you may know I released my first game on the play store, and maybe I'm the first guy who used the Android port for a game. First of all, it was quite a pain in the a**. There are still many problems with the port and I will publish my Buglist below (I fixed every problem in my private fork so I could help to fix every single on):
  • The android port won't even compile. The fix is already posted by Mario in April... (http://en.sfml-dev.org/forums/index.php?topic=13716.msg105423#msg105423)
  • Without changing the src of SFML you can't use sf::Text and transparent sprites because transparency will be  rendered as white  ??? . So you have to use the fix written by Jonathan in December last year... (http://en.sfml-dev.org/forums/index.php?topic=13716.msg97191#msg97191)
  • Audio files have to be normalized, (Edit: found that this is a limitation of a third party lib)
  • You can't access hardware keys like "Back, Home, Edit, VolumeKeys, PowerSwitch". Why do we have implemented advanced stuff like sensors but we cant access these very important buttons? Fixing this is a matter for minutes just add sf::Keyboard::VolumeDown etc and chage the switch in Android/windowimpl .
  • You can't tell SFML to give the events for the volume keys back to the OS, I know that you maybe want to use the volume keys in an multimedia app for example scrolling. But for games with Music it's a must that you can change the Volume of the Device.

    Two Options:
    • Insert a function to the renderWindow like changeDeviceVolume(int offset), but this function is very hard to implement in native code
    • Like I fixed it in my private fork add a member "mUsingVolumeKeys" and the change in src/window/Android/WindowImplAndroid.cpp the keyEvent handling (Code is written below the list

Event handling code
(click to show/hide)

So my question is, are you guys still working on the port? Because some bugs are known since 6months!


Network / Online Highscore TCP or HTTP
« on: June 20, 2014, 07:55:01 am »

Currently I'm planning the online highscore for my little Game Kroniax. I already had one in the past but lost the source code  ::). So I have two options now, maybe an experienced network Developer(Binar can help me out which is the better way to go...

  • Code a SFML application, install it on my server, connect via TCP and send the highscore / new times
  • Do it via HTML/Php/MySQL (Webserver). I found a tutorial about this some time ago. But I have no idea if this would be easy to implement with sf::Http (on the clientside)


Graphics / sf::RenderTexture::clear not working. (bug?)
« on: January 10, 2014, 12:17:31 pm »
Hey I have a simple problem. It seems that the clear function of a RenderTexture doens't work for me.

Minimal example (It's the renderTexture example + a RectangleShape updated to the mouse position (to draw some stuff  :P):
#include <SFML\Graphics.hpp>

int main()
        // Create a new render-window
        sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
        // Create a new render-texture
        sf::RenderTexture texture;
        if (!texture.create(500, 500))
                return -1;
        // Create rectangle
        sf::RectangleShape rect;
        rect.setSize({ 25.f, 25.f });
        // The main loop
        while (window.isOpen())
                // Event processing
                sf::Event event;
                while (window.pollEvent(event))
                        if (event.type == sf::Event::Closed)
                //Update the rect position to mouse position (to draw some stuf :P)
                // Clear the whole texture with red color
                // Draw stuff to the texture
                // We're done drawing to the texture
                // Now we start rendering to the window, clear it first
                // Draw the texture
                sf::Sprite sprite(texture.getTexture());
                // End the current frame and display its contents on screen

    return 0;

The result for me: http://imgur.com/DEFr4Fb

What I would expect: http://imgur.com/gsTZJfd = only one rectangle. When I draw directly on a window everything works fine.

My system:
OS: Windows 8 64bit
GPU: AMD 6850 (I have the lastest beta driver)
(I don't think the CPU/Ram are important for this issue but anyways)
CPU: AMD FX-8350
RAM: 8gb 1600mhz

Sadly I have currently no other PC to test it.


General / sf::Vector2f per value or const reference
« on: January 07, 2014, 03:27:13 pm »
Simple question, is it worth using a const reference as parameter in case of performance? Because in my opinion the const sf::Vector2f &xyz really disturb the reading flow.

void setPosition(sf::Vector2f position);
void setPosition(const sf::Vector2f &position);

//And even worse
sf::Vector2f getPosition() const;
const sf::Vector2f &getPosition()const;


Network / sf::TcpSocket::connect always returns sf::Socket::Done?
« on: October 22, 2013, 05:51:03 pm »
Example Code:

#include <SFML/Network.hpp>

int main()
   sf::TcpSocket socket;
   sf::Socket::Status status = socket.connect("", 53000);
   if (status != sf::Socket::Done)
      return -1;

   return 0;

On my computer (Windows 8.1) this will always return 0; . I guess this isn't the expected behaviour, I tried it with serveral random IPs and it always returned "Done".

I tried it with a TimeOut aswell. The function will block the thread for the given time and then retrun sf::Socket::Done. Without a Timeout it will block the thread for a random time (near to 20seconds) and then also return sf::Socket::Done.

Do i missunderstand the API in this case? Or is it a bug?


Network / After tcplistener.close() I have to restart the server?
« on: March 30, 2013, 11:50:10 am »
my application uses one port for communication with the client. I use tcp so i create a sf::tcpListener, listen on that port and handle incomming connections, all works fine. When I close the app I call the tcpListener.close() function.
But when i open another instance (after closing the previous one) i get an error in the command line (Failed to bind Port XXXX). After a reboot of the server all works fine again until i close and reopen the application.

Is this a known bug? or do I have to call anything else when i close my server?


Network / How to stop the Selector example
« on: March 11, 2013, 09:00:32 pm »
i´m currently working on a server/client application. To detect new clients i use nearly the same function as in the documentation is used


This function is called by a thread, now my problem is that I dont know exactly how to stop the server, because the function will never stop.

* Can i use the terminate function? Will it call the deconsturctor of the sf::TcpSockets in the list?

* Or should i set "running = false" and create a pseudo client who connects to stop the thread?

and another question,  in this example "std::list<sf::TcpSocket*>" i have to delete the allocated memory by my own, or?

SFML projects / Kroniax available in the Play store!
« on: February 27, 2013, 04:28:47 pm »

It's now available in the Play Store: Link

i want to present my current Project Kroniax.

Its some kind of a sidescroller. The target is to maneuver the ship through the level without touching the walls. You can steer up your ship by pressing the spacebar.

Preview video (thanks to eXpl0it3r) feel free to subscribe and like the video. It outdated but it still shows the core elements of the game


*The arcade mode. If you get through a level you will unlock another map... (currently there are 7levels). In this mode the speed and gravitiy will be change by the game itself!

*Mutliplayer. In this mode you can control the Speed of the Ship yourself by pressing the left or right arrow key. But keep in mind that you can't control the gravity! Try to get to the finish as fast as possible to get a good time. You can compare your time by pressing tab with the other players on the server. With " T " you can open the chat and talk about routes and stuff  8) . After the end of each level you will see a global ranking (in development)


It's now available in the Play Store: Link


Support me on indieDB:


Pages: [1] 2