[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] how to blit a Surface to screen with OPENGLBLIT arg?



I want use pyopengle to render some 3d effects, but I also need to
blit some normal Surface to screen before redering 3d object.
my code like these:

pygame.init()
screen = pygame.display.set_mode((640,480),DOUBLEBUF|OPENGLBLIT|OPENGL)

background = pygame.Surface(screen.get_size())
background = background.convert()
background.fill((250, 250, 0))

while 1:     
        #clear screen and move camera
        glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT)
        screen.blit(background, (0, 0))
        
        #orbit camera around by 1 degree
        glRotatef(1, 0, 1, 0)                    

        drawcube()
        pygame.display.flip()
        pygame.time.wait(10)
but it seems "screen.blit(background, (0, 0))" do nothing when set
OPENGLBLIT,why?