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

Pages: [1]
1
General / Re: SFML as a static library on Mac
« on: November 30, 2015, 11:04:25 am »
Thanks for the script Hiura, that's definitely going to be useful.

I'm only going to support x64 on OS X. Most projects around the net seem to head in that direction and I feel safe going that way as well. I'm expecting people to play on relatively modern hardware.
I will probably do the same for Windows so that I can get rid of the x86 stuff as well.

I already took both SFML and Thor cmake scripts as a reference. Nonetheless I feel it very hard to make a rock solid cmake build script with all the differences of the different operating systems.

Do you think that it could be fine to include the libraries in SFML's extlibs folder as is and also add compiled libraries of SFML for the different platforms to my own library to make it easier for who's working on the actual executable to link everything without having to go through the configuration of all the dependencies involved?

2
General / Re: SFML as a static library on Mac
« on: November 30, 2015, 10:35:51 am »
Thanks for the answer Hiura.

My question is part of a broader problem to be honest.
I thought I'd venture into statically linking the libraries to make it easier to get all of the different platforms to compile. As you pointed out, this is even worse than using frameworks on OS X.

Right now I'm writing a library that sits on top of SFML and I need it to work on OS X, Windows, Android and iOS.

On Mac I've been using frameworks but since I'm a cmake newbie, I'm having troubles finding a way to tell XCode to copy the frameworks into the application bundle.

On Windows I have a whole different problem, where I need to bring with me x86/Debug, x86/Release, x64/Debug, x64/Release multiplied by all the different versions of Visual Studio because of the incompatibility of the different STL versions.

On iOS I have to use static libraries because everything has to be linked statically.

It's a lot of different moving parts. And on top of that, the end user who's making a project using my library has to deal with all that stuff again as the linking is being done at that stage of course and not in my library. It makes it a dependency hell and it feels like it requires a lot of boilerplate just to get a simple test project to run.

Is my approach completely wrong? Is there a better way to deal with dependencies?

Cheers!

3
Graphics / Re: Generating the entire glyphs texture
« on: November 30, 2015, 09:22:57 am »
All glyphs of the same character size are guaranteed by SFML to fit in a single texture.

I guess it depends on the size of the font. If it's too big, then it won't fit in a single texture. I don't know what happens internally in SFML at that point though.

4
General / SFML as a static library on Mac
« on: November 29, 2015, 04:52:34 pm »
Hello,

I'm obviously doing something wrong. I compiled SFML as static libraries for Mac OS X. In my project I am linking those libraries but then the linker is complaining that it can't resolve all of the symbols coming from the dependencies of SFML. I understand that they're not static libraries but frameworks. Why aren't they being included as static libraries as well?
And even then, how are you supposed to tell Cmake to link those frameworks as well?
I tried adding the usual -framework FLAC etc to target_link_libraries but it complains that it cannot find those frameworks. How do you tell where they are? (They're in the same folder as the SFML static libraries in my project btw)
Thanks in advance!

5
Graphics / Re: Generating the entire glyphs texture
« on: November 24, 2015, 04:39:12 pm »
As dirty as it is but it definitely works well. Thanks!

6
Graphics / Generating the entire glyphs texture
« on: November 24, 2015, 04:20:19 pm »
Is there a simple way to tell SFML to generate the entire glyph texture at a certain size when loading the font?
I know the implications, but for the kind of use I have in mind I'm pretty sure the texture would be small enough to fit in memory and it would let me feed the text to a sprite batcher without having to flush it every time a call to render the text is issued.
Thanks in advance!

7
Window / Re: sf::Mouse::getPosition(window) returning weird values on OSX
« on: November 24, 2015, 02:07:40 pm »
Any news on this issue? If you need a test case I can send you a zip of my framework. It's not yet released in the wild but it surely is quicker than writing a new test case from scratch. In case please send me your email addresses. Cheers!

8
Window / Re: sf::Mouse::getPosition(window) returning weird values on OSX
« on: November 23, 2015, 12:08:02 pm »
What's your camera's view?

The view is set with the same size as the window and with a viewport rect of (0, 0, 1, 1) and its center is in (160, 120) (the center of the window).

I'm not even looking at the calculated "worldPos" because the calculated "pos" is already wrong so the translation to world coordinates makes even less sense.

9
Window / sf::Mouse::getPosition(window) returning weird values on OSX
« on: November 23, 2015, 11:01:52 am »
I'm trying to understand what's going on with the mouse position on OSX.

I have the following function:

    Vector2 InputManager::getMousePosition(Camera *camera)
    {
        sf::Vector2i pos = sf::Mouse::getPosition(*window);
        sf::Vector2f worldPos = window->mapPixelToCoords(pos, camera->view);
        return Vector2(worldPos.x, worldPos.y);
    }
 

The value of "pos", when I click near the top left position is (-428, 554) and I can't figure out what those values mean.
The window is positioned in the middle of the screen and the size is 320, 240.

I have a similar function for touches that I use with iOS and it works perfectly instead:

    Vector2 InputManager::getTouchPosition(unsigned int finger, Camera *camera)
    {
        sf::Vector2i pos = sf::Touch::getPosition(finger, *window);
        sf::Vector2f worldPos = window->mapPixelToCoords(pos, camera->view);
        return Vector2(worldPos.x, worldPos.y);
    }

Is that a known bug? (Using SFML 2.3.2)
Thanks!

10
Graphics / Re: how to load a texture with iOS
« on: November 14, 2015, 05:04:21 pm »
I sorted it out. The problem was that I wasn't including SFML/Main. I didn't know about that. Haven't checked the forums before diving in the code. Then I checked the sources and I understood I was missing something.
Now that's working fine. I might even contribute support for tvOS now.

11
Graphics / how to load a texture with iOS
« on: November 13, 2015, 05:20:07 pm »
Hello,

I'm trying to load a Texture with loadFromFile on iOS but no matter what path I'm using I cannot find the file.
What's the correct way to load images on iOS?

Cheers!

Pages: [1]