diff options
author | Chad Versace <chad.versace@linux.intel.com> | 2012-06-03 16:48:03 -0700 |
---|---|---|
committer | Chad Versace <chad.versace@linux.intel.com> | 2012-06-05 13:45:13 -0700 |
commit | deba8e55cc12cecf67f1d60421dcbed775a3b7a1 (patch) | |
tree | f0255e7183843bd6b188c47f8dddd6820e89ef05 /include | |
parent | d1f79630ebc1acc72312a1e36ba46ef3079b362f (diff) |
include: Declare functions waffle_$x_get_native()
The following functions are declared:
waffle_config_get_native()
waffle_context_get_native()
waffle_display_get_native()
waffle_window_get_native()
These functions allow users to get the underlying native objects.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/waffle/waffle_config.h | 20 | ||||
-rw-r--r-- | include/waffle/waffle_context.h | 20 | ||||
-rw-r--r-- | include/waffle/waffle_display.h | 20 | ||||
-rw-r--r-- | include/waffle/waffle_window.h | 20 |
4 files changed, 80 insertions, 0 deletions
diff --git a/include/waffle/waffle_config.h b/include/waffle/waffle_config.h index 143e9c9..279522f 100644 --- a/include/waffle/waffle_config.h +++ b/include/waffle/waffle_config.h @@ -43,6 +43,20 @@ extern "C" { struct waffle_config; struct waffle_display; +struct waffle_android_config; +struct waffle_cgl_config; +struct waffle_glx_config; +struct waffle_x11_egl_config; +struct waffle_wayland_config; + +union waffle_native_config { + struct waffle_android_config *android; + struct waffle_cgl_config *cgl; + struct waffle_glx_config *glx; + struct waffle_x11_egl_config *x11_egl; + struct waffle_wayland_config *wayland; +}; + /// @brief Choose a config satisfying some attributes. /// /// @@ -209,6 +223,12 @@ waffle_config_choose(struct waffle_display *dpy, const int32_t attrib_list[]); WAFFLE_API bool waffle_config_destroy(struct waffle_config *self); +/// @brief Get underlying native objects. +/// +/// Use free() to deallocate the returned pointer. +WAFFLE_API union waffle_native_config* +waffle_config_get_native(struct waffle_config *self); + #ifdef __cplusplus } // end extern "C" #endif diff --git a/include/waffle/waffle_context.h b/include/waffle/waffle_context.h index ca14fd3..2759f4f 100644 --- a/include/waffle/waffle_context.h +++ b/include/waffle/waffle_context.h @@ -42,6 +42,20 @@ extern "C" { struct waffle_config; struct waffle_context; +struct waffle_android_context; +struct waffle_cgl_context; +struct waffle_glx_context; +struct waffle_x11_egl_context; +struct waffle_wayland_context; + +union waffle_native_context { + struct waffle_android_context *android; + struct waffle_cgl_context *cgl; + struct waffle_glx_context *glx; + struct waffle_x11_egl_context *x11_egl; + struct waffle_wayland_context *wayland; +}; + WAFFLE_API struct waffle_context* waffle_context_create( struct waffle_config *config, @@ -50,6 +64,12 @@ waffle_context_create( WAFFLE_API bool waffle_context_destroy(struct waffle_context *self); +/// @brief Get underlying native objects. +/// +/// Use free() to deallocate the returned pointer. +WAFFLE_API union waffle_native_context* +waffle_context_get_native(struct waffle_context *self); + #ifdef __cplusplus } // end extern "C" #endif diff --git a/include/waffle/waffle_display.h b/include/waffle/waffle_display.h index a8ec9cd..9127a96 100644 --- a/include/waffle/waffle_display.h +++ b/include/waffle/waffle_display.h @@ -42,6 +42,20 @@ extern "C" { struct waffle_display; +struct waffle_android_display; +struct waffle_cgl_display; +struct waffle_glx_display; +struct waffle_x11_egl_display; +struct waffle_wayland_display; + +union waffle_native_display { + struct waffle_android_display *android; + struct waffle_cgl_display *cgl; + struct waffle_glx_display *glx; + struct waffle_x11_egl_display *x11_egl; + struct waffle_wayland_display *wayland; +}; + WAFFLE_API struct waffle_display* waffle_display_connect(const char *name); @@ -60,6 +74,12 @@ waffle_display_supports_context_api( struct waffle_display *self, int32_t context_api); +/// @brief Get underlying native objects. +/// +/// Use free() to deallocate the returned pointer. +WAFFLE_API union waffle_native_display* +waffle_display_get_native(struct waffle_display *self); + #ifdef __cplusplus } // end extern "C" #endif diff --git a/include/waffle/waffle_window.h b/include/waffle/waffle_window.h index e221bb9..8c00f0f 100644 --- a/include/waffle/waffle_window.h +++ b/include/waffle/waffle_window.h @@ -41,6 +41,20 @@ extern "C" { struct waffle_config; struct waffle_window; +struct waffle_android_window; +struct waffle_cgl_window; +struct waffle_glx_window; +struct waffle_x11_egl_window; +struct waffle_wayland_window; + +union waffle_native_window { + struct waffle_android_window *android; + struct waffle_cgl_window *cgl; + struct waffle_glx_window *glx; + struct waffle_x11_egl_window *x11_egl; + struct waffle_wayland_window *wayland; +}; + /// If the platform allows, the window is not displayed onto the screen /// after creation. To display the window, call waffle_window_show(). WAFFLE_API struct waffle_window* @@ -61,6 +75,12 @@ waffle_window_show(struct waffle_window *self); WAFFLE_API bool waffle_window_swap_buffers(struct waffle_window *self); +/// @brief Get underlying native objects. +/// +/// Use free() to deallocate the returned pointer. +WAFFLE_API union waffle_native_window* +waffle_window_get_native(struct waffle_window *self); + #ifdef __cplusplus } // end extern "C" #endif |