Flags And Depth In Coding (pygame)
So I am starting to learn pygame and in this line: pygame.display.set_mode((640,300), 0, 32) I'm wondering what does the 0, and 32 mean, and how will the program change if I chan
Solution 1:
From the documentation:
The flags argument is a collection of additional options. The depth argument represents the number of bits to use for color.
In this case, 0 means "don't set any flags." The available flags are:
pygame.FULLSCREEN create a fullscreen display
pygame.DOUBLEBUF recommended for HWSURFACE or OPENGL
pygame.HWSURFACE hardware accelerated, only in FULLSCREEN
pygame.OPENGL create an opengl renderable display
pygame.RESIZABLEdisplay window should be sizeable
pygame.NOFRAMEdisplay window will have no border or controls
If you wanted to, say, have an OpenGL-renderable fullscreen surface, you'd set flags to pygame.FULLSCREEN | pygame.OPENGL
-- OR
-ing them together to get the right flag value.
The 32 is the color depth, in bits, of your display surface.
Post a Comment for "Flags And Depth In Coding (pygame)"