*

Dnake

  • *
  • 29
    • View Profile
Viewport in v0.7dev
« on: 03 October 2014, 09:00:57 »
I noticed that the new view system doesn't take in account the viewport. Or if it does, I have issues to correctly set the view of TGUI.
In the exemple, I have a resizable window, and a function that set a viewport every time the window is resized. The goal is to keep a certain ratio in the view of the window. That trick works fine with native SFML stuff and TGUI 0.6, but since the last version I'm not longer able to do this.

I assume that the concerned code is between line 101 and 106 of Gui.cpp.
« Last Edit: 03 October 2014, 09:03:01 by Dnake »

*

texus

  • *****
  • 1172
    • View Profile
    • Texus's Blog
Re: Viewport in v0.7dev
« Reply #1 on: 03 October 2014, 12:58:36 »
If you want to get it to work quickly, you should make the following change in the tgui code: https://github.com/texus/TGUI/commit/350a3b2fe6cfd71dc57230f2588e8ff021a28f9d

I reverted the change right after I pushed it because I realized that this will only work when the sfml and tgui views are identical. But if this is the case then you can make the change in your local tgui code while I try to find a better solution.

*

Dnake

  • *
  • 29
    • View Profile
Re: Viewport in v0.7dev
« Reply #2 on: 03 October 2014, 13:18:02 »
Thank you!  :D

*

texus

  • *****
  • 1172
    • View Profile
    • Texus's Blog
Re: Viewport in v0.7dev
« Reply #3 on: 03 October 2014, 15:29:25 »
It should be fixed now.

Apparently I was already storing the view and its viewport, I just didn't set it when drawing.