flya flya
2005-08-28 02:53:06 UTC
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?
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?