Camera.get_surface returns None on Windows

Issue #128 open
cgohlke created an issue

A patch is attached.

Comments (7)

  1. Vladimir Simonov

    It seems that this patch never made it into the pygame's repository. Can anyone fix it? Btw, we should remove unused 'if' condition check and 'else' code after that:

    if 1:
      # Need to flip the image.
      surf = pygame.image.fromstring(abuffer, (width, height), "RGB", 1)
      # swap it from a BGR surface to an RGB surface.
      r,g,b,a = surf.get_masks()
      r,g,b,a = surf.get_shifts()
    return surf

    'If' is unnecessary, because '1' is always True and 'else' never evaluates.

  2. Log in to comment