pygame-ce
pygame-ce copied to clipboard
Replace `get_surface` method of `Window` with `surface` property
I know get_surface was added with similarity to pygame.display in mind, but I think having this as a property instead can make things easier and neater for users of this API.
With this, the users would not need to keep track of surface of a window in a separate variable
I agree with the current system not enforcing a clear distinction between hardware and software rendering, but IMO get_surface does not help much in this regard either.
The best way to make a clear distinction is to actually make Window a base class (with not much changes to its existing structure), and have two distinct classes, maybe something like SoftwareWindow and HardwareWindow. SoftwareWindow will have things like .flip() and .surface property, whereas HardwareWindow could have things like a .renderer property?
That's an intriguing idea.
I'd suggest SurfaceWindow and RendererWindow as the names. We'd also need OpenGLWindow. (Potentially VulkanWindow and GPUWindow (SDL GPU API coming to SDL3) in the future)