From d7a93950b3af397580572adf2e366f3b162104a9 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 23 Jan 2025 17:00:36 -0500 Subject: Rename puglPostRedisplay() to puglObscureView() For consistency with event types (since "obscure" is opposite "expose") and the upcoming puglObscureRegion(). --- include/pugl/pugl.h | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'include/pugl/pugl.h') diff --git a/include/pugl/pugl.h b/include/pugl/pugl.h index b70b91d..49e5fe5 100644 --- a/include/pugl/pugl.h +++ b/include/pugl/pugl.h @@ -298,9 +298,9 @@ typedef PuglAnyEvent PuglCloseEvent; This event is sent to every view near the end of a main loop iteration when any pending exposures are about to be redrawn. It is typically used to mark - regions to expose with puglPostRedisplay() or puglPostRedisplayRect(). For - example, to continuously animate, a view calls puglPostRedisplay() when an - update event is received, and it will then shortly receive an expose event. + regions to expose with puglObscureView() or puglPostRedisplayRect(). For + example, to continuously animate, obscure the view when an update event is + received, and it will receive an expose event shortly afterwards. */ typedef PuglAnyEvent PuglUpdateEvent; @@ -1422,13 +1422,13 @@ puglGetContext(PuglView* view); */ PUGL_API PuglStatus -puglPostRedisplay(PuglView* view); +puglObscureView(PuglView* view); /** Request a redisplay of the given rectangle within the view. - This has the same semantics as puglPostRedisplay(), but allows giving a - precise region for redrawing only a portion of the view. + This has the same semantics as puglObscureView(), but allows giving a precise + region for redrawing only a portion of the view. */ PUGL_API PuglStatus @@ -2194,6 +2194,22 @@ puglGetParentWindow(PuglView* view) return puglGetParent(view); } +/** + Request a redisplay for the entire view. + + This will cause an expose event to be dispatched later. If called from + within the event handler, the expose should arrive at the end of the current + event loop iteration, though this is not strictly guaranteed on all + platforms. If called elsewhere, an expose will be enqueued to be processed + in the next event loop iteration. +*/ +static inline PUGL_DEPRECATED_BY("puglObscureView") +PuglStatus +puglPostRedisplay(PuglView* view) +{ + return puglObscureView(view); +} + #endif // PUGL_DISABLE_DEPRECATED /** -- cgit v1.2.1