How to create OpenGL-enabled window with transparent background using xlib and glx

早过忘川 提交于 2019-12-22 18:48:33

问题


I'd like to create a window with transparent background and then render something onto it using OpenGL. I don't want to use the trick where whatever is behind the window is captured and then painted as a background - I want real transparency (I have composition manager running). I'm not using any GUI library (GTK, QT, ...), just raw xlib and glx.

Anyone knows how to do it?


回答1:


Take a look at these patches to Neverball and SDL. They seem to be based on NVidia's driver documentation.

I haven't tried it, but it looks as if you just select the correct GLX config (GLX_RGBA_BIT), clear your window appropriately, and have a compositor running, it should Just Work™.



来源:https://stackoverflow.com/questions/4066245/how-to-create-opengl-enabled-window-with-transparent-background-using-xlib-and-g

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