Tranparent Window

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Ghus
Posts: 13
Joined: Wed May 12, 2010 5:42 pm

Tranparent Window

Post by Ghus »

hi

can anyone tell me if it is possible to set the background of the main irrlicht window fully/partial transparent

i tryied this

driver->beginScene(true, true, video::SColor(0,0,0,0));

but i only get a black screen, i cant see throught it :(

thanks in advance

note: i am using Linux Ubuntu and Irrlicht 1.7.2
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Tranparent Window

Post by mongoose7 »

You can't set the Irrlicht window to transparent, in the sense that you can see through it to windows underneath. And, certainly, this is not the function of the alpha component of the background colour.
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Re: Tranparent Window

Post by greenya »

Check 05.UserInterface how transparency done there.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Tranparent Window

Post by CuteAlien »

You can set Irrlicht IGUIElement windows transparent, but not the main-window (so the desktop shines through as often seen with modern Window-Managers). I don't know what would be needed to support that (would be cool sometimes...).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Tranparent Window

Post by hendu »

System-dependent. For linux compositing managers, you'd need to set a NETWM hint for requesting transparency. How it would work with opengl I don't know.
Ghus
Posts: 13
Joined: Wed May 12, 2010 5:42 pm

Re: Tranparent Window

Post by Ghus »

hi

thanks for all the replys it helped me to start searching

i found this parameter WithAlphaChannel in the SIrrlichtCreationParameters

documentation:

bool irr::SIrrlichtCreationParameters::WithAlphaChannel

Whether the main framebuffer uses an alpha channel.

In some situations it might be desireable to get a color buffer with an alpha channel, e.g. when rendering into a transparent window or overlay. If this flag is set the device tries to create a framebuffer with alpha channel. If this flag is set, only color buffers with alpha channel are considered. Otherwise, it depends on the actual hardware if the colorbuffer has an alpha channel or not.

i think this is what i need but when i set the flag true it doesnt seems to work. i think i need to activate the tranparency in Linux window manager so it works
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Tranparent Window

Post by hybrid »

This flag only does something useful under Linux anyway. At least it will chosse a video setting and context which supports the alpha layer. But the window setup is not yet properly made to support transparent windows. At least no in general. But if you know how to create a transparent window, you can use that combined with the alpha mode setting to render into the transparent window.
Post Reply