LWJGL Forum

Programming => General Java Game Development => Topic started by: GeoMaster on September 30, 2011, 13:20:45

Title: How to set Display Canvas transparent?
Post by: GeoMaster on September 30, 2011, 13:20:45
Hallo,

I wonder how I can set the org.lwjgl.Display´s canvas transparent. I can only set a background color (RGB) or a background image for the main window. I´ve tried a couple of things to avoid lwjgl to clear the canvas and draw a complete background but I was not able to avert it.

Does a solution exist for my need?

Thank you
Tobias
Title: Re: How to set Display Canvas transparent?
Post by: Chuck on September 30, 2011, 16:36:11
Window transparency is something the window manager does, and isn't something you can easily control from the application.  I don't think lwjgl directly supports transparent windows at all.

Title: Re: How to set Display Canvas transparent?
Post by: broumbroum on September 30, 2011, 19:40:17
perhaps the directx ( http://lwjgl.org/forum/index.php/board,14.0.html ) implementation of lwjgl would solve you're problem if your on windows : http://cboard.cprogramming.com/windows-programming/98875-transparent-window-without-using-layers.html
JDK 7 also provides native window translucency, but opengl doesn t seem to. :-[

(EDIT : links)
(EDIT 2 : so far no news from a d3d rendering on lwjgl...)
Title: Re: How to set Display Canvas transparent?
Post by: kappa on September 30, 2011, 20:28:03
As it stands LWJGL's native Display window doesn't support transparency. It is possible these days to create a transparent window pretty easily and draw OpenGL, especially with Aero, Compiz, etc around. Not sure how useful a feature it would be though and if it would be worth the effort. However anyone willing to give it a go should feel free to create a patch.
Title: Re: How to set Display Canvas transparent?
Post by: jediTofu on October 01, 2011, 04:41:28
Right before your app displays a window, take a screenshot.  Then use it as you background  ;)
This would at least work for fullscreen apps...