To recap: this thread started with a question. How do I know whether
DOUBLEBUF has been set with:
screen = pygame.display.set_mode((720,480), pygame.DOUBLEBUF |
pygame.FULLSCREEN)
Thanks go to Mark Lawrence and Richard Damon.
Using
print hex(screen.get_flags())
I can see that the order of the two flags does not make a difference.
screen = pygame.display.set_mode((720,480), pygame.DOUBLEBUF | pygame.FULLSCREEN)
screen = pygame.display.set_mode((720,480), pygame.FULLSCREEN | pygame.DOUBLEBUF)
both report the same
print hex(screen.get_flags())
'-0x80000000'
BUT
omitting DOUBLEBUF from the code
screen = pygame.display.set_mode((720,480), pygame.FULLSCREEN)
also makes no difference to the report
print hex(screen.get_flags())
'-0x80000000'
AND
with with only DOUBLEBUF in the code
screen = pygame.display.set_mode((720,480), pygame.DOUBLEBUF)
does not give the expected and desired '-0x40000000'
instead, the report is
print hex(screen.get_flags())
‘0x0’
0x0 (SWSURFACE) is consistent with
print pygame.display.get_surface()
‘<Surface(720x480x32 SW)>’
It seems that DOUBLEBUF is *not* being set. I am guessing this is because the arguments passed by pygame.display.set_mode() are only requests. The actual display will depend on the system, and what is available/possible.
More guessing leads me to wonder whether DOUBLEBUF is only available when HWSURFACE is being used so I tried three flags with:
flags = pygame.FULLSCREEN | pygame.DOUBLEBUF | pygame.HWSURFACE
screen = pygame.display.set_mode((0, 0), flags)
But no change (screen is still SW and DOUBLEBUF is not set):
print pygame.display.get_surface()
<Surface(720x480x32 SW)>
print hex(screen.get_flags())
-0x80000000
QUESTIONS
Can anyone find an error in any of this? I hope so.
Is DOUBLEBUF dependent on HWSURFACE?
If so, how does one force the change to a Hardware surface? ‘set_mode’ is not doing it.