diff options
author | David Robillard <d@drobilla.net> | 2015-09-13 16:24:45 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2015-09-13 16:24:45 -0400 |
commit | add00976a0c39f78f57df79c2a194c4f4e7adbf7 (patch) | |
tree | 0ac8e24a7d09faa2b6d177d147d471555cc09af6 /pugl/pugl.h | |
parent | 7c1f22fdf4782aa04a14a914b5a51b3617362366 (diff) | |
parent | d457ac139797b05fdc214f8af458833b58033224 (diff) |
Merge branch 'master' of git.drobilla.net:/home/drobilla/git.drobilla.net/pugl
Diffstat (limited to 'pugl/pugl.h')
-rw-r--r-- | pugl/pugl.h | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/pugl/pugl.h b/pugl/pugl.h index 53115ff..074297c 100644 --- a/pugl/pugl.h +++ b/pugl/pugl.h @@ -1,5 +1,5 @@ /* - Copyright 2012-2014 David Robillard <http://drobilla.net> + Copyright 2012-2015 David Robillard <http://drobilla.net> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above @@ -171,6 +171,19 @@ 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. +*/ +PUGL_API void +puglInitWindowAspectRatio(PuglView* view, + int min_x, + int min_y, + int max_x, + int max_y); + +/** Enable or disable resizing before creating a window. */ PUGL_API void @@ -349,10 +362,22 @@ PUGL_API void puglGrabFocus(PuglView* view); /** + Block and wait for an event to be ready. + + This can be used in a loop to only process events via puglProcessEvents when + necessary. This function will block indefinitely if no events are + available, so is not appropriate for use in programs that need to perform + regular updates (e.g. animation). +*/ +PUGL_API PuglStatus +puglWaitForEvent(PuglView* view); + +/** Process all pending window events. This handles input events as well as rendering, so it should be called - regularly and rapidly enough to keep the UI responsive. + regularly and rapidly enough to keep the UI responsive. This function does + not block if no events are pending. */ PUGL_API PuglStatus puglProcessEvents(PuglView* view); |