1 /* 2 * Cogl 3 * 4 * A Low Level GPU Graphics and Utilities API 5 * 6 * Copyright (C) 2011 Intel Corporation. 7 * 8 * Permission is hereby granted, free of charge, to any person 9 * obtaining a copy of this software and associated documentation 10 * files (the "Software"), to deal in the Software without 11 * restriction, including without limitation the rights to use, copy, 12 * modify, merge, publish, distribute, sublicense, and/or sell copies 13 * of the Software, and to permit persons to whom the Software is 14 * furnished to do so, subject to the following conditions: 15 * 16 * The above copyright notice and this permission notice shall be 17 * included in all copies or substantial portions of the Software. 18 * 19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 * SOFTWARE. 27 * 28 * Authors: 29 * Robert Bragg <robert@linux.intel.com> 30 * 31 */ 32 33 #if !defined(__COGL_H_INSIDE__) && !defined(COGL_COMPILATION) 34 #error "Only <cogl/cogl.h> can be included directly." 35 #endif 36 37 #ifndef __COGL_ONSCREEN_TEMPLATE_H__ 38 #define __COGL_ONSCREEN_TEMPLATE_H__ 39 40 #include <cogl/cogl-swap-chain.h> 41 42 #ifdef COGL_HAS_GTYPE_SUPPORT 43 #include <glib-object.h> 44 #endif 45 46 COGL_BEGIN_DECLS 47 48 typedef struct _CoglOnscreenTemplate CoglOnscreenTemplate; 49 50 #define COGL_ONSCREEN_TEMPLATE(OBJECT) ((CoglOnscreenTemplate *)OBJECT) 51 52 #ifdef COGL_HAS_GTYPE_SUPPORT 53 /** 54 * cogl_onscreen_template_get_gtype: 55 * 56 * Returns: a #GType that can be used with the GLib type system. 57 */ 58 GType cogl_onscreen_template_get_gtype (void); 59 #endif 60 61 CoglOnscreenTemplate * 62 cogl_onscreen_template_new (CoglSwapChain *swap_chain); 63 64 /** 65 * cogl_onscreen_template_set_samples_per_pixel: 66 * @onscreen_template: A #CoglOnscreenTemplate template framebuffer 67 * @n: The minimum number of samples per pixel 68 * 69 * Requires that any future CoglOnscreen framebuffers derived from 70 * this template must support making at least @n samples per pixel 71 * which will all contribute to the final resolved color for that 72 * pixel. 73 * 74 * By default this value is usually set to 0 and that is referred to 75 * as "single-sample" rendering. A value of 1 or greater is referred 76 * to as "multisample" rendering. 77 * 78 * <note>There are some semantic differences between single-sample 79 * rendering and multisampling with just 1 point sample such as it 80 * being redundant to use the cogl_framebuffer_resolve_samples() and 81 * cogl_framebuffer_resolve_samples_region() apis with single-sample 82 * rendering.</note> 83 * 84 * Since: 1.10 85 * Stability: unstable 86 */ 87 void 88 cogl_onscreen_template_set_samples_per_pixel ( 89 CoglOnscreenTemplate *onscreen_template, 90 int n); 91 92 /** 93 * cogl_onscreen_template_set_swap_throttled: 94 * @onscreen_template: A #CoglOnscreenTemplate template framebuffer 95 * @throttled: Whether throttling should be enabled 96 * 97 * Requests that any future #CoglOnscreen framebuffers derived from this 98 * template should enable or disable swap throttling according to the given 99 * @throttled argument. 100 * 101 * Since: 1.10 102 * Stability: unstable 103 */ 104 void 105 cogl_onscreen_template_set_swap_throttled ( 106 CoglOnscreenTemplate *onscreen_template, 107 CoglBool throttled); 108 109 /** 110 * cogl_onscreen_template_set_stereo_enabled: 111 * @onscreen_template: A #CoglOnscreenTemplate template framebuffer 112 * @enabled: Whether framebuffers are created with stereo buffers 113 * 114 * Sets whether future #CoglOnscreen framebuffers derived from this 115 * template are attempted to be created with both left and right 116 * buffers, for use with stereo display. If the display system 117 * does not support stereo, then creation of the framebuffer will 118 * fail. 119 * 120 * Since: 1.20 121 * Stability: unstable 122 */ 123 void 124 cogl_onscreen_template_set_stereo_enabled ( 125 CoglOnscreenTemplate *onscreen_template, 126 CoglBool enabled); 127 /** 128 * cogl_is_onscreen_template: 129 * @object: A #CoglObject pointer 130 * 131 * Gets whether the given object references a #CoglOnscreenTemplate. 132 * 133 * Return value: %TRUE if the object references a #CoglOnscreenTemplate 134 * and %FALSE otherwise. 135 * Since: 1.10 136 * Stability: unstable 137 */ 138 CoglBool 139 cogl_is_onscreen_template (void *object); 140 141 COGL_END_DECLS 142 143 #endif /* __COGL_ONSCREEN_TEMPLATE_H__ */ 144