SFML community forums

Help => General => Topic started by: SeeSoftware on June 21, 2018, 02:08:20 am

Title: SFGUI Multiple sfg::Desktop
Post by: SeeSoftware 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

 
Title: Re: SFGUI Multiple sfg::Desktop
Post by: binary1248 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.