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.


Topics - mbrown3391

Pages: [1]
1
I created a derived class, MyCanvas, from the wxSFMLCanvas class found here http://sfml-dev.org/tutorials/1.6/graphics-wxwidgets.php. Now when I call MyCanvas::setSize(), the rendering area appears to resize as expected, however a subsequent call to MyCanvas::getSize() returns the original size. As a result, graphics do not render properly.

Here is a condensed version of the class:
Quote

class MyCanvas : public wxSFMLCanvas
{
public:
   Canvas(wxWindow* Parent, int Id, const wxPoint& Position, long Style)
      : wxSFMLCanvas(Parent, Id, Position, wxSize(500, 500), Style)
   {
      sf::Vector2u currentSize = this->getSize(); //currentSize = (496,496)
   }

   ~Canvas(void) {}

private:
   sf::View view;

   void OnUpdate(void) override
   {
      view.reset(sf::FloatRect(0,0,250,250));
      this->setSize(Vector2u(250, 250));
      this->setView(view);

      sf::Vector2u currentSize = this->getSize(); //currentSize = (496,496)
   }
}

As you can see, the RenderWindow thinks that it is at the original size, even though it now displays at the new size. I'm not sure what I am doing wrong here. Any ideas? I am using SFML 2.1 on 64-bit Windows 8.

Pages: [1]
anything