1
Window / Re: Subclassing RenderWindow in an MFC SDI app?
« on: June 28, 2014, 09:07:27 am »
Well, it's incredibly hacky, but following the last few posts in this thread seemed to help a lot.
I honestly believe a better solution either exists, or should exist...
But after compiling the latest build on GitHub, and forcing the following code to run after each WM_SIZE event, it actually renders as expected:
I can now safely subclass sf::RenderWindow in an MFC doc/view architecture application.
Unfortunately, I am no longer successful in linking to the static libs (due to lots of Code Generation RTL issues), but I'm okay with using the dynamic libs as long as they actually work as expected.
I honestly believe a better solution either exists, or should exist...
But after compiling the latest build on GitHub, and forcing the following code to run after each WM_SIZE event, it actually renders as expected:
CRect rc;
GetWindowRect(rc);
setSize(sf::Vector2u(rc.Width(), rc.Height()));
sf::View view = getView();
view.reset( sf::FloatRect(0, 0, float(rc.Width() - 1), float(rc.Height() - 1)) );
setView(view);
GetWindowRect(rc);
setSize(sf::Vector2u(rc.Width(), rc.Height()));
sf::View view = getView();
view.reset( sf::FloatRect(0, 0, float(rc.Width() - 1), float(rc.Height() - 1)) );
setView(view);
I can now safely subclass sf::RenderWindow in an MFC doc/view architecture application.
Unfortunately, I am no longer successful in linking to the static libs (due to lots of Code Generation RTL issues), but I'm okay with using the dynamic libs as long as they actually work as expected.