This looks good to land to me:<div><br></div><div>Reviewed-by: Robert Bragg <<a href="mailto:robert@linux.intel.com">robert@linux.intel.com</a>></div><div><br></div><div>thanks,</div><div>- Robert</div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Mon, Nov 26, 2012 at 3:15 PM, Neil Roberts <span dir="ltr"><<a href="mailto:neil@linux.intel.com" target="_blank">neil@linux.intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This adds a function to get a pointer to the SDL_Window associated<br>
with a CoglOnscreen when using the SDL2 winsys.<br>
---<br>
 cogl/cogl-sdl.h                        | 17 +++++++++++++++++<br>
 cogl/winsys/cogl-winsys-sdl2.c         | 16 ++++++++++++++++<br>
 doc/reference/cogl2/cogl2-sections.txt |  1 +<br>
 3 files changed, 34 insertions(+)<br>
<br>
diff --git a/cogl/cogl-sdl.h b/cogl/cogl-sdl.h<br>
index 05da036..0508649 100644<br>
--- a/cogl/cogl-sdl.h<br>
+++ b/cogl/cogl-sdl.h<br>
@@ -29,6 +29,7 @@<br>
 #define __COGL_SDL_H__<br>
<br>
 #include <cogl/cogl-context.h><br>
+#include <cogl/cogl-onscreen.h><br>
 #include <SDL.h><br>
<br>
 #ifdef _MSC_VER<br>
@@ -202,6 +203,22 @@ cogl_sdl_handle_event (CoglContext *context, SDL_Event *event);<br>
 void<br>
 cogl_sdl_idle (CoglContext *context);<br>
<br>
+#if SDL_MAJOR_VERSION >= 2<br>
+<br>
+/**<br>
+ * cogl_sdl_onscreen_get_window:<br>
+ * @onscreen: A #CoglOnscreen<br>
+ *<br>
+ * Returns the underlying SDL_Window associated with an onscreen framebuffer.<br>
+ *<br>
+ * Since: 2.0<br>
+ * Stability: unstable<br>
+ */<br>
+SDL_Window *<br>
+cogl_sdl_onscreen_get_window (CoglOnscreen *onscreen);<br>
+<br>
+#endif /* SDL_MAJOR_VERSION */<br>
+<br>
 G_END_DECLS<br>
<br>
 #endif /* __COGL_SDL_H__ */<br>
diff --git a/cogl/winsys/cogl-winsys-sdl2.c b/cogl/winsys/cogl-winsys-sdl2.c<br>
index 1c0fc31..8c0c256 100644<br>
--- a/cogl/winsys/cogl-winsys-sdl2.c<br>
+++ b/cogl/winsys/cogl-winsys-sdl2.c<br>
@@ -38,6 +38,7 @@<br>
 #include "cogl-onscreen-private.h"<br>
 #include "cogl-winsys-sdl-private.h"<br>
 #include "cogl-error-private.h"<br>
+#include "cogl-sdl.h"<br>
<br>
 typedef struct _CoglContextSdl2<br>
 {<br>
@@ -510,6 +511,21 @@ _cogl_winsys_poll_dispatch (CoglContext *context,<br>
     }<br>
 }<br>
<br>
+SDL_Window *<br>
+cogl_sdl_onscreen_get_window (CoglOnscreen *onscreen)<br>
+{<br>
+  CoglOnscreenSdl2 *sdl_onscreen;<br>
+<br>
+  _COGL_RETURN_VAL_IF_FAIL (cogl_is_onscreen (onscreen), NULL);<br>
+<br>
+  if (!cogl_framebuffer_allocate (COGL_FRAMEBUFFER (onscreen), NULL))<br>
+    return NULL;<br>
+<br>
+  sdl_onscreen = onscreen->winsys;<br>
+<br>
+  return sdl_onscreen->window;<br>
+}<br>
+<br>
 const CoglWinsysVtable *<br>
 _cogl_winsys_sdl_get_vtable (void)<br>
 {<br>
diff --git a/doc/reference/cogl2/cogl2-sections.txt b/doc/reference/cogl2/cogl2-sections.txt<br>
index 004c0c0..5d58d10 100644<br>
--- a/doc/reference/cogl2/cogl2-sections.txt<br>
+++ b/doc/reference/cogl2/cogl2-sections.txt<br>
@@ -758,4 +758,5 @@ cogl_sdl_renderer_set_event_type<br>
 cogl_sdl_renderer_get_event_type<br>
 cogl_sdl_handle_event<br>
 cogl_sdl_idle<br>
+cogl_sdl_onscreen_get_window<br>
 </SECTION><br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.11.3.g3c3efa5<br>
<br>
_______________________________________________<br>
Cogl mailing list<br>
<a href="mailto:Cogl@lists.freedesktop.org">Cogl@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/cogl" target="_blank">http://lists.freedesktop.org/mailman/listinfo/cogl</a><br>
</font></span></blockquote></div><br></div>