带有透明背景的LWJGL窗口? [英] LWJGL Window with Transparent Background?

查看:226
本文介绍了带有透明背景的LWJGL窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个窗口,使其没有黑色背景区域,但是您可以看到其他任何打开的窗口等。

即渲染场景和场景,不留帧,也不留下背景区域。

我读过一个涉及渲染到隐藏的OpenGL窗口并将其缓存在内存中的方法,创建一个透明的分层窗口,并从内存复制到透明窗口。

显然这是cpu /内存密集型的,所以我想知道在Java和LWJGL中是否有更好的方法来实现它?

解决方案

这是只能通过特定于平台的代码完成的事情。



​​此主题提供了一个关于这个问题的有趣讨论。 此文共享 C 代码,可在Windows上实现此效果,这篇文章在Linux上。


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?

解决方案

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.

这篇关于带有透明背景的LWJGL窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆