From fe96ed3c451548278197e2da74d3d53b1d6a8dd9 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 16 May 2020 21:18:02 +0200 Subject: Add default and maximum size --- pugl/pugl.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'pugl/pugl.h') diff --git a/pugl/pugl.h b/pugl/pugl.h index fe8b585..b489407 100644 --- a/pugl/pugl.h +++ b/pugl/pugl.h @@ -559,6 +559,7 @@ typedef enum { PUGL_FAILURE, ///< Non-fatal failure PUGL_UNKNOWN_ERROR, ///< Unknown system error PUGL_BAD_BACKEND, ///< Invalid or missing backend + PUGL_BAD_CONFIGURATION, ///< Invalid view configuration PUGL_BAD_PARAMETER, ///< Invalid parameter PUGL_BACKEND_FAILED, ///< Backend initialisation failed PUGL_REGISTRATION_FAILED, ///< Class registration failed @@ -946,6 +947,16 @@ puglGetFrame(const PuglView* view); PUGL_API PuglStatus puglSetFrame(PuglView* view, PuglRect frame); +/** + Set the default size of the view. + + This should be called before puglResize() to set the default size of the + view, which will be the initial size of the window if this is a top level + view. +*/ +PUGL_API PuglStatus +puglSetDefaultSize(PuglView* view, int width, int height); + /** Set the minimum size of the view. @@ -955,6 +966,15 @@ puglSetFrame(PuglView* view, PuglRect frame); PUGL_API PuglStatus puglSetMinSize(PuglView* view, int width, int height); +/** + Set the maximum size of the view. + + If an initial maximum size is known, this should be called before + puglRealize() to avoid stutter, though it can be called afterwards as well. +*/ +PUGL_API PuglStatus +puglSetMaxSize(PuglView* view, int width, int height); + /** Set the view aspect ratio range. -- cgit v1.2.1