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

Author Topic: SFGUI Multiple sfg::Desktop  (Read 1763 times)

0 Members and 1 Guest are viewing this topic.

SeeSoftware

  • Newbie
  • *
  • Posts: 1
    • View Profile
SFGUI Multiple sfg::Desktop
« on: June 21, 2018, 02:08:20 am »
Hi, this might be not related to SFML but i cant find anywhere how to have 2 sfg::Desktops drawn seperately.
Im trying to draw a gui for my main application and a seperate one inside a sf::RenderTexture.

sfg::SFGUI sfgui;
sfg::Desktop desk1;
sfg::Desktop desk2;
//Add stuff to desktops

sf::RenderTexture texture;
texture.create(512,512);

//Draw code
window.clear();

texture.clear();
sgui.Display(texture); //??? will draw both desktops, but want to draw only desk1
texture.display();

sfgui.Display(window); //??? will draw both desktops, but want to draw only desk2

window.display();
//Draw code

 

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: SFGUI Multiple sfg::Desktop
« Reply #1 on: June 22, 2018, 04:34:47 pm »
This was answered on the now no-longer-existing SFGUI forum. :D

The de facto standard "solution" to this problem is to split your windows into multiple subsets that you store somewhere on your own. They should all be added to the same sfg::Desktop. All you do is hide and show each set to emulate having multiple distinct desktops when in fact you are only using one.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

 

anything