I want to use glClear and glClearColor to fill the frame buffer with color, including alpha transparency. However, the framebuffer always appears as opaque when snapped to the texture that is displayed on the screen.
I want everything visualized in a framebuffer to keep them transparent. I just want to change the background.
See the following code:
def create_texture(surface): surface.texture = glGenTextures(1) glMatrixMode(GL_MODELVIEW) glLoadIdentity()
surface.background_alpha should be transparency for the framebuffer background. Here is my initialization code:
def __init__(self,title,game_size,on_exit = sys.exit): self.keys = [False] * 323 self.events = [] pygame.font.init() pygame.mixer.init() self.title = title self.game_size = game_size self.first_screen = (1280,720)
The code is a bit dirty because I made a lot of tweaks to make things work, and I didn't tidy everything up correctly.
If anyone can help me, I really thank you.
source share