2010-11-05 08:28:33 -04:00
|
|
|
/*
|
|
|
|
* Cogl
|
|
|
|
*
|
|
|
|
* An object oriented GL/GLES Abstraction/Utility Layer
|
|
|
|
*
|
|
|
|
* Copyright (C) 2011 Intel Corporation.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library. If not, see
|
|
|
|
* <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __COGL_RENDERER_GLX_PRIVATE_H
|
|
|
|
#define __COGL_RENDERER_GLX_PRIVATE_H
|
|
|
|
|
2011-07-07 15:44:56 -04:00
|
|
|
#include <gmodule.h>
|
2010-11-05 08:28:33 -04:00
|
|
|
#include "cogl-object-private.h"
|
2011-06-28 09:16:24 -04:00
|
|
|
#include "cogl-xlib-renderer-private.h"
|
2010-11-05 08:28:33 -04:00
|
|
|
|
2011-06-28 09:16:24 -04:00
|
|
|
typedef struct _CoglGLXRenderer
|
2010-11-05 08:28:33 -04:00
|
|
|
{
|
|
|
|
int glx_major;
|
|
|
|
int glx_minor;
|
|
|
|
|
|
|
|
int glx_error_base;
|
|
|
|
int glx_event_base;
|
|
|
|
|
Switch use of primitive glib types to c99 equivalents
The coding style has for a long time said to avoid using redundant glib
data types such as gint or gchar etc because we feel that they make the
code look unnecessarily foreign to developers coming from outside of the
Gnome developer community.
Note: When we tried to find the historical rationale for the types we
just found that they were apparently only added for consistent syntax
highlighting which didn't seem that compelling.
Up until now we have been continuing to use some of the platform
specific type such as gint{8,16,32,64} and gsize but this patch switches
us over to using the standard c99 equivalents instead so we can further
ensure that our code looks familiar to the widest range of C developers
who might potentially contribute to Cogl.
So instead of using the gint{8,16,32,64} and guint{8,16,32,64} types this
switches all Cogl code to instead use the int{8,16,32,64}_t and
uint{8,16,32,64}_t c99 types instead.
Instead of gsize we now use size_t
For now we are not going to use the c99 _Bool type and instead we have
introduced a new CoglBool type to use instead of gboolean.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit 5967dad2400d32ca6319cef6cb572e81bf2c15f0)
2012-04-16 16:56:40 -04:00
|
|
|
CoglBool is_direct;
|
2010-11-05 08:28:33 -04:00
|
|
|
|
|
|
|
/* Vblank stuff */
|
|
|
|
int dri_fd;
|
|
|
|
|
2012-11-12 11:58:10 -05:00
|
|
|
/* enumeration with relatioship between OML_sync_control
|
|
|
|
* UST (unadjusted-system-time) and the system clock */
|
|
|
|
enum {
|
|
|
|
COGL_GLX_UST_IS_UNKNOWN,
|
|
|
|
COGL_GLX_UST_IS_GETTIMEOFDAY,
|
|
|
|
COGL_GLX_UST_IS_MONOTONIC_TIME,
|
|
|
|
COGL_GLX_UST_IS_OTHER
|
|
|
|
} ust_type;
|
|
|
|
|
2011-07-07 15:44:56 -04:00
|
|
|
/* GModule pointing to libGL which we use to get glX functions out of */
|
|
|
|
GModule *libgl_module;
|
|
|
|
|
2013-04-18 09:19:43 -04:00
|
|
|
CoglClosure *flush_notifications_idle;
|
2013-04-16 18:46:03 -04:00
|
|
|
|
2012-12-12 14:58:35 -05:00
|
|
|
/* Copy of the winsys features that are based purely on the
|
|
|
|
* information we can get without using a GL context. We want to
|
|
|
|
* determine this before we have a context so that we can use the
|
|
|
|
* function pointers from the extensions earlier. This is necessary
|
|
|
|
* to use the glXCreateContextAttribs function. */
|
|
|
|
unsigned long base_winsys_features
|
|
|
|
[COGL_FLAGS_N_LONGS_FOR_SIZE (COGL_WINSYS_FEATURE_N_FEATURES)];
|
|
|
|
|
|
|
|
CoglFeatureFlags legacy_feature_flags;
|
|
|
|
|
2011-07-07 15:44:56 -04:00
|
|
|
/* Function pointers for core GLX functionality. We can't just link
|
|
|
|
against these directly because we need to conditionally load
|
|
|
|
libGL when we are using GLX so that it won't conflict with a GLES
|
2012-12-12 14:58:35 -05:00
|
|
|
library if we are using EGL + GLES. These are just the functions
|
|
|
|
that we want to use before calling glXGetProcAddress */
|
2011-07-07 15:44:56 -04:00
|
|
|
Bool
|
|
|
|
(* glXQueryExtension) (Display *dpy, int *errorb, int *event);
|
|
|
|
const char *
|
|
|
|
(* glXQueryExtensionsString) (Display *dpy, int screen);
|
|
|
|
Bool
|
|
|
|
(* glXQueryVersion) (Display *dpy, int *maj, int *min);
|
2011-07-27 07:30:02 -04:00
|
|
|
void *
|
|
|
|
(* glXGetProcAddress) (const GLubyte *procName);
|
|
|
|
|
2012-12-14 17:26:30 -05:00
|
|
|
int
|
|
|
|
(* glXQueryDrawable) (Display *dpy, GLXDrawable drawable,
|
|
|
|
int attribute, unsigned int *value);
|
|
|
|
|
2010-11-05 08:28:33 -04:00
|
|
|
/* Function pointers for GLX specific extensions */
|
2012-12-12 14:58:35 -05:00
|
|
|
#define COGL_WINSYS_FEATURE_BEGIN(a, b, c, d, e, f, g)
|
2010-11-05 08:28:33 -04:00
|
|
|
|
|
|
|
#define COGL_WINSYS_FEATURE_FUNCTION(ret, name, args) \
|
2012-12-12 14:58:35 -05:00
|
|
|
ret (APIENTRY * name) args;
|
2010-11-05 08:28:33 -04:00
|
|
|
|
|
|
|
#define COGL_WINSYS_FEATURE_END()
|
|
|
|
|
|
|
|
#include "cogl-winsys-glx-feature-functions.h"
|
|
|
|
|
|
|
|
#undef COGL_WINSYS_FEATURE_BEGIN
|
|
|
|
#undef COGL_WINSYS_FEATURE_FUNCTION
|
|
|
|
#undef COGL_WINSYS_FEATURE_END
|
2011-06-28 09:16:24 -04:00
|
|
|
} CoglGLXRenderer;
|
2010-11-05 08:28:33 -04:00
|
|
|
|
|
|
|
#endif /* __COGL_RENDERER_GLX_PRIVATE_H */
|