4 * An object oriented GL/GLES Abstraction/Utility Layer
6 * Copyright (C) 2007,2008,2009,2012 Intel Corporation.
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
24 #if !defined(__COGL_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
25 #error "Only <cogl/cogl.h> can be included directly."
28 #ifndef __COGL_OFFSCREEN_H__
29 #define __COGL_OFFSCREEN_H__
31 #include <cogl/cogl-types.h>
32 #include <cogl/cogl-texture.h>
37 * SECTION:cogl-offscreen
38 * @short_description: Fuctions for creating and manipulating offscreen
41 * Cogl allows creating and operating on offscreen framebuffers.
44 typedef struct _CoglOffscreen CoglOffscreen;
46 #define COGL_OFFSCREEN(X) ((CoglOffscreen *)X)
51 * cogl_offscreen_new_to_texture:
52 * @texture: A #CoglTexture pointer
54 * This creates an offscreen buffer object using the given @texture as the
55 * primary color buffer. It doesn't just initialize the contents of the
56 * offscreen buffer with the @texture; they are tightly bound so that
57 * drawing to the offscreen buffer effectivly updates the contents of the
58 * given texture. You don't need to destroy the offscreen buffer before
59 * you can use the @texture again.
61 * <note>This only works with low-level #CoglTexture types such as
62 * #CoglTexture2D, #CoglTexture3D and #CoglTextureRectangle, and not
63 * with meta-texture types such as #CoglTexture2DSliced.</note>
65 * Return value: (transfer full): a newly instantiated #CoglOffscreen
66 * framebuffer or %NULL if it wasn't possible to create the
70 cogl_offscreen_new_to_texture (CoglTexture *texture);
74 * @object: A pointer to a #CoglObject
76 * Determines whether the given #CoglObject references an offscreen
79 * Returns: %TRUE if @object is a #CoglOffscreen framebuffer,
83 cogl_is_offscreen (void *object);
85 #ifndef COGL_DISABLE_DEPRECATED
89 * @offscreen: A pointer to a #CoglOffscreen framebuffer
91 * Increments the reference count on the @offscreen framebuffer.
93 * Return value: (transfer none): For convenience it returns the
96 * Deprecated: 1.2: cogl_object_ref() should be used in new code.
99 cogl_offscreen_ref (void *offscreen) G_GNUC_DEPRECATED;
102 * cogl_offscreen_unref:
103 * @offscreen: A pointer to a #CoglOffscreen framebuffer
105 * Decreases the reference count for the @offscreen buffer and frees it when
106 * the count reaches 0.
108 * Deprecated: 1.2: cogl_object_unref() should be used in new code.
111 cogl_offscreen_unref (void *offscreen) G_GNUC_DEPRECATED;
113 #endif /* COGL_DISABLE_DEPRECATED */
117 #endif /* __COGL_OFFSCREEN_H__ */