summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Bradford <rob@linux.intel.com>2011-11-07 17:00:20 +0000
committerRobert Bragg <robert@linux.intel.com>2011-11-14 18:59:52 +0000
commit3bf8d45529b22769890c042736849767369e3fc5 (patch)
treefa4fc76e86a0609d6f9378a56c18a40921e109e6
parent39ca3e51dfaa652ae4a0d936fff32a5edaca6c5f (diff)
downloadcogl-3bf8d45529b22769890c042736849767369e3fc5.tar.gz
examples: Query the size of the framebuffer
The size of the framebuffer may not be the size of the framebuffer that we requested - we should use the actual size of the framebuffer in the calculations to position the crate in the center. Reviewed-by: Robert Bragg <robert@linux.intel.com>
-rw-r--r--examples/cogl-crate.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/cogl-crate.c b/examples/cogl-crate.c
index da333285..fa9d86f2 100644
--- a/examples/cogl-crate.c
+++ b/examples/cogl-crate.c
@@ -164,6 +164,9 @@ main (int argc, char **argv)
return 1;
}
+ data.framebuffer_width = cogl_framebuffer_get_width (fb);
+ data.framebuffer_height = cogl_framebuffer_get_height (fb);
+
data.timer = g_timer_new ();
cogl_onscreen_show (onscreen);