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

Pages: [1]
1
General / Using external libraries like Thor in Android build
« on: March 03, 2016, 09:23:13 pm »
Hi all,

I am trying to build my SFML project for android and having some problems there.  I have successfully complied SFML for armeabi-v7a and also compiled the SFML example project and installed that on my android device. Works fine thanks to nice example:

https://github.com/SFML/SFML/wiki/Tutorial:-Building-SFML-for-Android

There was a little bit of a hassle on how to install the Android SDK. The working solution was to use stand-alone SDK but to use ndk that came with android-studio. The standalone ndk somehow did not work. But anyway, the build system seems to be ok because I can build android binaries.

My project uses external libraries like Thor and sfml-tmxloader. Now the question is, how can I use these when building for android? I would think it is necessary to build these for armeabi-v7a target and install the libraries to ndk quite similar than in case of installing SFML to ndk. But how to do this?

I have googled around  and tried different things but no luck this far. Would be great if anyone could give some tips how to go forward.  :)

The other thing is how to set up an own android project. I have taken this as a starting point:
http://fr.sfml-dev.org/forums/index.php?topic=18211.msg131094#msg131094

The perfect solution would be to have the same source code in version control and build for PC or android but the android project setup seems to be quite different from normal cmake and this seems may become a problem. But I am not this far yet since I have not succeeded to build for android yet. Maybe the solution is to have the source files, resources etc in place where android wants them to be and try to have a cmake out of source build using the same resources. If anyone has experience on this, would love to hear as well :).

Best regards,
ast

2
General discussions / How sfml compares with cocos2d-x?
« on: January 01, 2016, 11:53:23 pm »
Hi all,

I came across with the cocos2d-x, which I assume some of you have opinions on. I noticed that although it has MIT license it has companies around it making it to feel considerably less open than sfml. But the other side of the coin is that there seems to be more developers doing the cocos than sfml and also cocos has been used in many popular game titles.

The sfml is concentrated on abstracting window, keyboard, sound output etc and it does that very nicely. The cocos seem to have additional things also like some kind of a game engine and physics, support for Tiled tile map editor, support for particle system definitions in plist format and cocos studio for animations etc (no linux version though), texture atlas tools. Some of the aforementioned could be handy at times, the Tiled tilemaps work nicely with sfml with tmxloader (which I found after trying couple of others with less successful result) but I think there is no particle editor or support for plist particle definitions?

I understand that sfml and cocos have slightly different targets but I would appreciate if you could share your knowledge on the differences or pros and cons of the cocos and sfml. Also I would be interested to know how you find your way on the subjects where cocos has helper features (like the particle system editing)?

Best regards,
ast

3
Feature requests / y-axis direction
« on: October 20, 2015, 10:57:47 pm »
Hi all,

This is not a direct feature request but more of on inquiry. Does anyone else find it at least a little annoying that the y-axis of sfml points downwards and not upwards as in the common maths? I am aware that this has historical background going back to someone deciding the cathode ray beam should start drawing lines from the upper left corner of the tube.

Anyways, the current choice of the co-ordinates seems to pose all sorts of troubles with vector algebra and the fact that angle positive direction is counted in clockwise direction contrast to the more common counter-clockwise direction. To get things working I implemented transforms back and forth from these downward-y 'screen' co-ordinates to my own co-ordinate system, in which I chose to have the origin in bottom right corner and the y-axis pointing upwards. One caveat though is that the position vector must be transformed with different transformation than its derivatives like velocity, acceleration or force because the location of the origin affects only to the position vector.

While this is manageable, I seem to end up having quite a lot of transformations while interacting with sfml functions, which could be avoided if the co-ordinates of sfml has been chosen otherwise. The first question is, how do you others manage with your co-ordinates? And the second, would it be feasible to support the upward-pointing y-axis in sfml also?

This is about the only thing that sometimes bugs me with sfml, otherwise it pretty much does what I would expect it to.

Thanks,
ast

4
General / How to extend Thor particle system class? Monkey patching?
« on: October 03, 2015, 10:38:05 pm »
Hi all,

I did some experimentation with Thor particle systems and was faced with the following. My collision detection schema needs to save state information to each object that can collide. Therefore, in order get the Thor particles collide, I would like to extend the thor::Particle to contain the new attributes for the collision state information, but of course not to change the Thor library files in any way. Is there a feasible way to do this?

Being not a seasoned C++ expert, I come up only deriving ParticleExtended from Particle and include the things I want in the derived class. But as I am instantiating a ParticleSystem and not a Particle this probably would not work this simple. The other option I can think of is to maintain a map from a particle pointer (Particle*) to my collision state data and in my CollisionAffector I could retrive the correct data for each particle using the map. But this seems a bit awkward too. I would be glad to hear if anyone could suggest other alternatives.

Thanks,
ast

5
Graphics / Color blending problem with shaders
« on: April 02, 2015, 09:25:49 pm »
Hello all,

I have done some experimenting with SFML and shaders. The goal is to make a sprite to be surrounded with a colored glowing light. Following the example in 

http://thedaftdev.com/entry-13-SFML-and-shaders.-.html
https://www.youtube.com/watch?v=nlmghd1Thpg

I manage to get the shader working. I draw first all sprites and a green background to a RenderTexture, from which I take the drawn texture with getTexture() and make it a sprite. Then I draw this sprite to RenderWindow using the shader and blendMode BlendAdd. This all works well but the glowing light is supposed to be red but when it is blended with green background it appears to be yellow. With black background the light is red. This is all fine, the colors are numbers and add up like that, but the question is, how I can make the light to be the color I want regardless of the background? I am sure this is a well known problem and has good answers already, but they seem to be hard to find.

Thanks for the great library, SFML is awesome!

Regards,
ast

Pages: [1]
anything