summaryrefslogtreecommitdiff
path: root/src/lib/evas/Evas_GL.h
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-10-02 15:15:40 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-10-02 16:56:38 +0900
commit90b96b07d9d39bb98f7d362fbfdd386deceefa84 (patch)
tree3367942dc917999b55a7c7e493bcc40f2e0e7795 /src/lib/evas/Evas_GL.h
parent2317bb83fc830e302d23047dc7ab06e61333a4dc (diff)
Evas GL: Add new API to get current Evas GL
While this seems to go against the rest of the API (because we always pass in the Evas GL object), there is no way right now fully restore a context if there are multiple Evas GL objects. For instance, an app can use Evas GL from an Elm GLView, and also use Cairo with another Evas GL at the same time. In that case Cairo needs to restore the previous Evas GL but the library had no way of getting the current Evas GL. This is the equivalent of eglGetCurrentDisplay(). @feature
Diffstat (limited to 'src/lib/evas/Evas_GL.h')
-rw-r--r--src/lib/evas/Evas_GL.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/lib/evas/Evas_GL.h b/src/lib/evas/Evas_GL.h
index a032eaf70f..0a4aa70663 100644
--- a/src/lib/evas/Evas_GL.h
+++ b/src/lib/evas/Evas_GL.h
@@ -847,7 +847,7 @@ EAPI Evas_GL_Context *evas_gl_current_context_get (Evas_GL *evas_gl) EIN
847/** 847/**
848 * @brief Returns the Evas GL surface object in use or set by @ref evas_gl_make_current 848 * @brief Returns the Evas GL surface object in use or set by @ref evas_gl_make_current
849 * 849 *
850 * @param evas_gl The given Evas_GL object 850 * @param[in] evas_gl The given Evas_GL object
851 * 851 *
852 * @return The current surface for the calling thread, or @c NULL in case of 852 * @return The current surface for the calling thread, or @c NULL in case of
853 * failure and when there is no current surface in this thread. 853 * failure and when there is no current surface in this thread.
@@ -862,6 +862,23 @@ EAPI Evas_GL_Context *evas_gl_current_context_get (Evas_GL *evas_gl) EIN
862 */ 862 */
863EAPI Evas_GL_Surface *evas_gl_current_surface_get (Evas_GL *evas_gl) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1); 863EAPI Evas_GL_Surface *evas_gl_current_surface_get (Evas_GL *evas_gl) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
864 864
865/**
866 * @brief Get current Evas GL
867 *
868 * @param[out] context Optional return value for the current context
869 * @param[out] surface Optional return value for the current surface
870 *
871 * @return The current Evas GL, ie. the last Evas GL passed to evas_gl_make_current
872 *
873 * @see evas_gl_make_current
874 *
875 * @note This can be used to restore a previous context, for instance if you
876 * are writing a library that needs to work transparently with Evas GL,
877 * and may not have control over the other Evas GL objects.
878 *
879 * @since 1.16
880 */
881EAPI Evas_GL *evas_gl_current_evas_gl_get (Evas_GL_Context **context, Evas_GL_Surface **surface) EINA_WARN_UNUSED_RESULT;
865 882
866 883
867/*------------------------------------------------------------------------- 884/*-------------------------------------------------------------------------