"Initial commit to Gerrit"
[profile/ivi/cogl.git] / cogl / cogl-onscreen-template.h
1 /*
2  * Cogl
3  *
4  * An object oriented GL/GLES Abstraction/Utility Layer
5  *
6  * Copyright (C) 2011 Intel Corporation.
7  *
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.
12  *
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.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library. If not, see
20  * <http://www.gnu.org/licenses/>.
21  *
22  * Authors:
23  *  Robert Bragg <robert@linux.intel.com>
24  *
25  */
26
27 #if !defined(__COGL_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
28 #error "Only <cogl/cogl.h> can be included directly."
29 #endif
30
31 #ifndef __COGL_ONSCREEN_TEMPLATE_H__
32 #define __COGL_ONSCREEN_TEMPLATE_H__
33
34 #include <cogl/cogl-swap-chain.h>
35
36 G_BEGIN_DECLS
37
38 typedef struct _CoglOnscreenTemplate          CoglOnscreenTemplate;
39
40 #define COGL_ONSCREEN_TEMPLATE(OBJECT) ((CoglOnscreenTemplate *)OBJECT)
41
42 #define cogl_onscreen_template_new cogl_onscreen_template_new_EXP
43 CoglOnscreenTemplate *
44 cogl_onscreen_template_new (CoglSwapChain *swap_chain);
45
46 /**
47  * cogl_onscreen_template_set_samples_per_pixel:
48  * @onscreen: A #CoglOnscreenTemplate template framebuffer
49  * @n: The minimum number of samples per pixel
50  *
51  * Requires that any future CoglOnscreen framebuffers derived from
52  * this template must support making at least @n samples per pixel
53  * which will all contribute to the final resolved color for that
54  * pixel.
55  *
56  * By default this value is usually set to 0 and that is referred to
57  * as "single-sample" rendering. A value of 1 or greater is referred
58  * to as "multisample" rendering.
59  *
60  * <note>There are some semantic differences between single-sample
61  * rendering and multisampling with just 1 point sample such as it
62  * being redundant to use the cogl_framebuffer_resolve_samples() and
63  * cogl_framebuffer_resolve_samples_region() apis with single-sample
64  * rendering.</note>
65  *
66  * Since: 1.10
67  * Stability: unstable
68  */
69 void
70 cogl_onscreen_template_set_samples_per_pixel (
71                                           CoglOnscreenTemplate *onscreen_template,
72                                           int n);
73
74 /**
75  * cogl_onscreen_template_set_swap_throttled:
76  * @onscreen_template: A #CoglOnscreenTemplate template framebuffer
77  * @throttled: Whether throttling should be enabled
78  *
79  * Requests that any future #CoglOnscreen framebuffers derived from this
80  * template should enable or disable swap throttling according to the given
81  * @throttled argument.
82  *
83  * Since: 1.10
84  * Stability: unstable
85  */
86 void
87 cogl_onscreen_template_set_swap_throttled (
88                                           CoglOnscreenTemplate *onscreen_template,
89                                           gboolean throttled);
90
91 /**
92  * cogl_is_onscreen_template:
93  * @object: A #CoglObject pointer
94  *
95  * Gets whether the given object references a #CoglOnscreenTemplate.
96  *
97  * Return value: %TRUE if the object references a #CoglOnscreenTemplate
98  *   and %FALSE otherwise.
99  * Since: 1.10
100  * Stability: unstable
101  */
102 gboolean
103 cogl_is_onscreen_template (void *object);
104
105 G_END_DECLS
106
107 #endif /* __COGL_ONSCREEN_TEMPLATE_H__ */