FULLSCREEN and DOUBLEBUF

Paul St George email at paulstgeorge.com
Fri Jun 8 04:00:31 EDT 2018


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.

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'?

Paul St George


On 07/06/2018 19:56, Chris Angelico wrote:
> On Fri, Jun 8, 2018 at 3:12 AM, Paul St George <email at paulstgeorge.com> wrote:
>> This is both a narrow question about some code and a more general question
>> about syntax in Python
>>
>> Using the Pygame modules, I want to set both FULLSCREEN and DOUBLEBUF
>>
>> I can use
>> screen =
>> pygame.display.set_mode((screen_width,screen_height),pygame.FULLSCREEN)
>> to set a FULLSCREEN display
>>
>> Or, I can use
>> screen =
>> pygame.display.set_mode((screen_width,screen_height),pygame.DOUBLEBUF)
>> to set DOUBLEBUF
>>
>> But how do I set both FULLSCREEN and DOUBLEBUF?
>>
>> And, how can I test or check that DOUBLEBUF is set?
> This is definitely a pygame question. So let's grab the docos for that
> set_mode function.
>
> https://www.pygame.org/docs/ref/display.html#pygame.display.set_mode
>
> You're passing two parameters in each of your examples. The first is a
> tuple of (w,h) for the dimensions; the second is a constant for the
> mode you want. The name of the second argument is "flags", according
> to the documentation. That usually means that you can provide
> multiple. The exact mechanism for combining flags is given in the last
> paragraph of the docs. I'll let you take the credit for figuring out
> the details yourself :)
>
> ChrisA
>

-- 
Paul St George
http://www.paulstgeorge.com
http://www.devices-of-wonder.com

+44(0)7595 37 1302




More information about the Python-list mailing list