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

Pages: [1]
1
General / Re: sf::Drawable managment
« on: July 09, 2018, 12:56:09 pm »
I had same idea, but some strange errors happened. I will investigate the thing, and edit this post if I don't solve it.

Btw. thanks Laurent for small, but important help.

Edit: okay, I got problem Solved.

2
General / Re: sf::Drawable managment
« on: July 09, 2018, 11:41:32 am »
Wow, Laurent here...

So, to summarize. My (and that guy's too) idea was to create std::vector of pointers to sf::Drawables. Idea was pretty nice, and everything was OK, until I went into deleting pointers. I created a typical loop using iterators, like this:
for(auto a = vector.begin(); a != vector.end();)
{
    if(**a == this->sprite)
    {
          //remove
     }
     else
     { ++i; }
}
 

The problem is, I cannot compare dereferenced iterator to our sprite. Visual Studio even gives weird error about sf::Sprite != sf::Sprite. And that's pretty much the case.

I thought about using some ID, but I don;t know if it is something good.

3
General / [SOLVED] sf::Drawable managment
« on: July 08, 2018, 07:23:48 pm »
Hi there!

I'm doing SFML for a while, but I have a question. How to manage sf:Drawables in a game? I'll expand that:
I want to have something like that: I have a special object that stores all sf::Drawables in container, that object also has inherited draw(). All of this is to simply write one function to draw all the drawables. But i went to a problem well described here: https://en.sfml-dev.org/forums/index.php?topic=14262.0. So, I'm thinking, how to do that. I would have system that registers any drawables automatically, in object constructor. Somebody suggested using std::map and ID's, but it is possible to just use Vector?

Pages: [1]
anything