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

Pages: [1]
1
Graphics / A std::map of sf::vector2f
« on: December 15, 2012, 09:41:32 pm »
Is it possible to create a map with the key being an sf::vector2f? I think i need to overload the comparison operator to get it to work. If it is possible, could someone kindly explain how to accomplish this?

Thanks!

2
Graphics / Re: vSync sf::View bug (SFML 2.0)
« on: November 07, 2012, 11:10:13 pm »
Sorry I'm at work right now I will post my code when I get home. Thanks for the etiquette link.

3
Graphics / vSync sf::View bug (SFML 2.0)
« on: November 07, 2012, 10:25:33 pm »
I am having a strange bug when Vsync is enabled and the view follows the player in my 2D game.

When Vsync is enabled, and the view's center is set to the players position each frame, the player jitters back and forth when receiving input commands. This only happens when Vsync is enabled, when the framerate is unlocked the player stays in the center of the screen as expected.  Any ideas what might be causing this?

Thanks!

4
Graphics / Vsync causing strange jitter effect (SFML 2.0)
« on: November 05, 2012, 07:09:27 pm »
I am having some weird results when vSync is enabled in my 2D platformer.

I am using impulse based framerate independent movement for the entities in my 2D platformer game. I also have the view follow the player by setting its center to the player's position each frame. When vSync is off and the game is running ~1000 fps, everything is fine and the movement is smooth. When I enable vSync and the framerate locks at ~60 fps the player seems to jitter back-and-forth 1 pixel once every 10 frames or so. The players movement speed is still correct, and all other entities don't jitter, but for some reason the player experiences a slight jitter.

Any help troubleshooting the source of the problem would be greatly appreciated. I've tested and the view center is equal to the players position each frame, so there is no strange off-by-one frame lag or anything.

Another strange thing possibly worth mentioning is that the player has a weapon that is also set to the player position each frame. This weapon does not experience the jitter effect when vSync is enabled, only the player does.

Thanks!

5
Audio / Re: Spatialization of sound in 2D game (SFML 2.0)
« on: November 05, 2012, 06:59:58 pm »
Thanks for the speedy reply Laurent, you confirmed my suspicions.

Next question: is there anyway to convert audio files to mono within SFML, or do I need to use external audio software?

Thanks again!

6
Audio / [SOLVED]Spatialization of sound in 2D game (SFML 2.0)
« on: November 05, 2012, 06:53:52 pm »
Hi I am having issues with spatialized sound in my 2D platformer. According to the tutorial
Quote
A sound can be spatialized only if it has a single channel, i.e. if it's a mono sound.

I believe my sound is stereo (.OGG format) so that would explain why the spatialization is not working. My question is: Can stereo sounds still work with the sf::listener class, particularly having sounds that are farther away played quieter? I have made a hacky work-around that calculates the sound volume based on distance from listener, but i'd like to use the built in SFML function if possible.

Thanks!

Pages: [1]
anything