0

I use kivy in my application and try to create a transparent background window. I do this with:

Window.clearcolor = (1,1,1,0)
Window.clear()

That produces a white window - opaque. Kivy directly calls glClearColor from the OpenGL 4 API (https://www.khronos.org/opengl/).
The docs say, that the last parameter is the alpha channel so I expect my window to be transparent.

Do I have a mistake in my thinking or is this a bug?

Fuzzyma
  • 7,619
  • 6
  • 28
  • 60
  • Did you check the GL pipeline state? Is `BLENDING` actually enabled by the framework you're using? There is no question about what `glClearColor` but as pleluron mentioned, this will have no effect without blending enabled. – thokra Oct 14 '16 at 07:54

1 Answers1

1

Default pixel formats are often RGB, so the alpha value is only used for blending operations. You need the correct pixel format to make your surfaces transparent, see this answer.

Community
  • 1
  • 1
pleluron
  • 733
  • 4
  • 12
  • mh ok - i have to adapt my question since iam on desktop and not on android... ty anyway – Fuzzyma Oct 13 '16 at 23:50
  • I made the assumption kivy was build on top of OpenGL ES - but there is no cross-platform solution for this. Kivy should implement this themselves, but to answer your question, `glClearColor()` works as intended. – pleluron Oct 14 '16 at 01:00
  • Kivy uses the open gl version in the system when available. In my case that's opengl 4. Thx for your clarification! – Fuzzyma Oct 14 '16 at 08:08