diff options
Diffstat (limited to 'pugl/pugl.h')
-rw-r--r-- | pugl/pugl.h | 73 |
1 files changed, 50 insertions, 23 deletions
diff --git a/pugl/pugl.h b/pugl/pugl.h index 6d2d8b1..26593f2 100644 --- a/pugl/pugl.h +++ b/pugl/pugl.h @@ -535,29 +535,6 @@ PUGL_API void puglInitWindowParent(PuglView* view, PuglNativeWindow parent); /** - Set the minimum window size before creating a window. -*/ -PUGL_API void -puglInitWindowMinSize(PuglView* view, int width, int height); - -/** - Set the window aspect ratio range before creating a window. - - The x and y values here represent a ratio of width to height. To set a - fixed aspect ratio, set the minimum and maximum values to the same ratio. - - Note that setting different minimum and maximum constraints does not - currenty work on MacOS (the minimum is used), so only setting a fixed aspect - ratio works properly across all platforms. -*/ -PUGL_API void -puglInitWindowAspectRatio(PuglView* view, - int minX, - int minY, - int maxX, - int maxY); - -/** Set transient parent before creating a window. On X11, parent must be a Window. @@ -648,6 +625,27 @@ PUGL_API PuglStatus puglSetFrame(PuglView* view, PuglRect frame); /** + Set the minimum size of the view. + + To avoid stutter, this should be called before creating the window. +*/ +PUGL_API PuglStatus +puglSetMinSize(PuglView* view, int width, int height); + +/** + Set the window aspect ratio range. + + The x and y values here represent a ratio of width to height. To set a + fixed aspect ratio, set the minimum and maximum values to the same ratio. + + Note that setting different minimum and maximum constraints does not + currenty work on MacOS (the minimum is used), so only setting a fixed aspect + ratio works properly across all platforms. +*/ +PUGL_API PuglStatus +puglSetAspectRatio(PuglView* view, int minX, int minY, int maxX, int maxY); + +/** @name Context Functions for accessing the drawing context. @{ @@ -815,6 +813,35 @@ puglInitWindowSize(PuglView* view, int width, int height) } /** + Set the minimum window size before creating a window. +*/ +static inline PUGL_DEPRECATED_BY("puglSetMinSize") void +puglInitWindowMinSize(PuglView* view, int width, int height) +{ + puglSetMinSize(view, width, height); +} + +/** + Set the window aspect ratio range before creating a window. + + The x and y values here represent a ratio of width to height. To set a + fixed aspect ratio, set the minimum and maximum values to the same ratio. + + Note that setting different minimum and maximum constraints does not + currenty work on MacOS (the minimum is used), so only setting a fixed aspect + ratio works properly across all platforms. +*/ +static inline PUGL_DEPRECATED_BY("puglSetAspectRatio") void +puglInitWindowAspectRatio(PuglView* view, + int minX, + int minY, + int maxX, + int maxY) +{ + puglSetAspectRatio(view, minX, minY, maxX, maxY); +} + +/** Enable or disable resizing before creating a window. @deprecated Use puglInitWindowHint() with @ref PUGL_RESIZABLE. |