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

Pages: [1]
1
General / Re: sf::Sprites and std::lists
« on: May 30, 2014, 01:08:23 am »
Whoops, my bad. I replaced

BGCollTiles.erase(it);

with

it=BGCollTiles.erase(it);

and it now works. Thanks for the help guys.

2
General / Re: sf::Sprites and std::lists
« on: May 30, 2014, 12:12:31 am »
Thanks for the input. I played with it a bit more and here's what I have (with more legibility).

if (sf::Mouse::isButtonPressed(sf::Mouse::Right))
{
        for (std::list<sf::Sprite>::iterator it = BGCollTiles.begin(); it != BGCollTiles.end();)
        {
                if(it->getGlobalBounds().contains(sf::Mouse::getPosition(App).x,sf::Mouse::getPosition(App).y))
                {
                        BGCollTiles.erase(it);
                }
        else
                ++it;
        }
}

Now it compiles, but right-clicking a tile crashes the program. Clicking anywhere else works fine. Also, I failed to mention that I am using Visual Studio 2009, so I don't have access to C++11. Is there any way I can pull this off without it?

Sorry, i'm still new to C++ so go easy on me, haha.

3
General / sf::Sprites and std::lists
« on: May 29, 2014, 04:21:09 am »
Hi, I'm trying to do something fairly simple with my code, where if I right-click a tile it gets removed from the std::list of drawables I defined. Here's a snippet of my code:

if (sf::Mouse::isButtonPressed(sf::Mouse::Right)){
for each(sf::Sprite Tile in BGCollTiles){
if(Tile.getGlobalBounds().contains(sf::Mouse::getPosition().x,sf::Mouse::getPosition().y)){
BGCollTiles.remove(Tile);}}}

I end up getting a long list of linker errors related to std::list and sf::Sprite. However, I have similar code that compiles fine relating to collisions, so I'm not sure what's wrong. Any help would be appreciated.

4
General / Extra Window
« on: June 27, 2012, 06:07:42 pm »
Hi, I've been making a game with SFML 1.6 on Visual Studio 2008 (Windows 7 x64, "-s" libraries), and I'm having a minor problem.

While the game builds and plays just fine, a blank Win32 window shows up before the render window. It seems to do simple things (ie. if theres an error, it prints it), but there is really no use for it.

I installed it exactly according to the tutorial on the website (and just double-checked to make sure), and I don't think it's a problem with my code, because if I compile the Pong or PostFX samples, the window still appears, while it doesn't on the precompiled binaries.

I'm new to SFML (and C++ in general), so I'm sure it's a simple user error, but any help would be greatly appreciated.

Thank you!

5
Audio / Re: Multiple Streams Simultaneously
« on: June 25, 2012, 11:08:45 pm »
Oh, okay. I'll look into that.

Thank you for the reply!

Edit: For anyone else that may have this problem, limiting the framerate to 60 seemed to get rid of some of the desync.

6
Audio / Multiple Streams Simultaneously
« on: June 25, 2012, 10:10:56 pm »
Hi, I'm making a game where instruments drop in and out depending on in-game circumstances by having them stream at the same time and then changing the volume to 0 or 100, depending on if they're being used.

However, there is a delay between the instruments, and I was wondering if there was a way to sync all streams' positions to that of one stream, so they are all in sync.

I'm using SFML 1.6, and have 6 .oggs playing at the same time.

Thanks!

Pages: [1]