diff --git a/buildconfig/stubs/pygame/display.pyi b/buildconfig/stubs/pygame/display.pyi index 5124e92b47..43e1ec8c05 100644 --- a/buildconfig/stubs/pygame/display.pyi +++ b/buildconfig/stubs/pygame/display.pyi @@ -44,14 +44,16 @@ def set_mode( display: int = 0, vsync: int = 0, ) -> Surface: ... -def get_surface() -> Surface: ... +def get_surface() -> Optional[Surface]: ... def flip() -> None: ... @overload +def update() -> None: ... +@overload def update( - rectangle: Optional[Union[RectLike, Iterable[Optional[RectLike]]]] = None, / + rectangle: Optional[Union[RectLike, Iterable[Optional[RectLike]]]], / ) -> None: ... @overload -def update(x: int, y: int, w: int, h: int, /) -> None: ... +def update(x: float, y: float, w: float, h: float, /) -> None: ... @overload def update(xy: Point, wh: Point, /) -> None: ... def get_driver() -> str: ... diff --git a/docs/reST/ref/display.rst b/docs/reST/ref/display.rst index 310ebb38fa..223a3744de 100644 --- a/docs/reST/ref/display.rst +++ b/docs/reST/ref/display.rst @@ -251,6 +251,7 @@ required). | :sl:`Get a reference to the currently set display surface` | :sg:`get_surface() -> Surface` + | :sg:`get_surface() -> None` Return a reference to the currently set display Surface. If no display mode has been set this will return None. @@ -272,7 +273,10 @@ required). .. function:: update | :sl:`Update all, or a portion, of the display. For non-OpenGL displays.` - | :sg:`update(rectangle=None, /) -> None` + | :sg:`update() -> None` + | :sg:`update(rectangle, /) -> None` + | :sg:`update(x, y, w, h, /) -> None` + | :sg:`update((x, y), (w, h), /) -> None` | :sg:`update(rectangle_iterable, /) -> None` For non OpenGL display Surfaces, this function is very similar to diff --git a/src_c/doc/display_doc.h b/src_c/doc/display_doc.h index 17b881bd49..8e03e368fe 100644 --- a/src_c/doc/display_doc.h +++ b/src_c/doc/display_doc.h @@ -4,9 +4,9 @@ #define DOC_DISPLAY_QUIT "quit() -> None\nUninitialize the display module" #define DOC_DISPLAY_GETINIT "get_init() -> bool\nReturns True if the display module has been initialized" #define DOC_DISPLAY_SETMODE "set_mode(size=(0, 0), flags=0, depth=0, display=0, vsync=0) -> Surface\nInitialize a window or screen for display" -#define DOC_DISPLAY_GETSURFACE "get_surface() -> Surface\nGet a reference to the currently set display surface" +#define DOC_DISPLAY_GETSURFACE "get_surface() -> Surface\nget_surface() -> None\nGet a reference to the currently set display surface" #define DOC_DISPLAY_FLIP "flip() -> None\nUpdate the full display Surface to the screen" -#define DOC_DISPLAY_UPDATE "update(rectangle=None, /) -> None\nupdate(rectangle_iterable, /) -> None\nUpdate all, or a portion, of the display. For non-OpenGL displays." +#define DOC_DISPLAY_UPDATE "update() -> None\nupdate(rectangle, /) -> None\nupdate(x, y, w, h, /) -> None\nupdate((x, y), (w, h), /) -> None\nupdate(rectangle_iterable, /) -> None\nUpdate all, or a portion, of the display. For non-OpenGL displays." #define DOC_DISPLAY_GETDRIVER "get_driver() -> name\nGet the name of the pygame display backend" #define DOC_DISPLAY_INFO "Info() -> VideoInfo\nCreate a video display information object" #define DOC_DISPLAY_GETWMINFO "get_wm_info() -> dict\nGet information about the current windowing system"