"Initial commit to Gerrit"
[profile/ivi/cogl.git] / cogl / winsys / cogl-winsys-glx-feature-functions.h
1 /*
2  * Cogl
3  *
4  * An object oriented GL/GLES Abstraction/Utility Layer
5  *
6  * Copyright (C) 2010 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  *
23  */
24
25 /* This can be included multiple times with different definitions for
26  * the COGL_WINSYS_FEATURE_* functions.
27  */
28
29 /* Macro prototypes:
30  * COGL_WINSYS_FEATURE_BEGIN (name, namespaces, extension_names,
31  *                            implied_public_feature_flags,
32  *                            implied_private_feature_flags,
33  *                            implied_winsys_feature)
34  * COGL_WINSYS_FEATURE_FUNCTION (return_type, function_name,
35  *                               (arguments))
36  * ...
37  * COGL_WINSYS_FEATURE_END ()
38  *
39  * Note: You can list multiple namespace and extension names if the
40  * corresponding _FEATURE_FUNCTIONS have the same semantics accross
41  * the different extension variants.
42  *
43  * XXX: NB: Don't add a trailing semicolon when using these macros
44  */
45
46 COGL_WINSYS_FEATURE_BEGIN (texture_from_pixmap,
47                            "EXT\0",
48                            "texture_from_pixmap\0",
49                            0,
50                            0,
51                            COGL_WINSYS_FEATURE_TEXTURE_FROM_PIXMAP)
52 COGL_WINSYS_FEATURE_FUNCTION (void, glXBindTexImage,
53                               (Display *display,
54                                GLXDrawable drawable,
55                                int buffer,
56                                int *attribList))
57 COGL_WINSYS_FEATURE_FUNCTION (void, glXReleaseTexImage,
58                               (Display *display,
59                                GLXDrawable drawable,
60                                int buffer))
61 COGL_WINSYS_FEATURE_END ()
62
63 COGL_WINSYS_FEATURE_BEGIN (video_sync,
64                            "SGI\0",
65                            "video_sync\0",
66                            0,
67                            0,
68                            COGL_WINSYS_FEATURE_VBLANK_COUNTER)
69 COGL_WINSYS_FEATURE_FUNCTION (int, glXGetVideoSync,
70                               (unsigned int *count))
71 COGL_WINSYS_FEATURE_FUNCTION (int, glXWaitVideoSync,
72                               (int divisor,
73                                int remainder,
74                                unsigned int *count))
75 COGL_WINSYS_FEATURE_END ()
76
77 COGL_WINSYS_FEATURE_BEGIN (swap_control,
78                            "SGI\0",
79                            "swap_control\0",
80                            0,
81                            0,
82                            COGL_WINSYS_FEATURE_SWAP_THROTTLE)
83 COGL_WINSYS_FEATURE_FUNCTION (int, glXSwapInterval,
84                               (int interval))
85 COGL_WINSYS_FEATURE_END ()
86
87 COGL_WINSYS_FEATURE_BEGIN (copy_sub_buffer,
88                            "MESA\0",
89                            "copy_sub_buffer\0",
90                            0,
91                            0,
92 /* We initially assumed that copy_sub_buffer is synchronized on
93  * which is only the case for a subset of GPUs for example it is not
94  * synchronized on INTEL gen6 and gen7, so we remove this assumption
95  * for now
96  */
97 #if 0
98                            COGL_WINSYS_FEATURE_SWAP_REGION_SYNCHRONIZED)
99 #endif
100                            0)
101 COGL_WINSYS_FEATURE_FUNCTION (void, glXCopySubBuffer,
102                               (Display *dpy,
103                                GLXDrawable drawable,
104                                int x, int y, int width, int height))
105 COGL_WINSYS_FEATURE_END ()
106
107 COGL_WINSYS_FEATURE_BEGIN (swap_event,
108                            "INTEL\0",
109                            "swap_event\0",
110                            0,
111                            0,
112                            COGL_WINSYS_FEATURE_SWAP_BUFFERS_EVENT)
113 COGL_WINSYS_FEATURE_END ()