4 * An OpenGL based 'interactive canvas' library.
6 * Authored By Johan Bilien <johan.bilien@nokia.com>
7 * Matthew Allum <mallum@o-hand.com>
8 * Robert Bragg <bob@o-hand.com>
9 * Neil Roberts <neil@linux.intel.com>
11 * Copyright (C) 2007 OpenedHand
12 * Copyright (C) 2010 Intel Corporation.
14 * This library is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Lesser General Public
16 * License as published by the Free Software Foundation; either
17 * version 2 of the License, or (at your option) any later version.
19 * This library is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Lesser General Public License for more details.
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
31 * SECTION:clutter-glx-texture-pixmap
32 * @Title: ClutterGLXTexturePixmap
33 * @short_description: A texture which displays the content of an X Pixmap
34 * @Deprecated: 1.4: Use #ClutterX11TexturePixmap instead.
36 * #ClutterGLXTexturePixmap is a class for displaying the content of an
37 * X Pixmap as a ClutterActor. Used together with the X Composite extension,
38 * it allows to display the content of X Windows inside Clutter.
40 * This class used to be necessary to use the
41 * GLX_EXT_texture_from_pixmap extension to get fast texture
42 * updates. However since Clutter 1.4 the handling of this extension
43 * has moved down to Cogl. ClutterX11TexturePixmap and
44 * ClutterGLXTexturePixmap are now equivalent and either one of them
45 * may use the extension if it is possible.
52 #include "x11/clutter-x11-texture-pixmap.h"
54 #include <cogl/cogl-texture-pixmap-x11.h>
56 #include "clutter-glx-texture-pixmap.h"
58 G_DEFINE_TYPE (ClutterGLXTexturePixmap, \
59 clutter_glx_texture_pixmap, \
60 CLUTTER_X11_TYPE_TEXTURE_PIXMAP);
63 clutter_glx_texture_pixmap_init (ClutterGLXTexturePixmap *self)
68 clutter_glx_texture_pixmap_class_init (ClutterGLXTexturePixmapClass *klass)
73 * clutter_glx_texture_pixmap_using_extension:
74 * @texture: A #ClutterGLXTexturePixmap
76 * Checks whether @texture is using the GLX_EXT_texture_from_pixmap
77 * extension; this extension can be optionally (though it is strongly
78 * encouraged) implemented as a zero-copy between a GLX pixmap and
81 * Return value: %TRUE if the texture is using the
82 * GLX_EXT_texture_from_pixmap OpenGL extension or falling back to the
83 * slower software mechanism.
85 * Deprecated: 1.6: Use cogl_texture_pixmap_x11_is_using_tfp_extension()
86 * on the texture handle instead.
91 clutter_glx_texture_pixmap_using_extension (ClutterGLXTexturePixmap *texture)
93 CoglHandle cogl_texture;
95 g_return_val_if_fail (CLUTTER_GLX_IS_TEXTURE_PIXMAP (texture), FALSE);
97 cogl_texture = clutter_texture_get_cogl_texture (CLUTTER_TEXTURE (texture));
99 return (cogl_is_texture_pixmap_x11 (cogl_texture) &&
100 cogl_texture_pixmap_x11_is_using_tfp_extension (cogl_texture));
104 * clutter_glx_texture_pixmap_new_with_pixmap:
105 * @pixmap: the X Pixmap to which this texture should be bound
107 * Creates a new #ClutterGLXTexturePixmap for @pixmap
109 * Return value: A new #ClutterGLXTexturePixmap bound to the given X Pixmap
113 * Deprecated: 1.6: Use clutter_x11_texture_pixmap_new_with_pixmap() instead
116 clutter_glx_texture_pixmap_new_with_pixmap (Pixmap pixmap)
118 return g_object_new (CLUTTER_GLX_TYPE_TEXTURE_PIXMAP,
124 * clutter_glx_texture_pixmap_new_with_window:
125 * @window: the X window to which this texture should be bound
127 * Creates a new #ClutterGLXTexturePixmap for @window
129 * Return value: A new #ClutterGLXTexturePixmap bound to the given X window
133 * Deprecated: 1.6: Use clutter_x11_texture_pixmap_new_with_window() instead
136 clutter_glx_texture_pixmap_new_with_window (Window window)
138 return g_object_new (CLUTTER_GLX_TYPE_TEXTURE_PIXMAP,
144 * clutter_glx_texture_pixmap_new:
146 * Creates a new, empty #ClutterGLXTexturePixmap
148 * Return value: A new #ClutterGLXTexturePixmap
152 * Deprecated: 1.6: Use clutter_x11_texture_pixmap_new() instead
155 clutter_glx_texture_pixmap_new (void)
157 return g_object_new (CLUTTER_GLX_TYPE_TEXTURE_PIXMAP, NULL);