3

I would like to create a window such that there is no "black background" area, but instead you see through to any other windows that are open, etc.

That is, render the scene and only the scene, leaving no frame and no background area.

I've read about a method that involves rendering to a hidden OpenGL window and buffering it in memory, creating a transparent layered window, and copying from memory to the transparent window.

Obviously this is very cpu/memory intensive, so I was wondering if there was any better ways of doing it, within Java and LWJGL?

genpfault
  • 51,148
  • 11
  • 85
  • 139
nighthawk454
  • 943
  • 12
  • 20

2 Answers2

3

This is something that can only be accomplished with platform-specific code.

This thread provides an interesting discussion on the subject. This post shares C code that accomplish this effect on Windows, and this post on Linux.

Community
  • 1
  • 1
karlphillip
  • 92,053
  • 36
  • 243
  • 426
  • Yeah I found that via Google, the comments say that that way is very cpu intensive. That may be the only way to accomplish this on windows though? – nighthawk454 Apr 23 '12 at 15:06
  • 1
    Yes, unfortunately every frame processed in the GPU must be copied to RAM and then draw on the screen to give the transparent window effect. And this is the bottleneck of this type of thing. If you think about it, there aren't many commercial applications doing this exactly because it can't be done in a fast way. – karlphillip Apr 23 '12 at 16:18
  • 1
    Ah ok, that's what I was afraid of. Seems like OS writers should be on that by now, huh? Thanks for the clarification! – nighthawk454 Apr 25 '12 at 19:34
2

This is OS specific, since the "OS/window manager/not-you-department" owns the other windows.

On Windows, OpenGL cannot participate in this sort of compositing. Other OS's might allow it.

Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982
  • Please provide links for this. Somehow the surface needs to be integrated into the desktop compositing. OpenGL apps on Windows bypass the `DWM` somehow and use a lower system layer? Or is [DWM just for WPF apps](http://blogs.msdn.com/b/greg_schechter/archive/2006/06/09/623566.aspx)? – Stefan Hanke Apr 23 '12 at 07:35