Advertisement
smathot

Untitled

Dec 14th, 2012
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. import pygame
  3.  
  4. pygame.init()
  5. pygame.display.init()
  6.  
  7. res = (1024,768)
  8. pygame.display.set_mode(res,pygame.FULLSCREEN|pygame.HWSURFACE|pygame.DOUBLEBUF)
  9. screen = pygame.display.get_surface()
  10.  
  11. # This creates a surface that does not match the display mode, which causes a
  12. # segmentation fault
  13. sfc = pygame.surface.Surface(screen.get_size())
  14.  
  15. # Any of the two lines below should work:
  16. # sfc = pygame.surface.Surface(screen.get_size(), pygame.FULLSCREEN|pygame.HWSURFACE|pygame.DOUBLEBUF)
  17. # sfc = screen.copy()
  18. screen.blit(sfc,(0,0))
  19.  
  20. # To avoid the segmentation fault a del statement works.
  21. #del(sfc)
  22.  
  23. pygame.display.quit()
  24. pygame.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement