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:
    
    ...
    
    else:
    
      # 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()
      surf.set_masks((b,g,r,a))
    
      r,g,b,a = surf.get_shifts()
        surf.set_shifts((b,g,r,a))
    return surf
    

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

  2. Log in to comment