summaryrefslogtreecommitdiff
path: root/examples/cogl-hello.c
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2012-06-20 16:22:36 +0100
committerRobert Bragg <robert@linux.intel.com>2012-07-09 22:35:40 +0100
commita1a8cc00bfa2cecaf1007aec5f3dd95dc07b1786 (patch)
tree2f89493c80da9923c6fcc23abbc3ce77c5497730 /examples/cogl-hello.c
parent9ed541b4e35208df87ffaa5fbbb39e11e8c247ef (diff)
downloadcogl-a1a8cc00bfa2cecaf1007aec5f3dd95dc07b1786.tar.gz
onscreen: Adds support for resizable windows
This adds api to be able to request that the window system allows a given onscreen framebuffer to be resizable, and api to add and remove resize handlers to be called whenever the framebuffer does actually change size. The new functions are: cogl_onscreen_{get,set}_resizable() cogl_onscreen_{add,remove}_resize_handler() The examples cogl-hello and cogl-x11-foreign have been updated to use the new api. To smoke test how Cogl updates the viewport automatically in response to window resizes the cogl-hello test doesn't explicitly respond to resize events by setting the viewport and cogl-x11-foreign responds by setting a viewport that is offset by a quarter of the window's width/height and half the width and height of the window. Reviewed-by: Neil Roberts <neil@linux.intel.com>
Diffstat (limited to 'examples/cogl-hello.c')
-rw-r--r--examples/cogl-hello.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/examples/cogl-hello.c b/examples/cogl-hello.c
index a0b002d1..cf0e8f6d 100644
--- a/examples/cogl-hello.c
+++ b/examples/cogl-hello.c
@@ -59,6 +59,8 @@ main (int argc, char **argv)
cogl_onscreen_show (onscreen);
data.fb = COGL_FRAMEBUFFER (onscreen);
+ cogl_onscreen_set_resizable (onscreen, TRUE);
+
data.triangle = cogl_primitive_new_p2c4 (data.ctx,
COGL_VERTICES_MODE_TRIANGLES,
3, triangle_vertices);