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

Pages: [1]
1
Graphics / Letterbox effect using a view - not on position 0,0
« on: May 15, 2016, 12:45:41 pm »
Greetings,

Letterboxing a view when resized to keep the aspect ratio can be done as in the wiki example:
https://github.com/SFML/SFML/wiki/Source:-Letterbox-effect-using-a-view

However, this code assumes the view takes the whole screen and is at position 0, 0, as seen by these variables:
    float sizeX = 1;
    float sizeY = 1;
    float posX = 0;
    float posY = 0;

If I have a smaller view, such as a small map on the bottom right corner (therefore, a view not on 0,0 and with a size < window size),
what would be the changes to the code to make that work (it doesn't).

The best I could get was a function that added small increments as the window grew, which would shift it slightly to the right, bottom by changing the initial values (size, pos) to the viewport as expected on the normal screen:

        sizeX *= viewRatio / windowRatio;
        posX += (1 - sizeX) / 2.0;

Thank you. :)

2
Audio / Play parts of many soundBuffers as one audio
« on: January 31, 2016, 05:08:30 pm »
Hi there,

I would like to have a sound class that allows me to specify a certain number of soundBuffers and a specific duration on that sound buffer.

ex:

class Audio2 {
 // ((start time / stop time) /  buffer)
  std::vector<std::pair<std::pair<sf::Time, sf::time>, const sf::soundBuffer*>> buffers;
}

where the length of the audio would be the sum of the vector's time members  (difference between start and stop) and where soundbuffers could be repeated.

This would allow me to load 1/n sound buffers of dialogs and construct sentences using parts of those buffers.

So, If I had a buffer that played the sound of "hello" and another that played a sentence with the word "and" in the middle and a third that played "welcome", I could reproduce the sentence "Hello, and welcome" by adding 3 elements to the buffers with the soundBuffers of the tracks and a start and stop position in each buffer to play the part of the sound that corresponds to each word.

What would be the best approach I should take to implement this?
From what I saw, my best bet would probably be to implement this in SFML, to take advantage of private data that could facilitate this.

3
General discussions / Visual Studio 2015 cross-platform template
« on: August 15, 2015, 11:03:12 am »
Hi there.

First of all, let me just thank the SFML community for the great project (been using it for a while).

As you probably already know, visual studio 2015 (and 2013?) allow us to create projects for various platforms.

I think it would be nice for you to have a template for visual studio to use SFML on Windows/Android/iOS similar to this one from Microsoft: http://blogs.msdn.com/b/shawnhar/archive/2015/07/29/visual-studio-template-for-cross-platform-opengl-development.aspx

I know WPhone/WinRT is not yet supported, but the initial template could have classic win32/Android/iOS templates instead. As a bonus, you could add WinRT support using ANGLE and OSX/Linux project templates as well.

Just something to consider for a next release. You could add it to the samples folder with a simple OpenGL hello world demo.

Also, will you ever offer SFML through NuGet? I know there is an unofficial version, but it's not official nor updated. You could create the template using nuget to get SFML.

Also, the comments in the forum about ANGLE are a bit old. SFML already works with Android/iOS, which use OpenGL ES 2, so using ANGLE for WP/WinRT shouldn't be such a hurdle now, right?

Thanks and keep up the good work :)

Pages: [1]