Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Shader is not applied to deque of drawables?  (Read 1381 times)

0 Members and 1 Guest are viewing this topic.

NGM88

  • Full Member
  • ***
  • Posts: 162
    • View Profile
Shader is not applied to deque of drawables?
« on: January 04, 2018, 04:10:16 pm »
I have a base class Entity : public sf::Drawable, public sf::Transformable

I have 2 derived classes Player and Silhouette

Player owns a singular Silhouette object and a deque of Silhouette objects.

I apply a shader to both the singlular object and the deque.

The singular object's shader works fine, the deque's shader has no effect.

Some of the code:
for (auto const& s : Subjects) // Subjects has a Player pointer
{
        if (s->is_silhouette()) // not relevant
        {
                WINDOW.draw(s->objSilhouette, &shColor); // works fine
        }
}
 
for (auto const& s : Subjects)
{
        for (auto const& e : s->Trail) // Trail is the deque of Silhouette objects
        {
                WINDOW.draw(e), &shColor; // doesn't work!
        }
}
 

NGM88

  • Full Member
  • ***
  • Posts: 162
    • View Profile
Re: Shader is not applied to deque of drawables?
« Reply #1 on: January 04, 2018, 04:13:12 pm »
omfg I'm such a noob. I didn't notice the () were in the wrong place. FALSE ALARM, please delete

really weird that it compiled like that, with the shader reference just sitting there doing nothing ;D
« Last Edit: January 04, 2018, 04:16:32 pm by NGM88 »