I'm trying to blit my character image using pygame, it works when opengl is not called
pygame.init()
display = pygame.display.set_mode((800, 600))
def draw(self,display):
if self.walkCount + 1 >= 30:
self.walkCount = 0
if self.left:
display.blit(walkLeft[self.walkCount // 6], (int(self.x), int(self.y)))
self.walkCount += 1
elif self.right:
display.blit(walkRight[self.walkCount // 6], (int(self.x), int(self.y)))
self.walkCount += 1
else:
display.blit(standing, (int(self.x), int(self.y)))
pygame.display.flip()
def redraw():
global WalkCount
display.fill((0, 0, 0))
Player1.draw(display)
while True:
redraw()
pygame.quit()
When opengl is called,
display = pygame.display.set_mode((800, 600), pygame.DOUBLEBUF | pygame.OPENGLBLIT)
...
def redraw():
global WalkCount
Player1.draw(display)
while True:
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
redraw()
pygame.quit()
it doesn't show my character image anymore, how do I fix it? Am I missing anything?