LWJGL Window with Transparent Background?

…衆ロ難τιáo~ 提交于 2019-12-05 03:23:31

问题


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?


回答1:


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.




回答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.



来源:https://stackoverflow.com/questions/10276020/lwjgl-window-with-transparent-background

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!