LWJGL Window with Transparent Background?

2020-06-23 08:29发布

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?

2条回答
可以哭但决不认输i
2楼-- · 2020-06-23 08:42

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.

查看更多
beautiful°
3楼-- · 2020-06-23 08:58

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.

查看更多
登录 后发表回答