4
* A Low Level GPU Graphics and Utilities API
6
* Copyright (C) 2011 Intel Corporation.
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:
16
* The above copyright notice and this permission notice shall be
17
* included in all copies or substantial portions of the Software.
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
31
#ifndef __COGL_RENDERER_GLX_PRIVATE_H
32
#define __COGL_RENDERER_GLX_PRIVATE_H
35
#include "cogl-object-private.h"
36
#include "cogl-xlib-renderer-private.h"
38
typedef struct _CoglGLXRenderer
49
/* enumeration with relatioship between OML_sync_control
50
* UST (unadjusted-system-time) and the system clock */
52
COGL_GLX_UST_IS_UNKNOWN,
53
COGL_GLX_UST_IS_GETTIMEOFDAY,
54
COGL_GLX_UST_IS_MONOTONIC_TIME,
58
/* GModule pointing to libGL which we use to get glX functions out of */
59
GModule *libgl_module;
61
CoglClosure *flush_notifications_idle;
63
/* Copy of the winsys features that are based purely on the
64
* information we can get without using a GL context. We want to
65
* determine this before we have a context so that we can use the
66
* function pointers from the extensions earlier. This is necessary
67
* to use the glXCreateContextAttribs function. */
68
unsigned long base_winsys_features
69
[COGL_FLAGS_N_LONGS_FOR_SIZE (COGL_WINSYS_FEATURE_N_FEATURES)];
71
CoglFeatureFlags legacy_feature_flags;
73
/* Function pointers for core GLX functionality. We can't just link
74
against these directly because we need to conditionally load
75
libGL when we are using GLX so that it won't conflict with a GLES
76
library if we are using EGL + GLES. These are just the functions
77
that we want to use before calling glXGetProcAddress */
79
(* glXQueryExtension) (Display *dpy, int *errorb, int *event);
81
(* glXQueryExtensionsString) (Display *dpy, int screen);
83
(* glXQueryVersion) (Display *dpy, int *maj, int *min);
85
(* glXGetProcAddress) (const GLubyte *procName);
88
(* glXQueryDrawable) (Display *dpy, GLXDrawable drawable,
89
int attribute, unsigned int *value);
91
/* Function pointers for GLX specific extensions */
92
#define COGL_WINSYS_FEATURE_BEGIN(a, b, c, d, e, f, g)
94
#define COGL_WINSYS_FEATURE_FUNCTION(ret, name, args) \
95
ret (APIENTRY * name) args;
97
#define COGL_WINSYS_FEATURE_END()
99
#include "cogl-winsys-glx-feature-functions.h"
101
#undef COGL_WINSYS_FEATURE_BEGIN
102
#undef COGL_WINSYS_FEATURE_FUNCTION
103
#undef COGL_WINSYS_FEATURE_END
106
#endif /* __COGL_RENDERER_GLX_PRIVATE_H */