FULLSCREEN and DOUBLEBUF

Paul St George email at paulstgeorge.com
Sat Jun 9 15:31:23 EDT 2018


> On 08/06/18 09:00, Paul St George wrote:
>> Excellent. Now I know what to do in this instance and I understand 
>> the principle.
>>
>> I hesitantly tried this:
>>
>>      screen = pygame.display.set_mode((720,480), pygame.FULLSCREEN | 
>> pygame.DOUBLEBUF)
>>
>> Hesitantly because I expected the *bitwise or operator* (|) to work 
>> like a toggle, so FULLSCREEN or DOUBLEBUF.
>
On 08/06/2018 12:52, Rhodri James wrote:
> The bitwise OR operator peforms a bitwise OR, i.e. *both* flags get set.
>
>> No errors were reported, but how would I check that DOUBLEBUF had 
>> been set? Is there a general rule, such as replace 'set_something' 
>> with 'get_something'?
>
> There's documentation.  The link Chris gave you for 
> pygame.display.set_mode() tells you that you get a Surface out of it. 
> Reaching for the docs for that, this leaps out:
>
> https://www.pygame.org/docs/ref/surface.html#pygame.Surface.get_flags
>
>
So...

     print pygame.display.get_surface()
gives
<Surface(720x480x32 SW)>

and
     print screen.get_flags()
gives
-2147483648

The lists of flags at 
<https://www.pygame.org/docs/ref/surface.html#pygame.Surface.get_flags> 
and <http://www.rpi.edu/dept/acm/packages/SDL/1.2.6/include/SDL/SDL_video.h>

has nothing remotely like -2147483648. I would expect something more 
like 0x40000000

Am I using the wrong code to determine whether I have successfully set 
DOUBLEBUF with

     screen = pygame.display.set_mode((720,480), pygame.FULLSCREEN | 
pygame.DOUBLEBUF)

AND

What does -2147483648 tell me? Does this number need converting?
>
>
>




More information about the Python-list mailing list