summaryrefslogtreecommitdiff
path: root/cogl/winsys/cogl-winsys-wgl.c
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2012-01-16 11:26:45 +0000
committerRobert Bragg <robert@linux.intel.com>2012-01-16 18:27:20 +0000
commit3161f1b0e66ac91b5d82749dfa65133d90b11c42 (patch)
tree8085bc838a491af50215574d265f24864e5cddd9 /cogl/winsys/cogl-winsys-wgl.c
parent1e0378051015e1e9f9a4ce6ebcfc653602a847ab (diff)
downloadcogl-3161f1b0e66ac91b5d82749dfa65133d90b11c42.tar.gz
template: Allow configuration of swap throttle
This adds cogl_onscreen_template_set_swap_throttled() api that allows developers to specify their preference for swap buffer throttling up-front as part of the onscreen template that is used to create a CoglDisplay when initializing Cogl. This is desirable because some platforms may not support configuring swap throttling on a per framebuffer basis and also since applications often want to apply the same policy to all onscreen framebuffers anyway.
Diffstat (limited to 'cogl/winsys/cogl-winsys-wgl.c')
-rw-r--r--cogl/winsys/cogl-winsys-wgl.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/cogl/winsys/cogl-winsys-wgl.c b/cogl/winsys/cogl-winsys-wgl.c
index fbe35908..66f9ed13 100644
--- a/cogl/winsys/cogl-winsys-wgl.c
+++ b/cogl/winsys/cogl-winsys-wgl.c
@@ -89,7 +89,6 @@ typedef struct _CoglOnscreenWgl
HDC client_dc;
- gboolean swap_throttled;
} CoglOnscreenWgl;
/* Define a set of arrays containing the functions required from GL
@@ -651,6 +650,7 @@ _cogl_winsys_context_deinit (CoglContext *context)
static void
_cogl_winsys_onscreen_bind (CoglOnscreen *onscreen)
{
+ CoglFramebuffer *fb;
CoglContext *context;
CoglContextWgl *wgl_context;
CoglDisplayWgl *wgl_display;
@@ -663,7 +663,8 @@ _cogl_winsys_onscreen_bind (CoglOnscreen *onscreen)
context */
_COGL_RETURN_IF_FAIL (onscreen != NULL);
- context = COGL_FRAMEBUFFER (onscreen)->context;
+ fb = COGL_FRAMEBUFFER (onscreen);
+ context = fb->context;
wgl_context = context->winsys;
wgl_display = context->display->winsys;
wgl_onscreen = onscreen->winsys;
@@ -680,7 +681,7 @@ _cogl_winsys_onscreen_bind (CoglOnscreen *onscreen)
*/
if (wgl_renderer->pf_wglSwapInterval)
{
- if (onscreen->swap_throttled)
+ if (fb->config.swap_throttled)
wgl_renderer->pf_wglSwapInterval (1);
else
wgl_renderer->pf_wglSwapInterval (0);