title: C++ Can't increment a variable
body: <p>I'm working on an Animation class for a small game engine, and for some reason the frame counter does not want to increment, it keeps stuck at 0 or 1.</p>
  
  <p>This is the Animation::Step code (here's where the incrementation is supposed to happen):</p>
  
  <pre><code>void Animation::Step()
  {
      ...
  
      time += (float)glfwGetTime();
      if (time &gt;= Speed)
      {
          time = 0;
          if (f++ &gt;= count - 1)
          {
              ...
          }
      }
  
      // Here I do some math to get a clip rectangle...
  
      ...
  }
  </code></pre>
  
  <p>Now this is the part where Animation::Step is called:</p>
  
  <pre><code>inline void DrawAnimation(Animation ani, Vec2 pos, BlendMode mode, DrawTextureAttributes attr)
  {
      ani.Step();
  
      ...
      // draw texture
  }
  </code></pre>
  
  <p>And in the game mainloop:</p>
  
  <pre><code>void on_render(Renderer r)
  {
      DrawTextureAttributes attr;
      attr.Scale = Vec2(1.5);
  
      r.DrawAnimation(ani, Vec2(320, 240), BlendMode::Normal, attr);
  }
  </code></pre>
  
  <p>EDIT:
  The class definition:</p>
  
  <pre><code>class Animation
  {
  public:
      Animation() {}
      Animation(Texture2D tex, int rows, int cols, int *frames, float speed, bool loop=false);
      Animation(Texture2D tex, int rows, int cols, float speed, bool loop=false);
  
      Texture2D Texture;
      std::vector&lt;int&gt; Frames;
      float Speed;
      bool Loop;
  
      float getCellWidth();
      float getCellHeight();
  
      void Step();
  
      UVQuad RETUV;
  
  private:
      int f, r, c; // here's F 
      float w, h;
      float time;
  };
  </code></pre>
  
  <p>Well, thanks in advance! (and sorry for my kinda bad english)</p>