Window opacity/transparency, possible?

487 views
Skip to first unread message

Lord Anton Hvornum

unread,
May 14, 2017, 8:05:17 AM5/14/17
to pyglet-users
I find that no one has asked the question or I'm alone in trying this.
I would like to create something similar to this:

https://i.stack.imgur.com/iTwMo.png

A transparent glClear() "window" that i can render things in with alpha channels.

And it's fully possible to create this with a C OpenGL extension, but I find very little on this on the Pyglet side of things.
I've been using Pyglet för several years now and have wanted this feature for quite a while but never gotten around to bother anyone about it, but here i am. Is it at all possible?

Best regards //Anton

Benjamin Moran

unread,
May 15, 2017, 10:07:58 PM5/15/17
to pyglet-users
Hi Anton,

Pyglet is just a normal X application under Linux, wrapping xlib with ctypes. This means that it's definitely possible to do this, but there is no current high-level abstraction written in pyglet to do it.
There is a gist here that shows a C example (which you may have seen already):  https://gist.github.com/je-so/903479

From what I can tell, you need to set a few different flags in the window attributes. If you want to have a try getting it working, you can find the code in
pyglet/window/xlib/__init__.py

It would be a nice feature to have at some point, which would allow pyglet to be used for different types of on screen display projects.
Reply all
Reply to author
Forward
0 new messages