mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 19:42:05 +00:00
Make stub winsys into a proper winsys backend
Instead of the stub winsys being a special case set of #ifdef'd code used when COGL_HAS_FULL_WINSYS wasn't defined, the stub winsys now implements a CoglWinsysVtable like all other winsys backends (it's just that everything is a NOP). This way we can get rid of the COGL_HAS_FULL_WINSYS define and also the stub winsys can be runtime selected whereas before it was incompatible with all other winsys backends.
This commit is contained in:
parent
1ec8525510
commit
b380fed23d
@ -303,6 +303,7 @@ cogl_sources_c = \
|
|||||||
$(srcdir)/cogl-point-in-poly-private.h \
|
$(srcdir)/cogl-point-in-poly-private.h \
|
||||||
$(srcdir)/cogl-point-in-poly.c \
|
$(srcdir)/cogl-point-in-poly.c \
|
||||||
$(srcdir)/cogl-clutter.c \
|
$(srcdir)/cogl-clutter.c \
|
||||||
|
$(srcdir)/winsys/cogl-winsys-stub.c \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
if SUPPORT_XLIB
|
if SUPPORT_XLIB
|
||||||
@ -352,10 +353,6 @@ if SUPPORT_EGL_PLATFORM_ANDROID
|
|||||||
cogl_sources_c += \
|
cogl_sources_c += \
|
||||||
$(srcdir)/winsys/cogl-winsys-egl.c
|
$(srcdir)/winsys/cogl-winsys-egl.c
|
||||||
endif
|
endif
|
||||||
if SUPPORT_STUB
|
|
||||||
cogl_sources_c += \
|
|
||||||
$(srcdir)/winsys/cogl-winsys-stub.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
EXTRA_DIST += stb_image.c
|
EXTRA_DIST += stb_image.c
|
||||||
|
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
#include "cogl-private.h"
|
#include "cogl-private.h"
|
||||||
#include "cogl-context-private.h"
|
#include "cogl-context-private.h"
|
||||||
#include "cogl-winsys-private.h"
|
#include "cogl-winsys-private.h"
|
||||||
|
#include "cogl-winsys-stub-private.h"
|
||||||
#include "cogl-framebuffer-private.h"
|
#include "cogl-framebuffer-private.h"
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
@ -56,7 +57,7 @@ cogl_onscreen_clutter_backend_set_size (int width, int height)
|
|||||||
|
|
||||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||||
|
|
||||||
if (!ctx->stub_winsys)
|
if (_cogl_context_get_winsys (ctx) != _cogl_winsys_stub_get_vtable ())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
framebuffer = COGL_FRAMEBUFFER (ctx->window_buffer);
|
framebuffer = COGL_FRAMEBUFFER (ctx->window_buffer);
|
||||||
|
@ -263,7 +263,6 @@ struct _CoglContext
|
|||||||
unsigned int winsys_features
|
unsigned int winsys_features
|
||||||
[COGL_FLAGS_N_INTS_FOR_SIZE (COGL_WINSYS_FEATURE_N_FEATURES)];
|
[COGL_FLAGS_N_INTS_FOR_SIZE (COGL_WINSYS_FEATURE_N_FEATURES)];
|
||||||
void *winsys;
|
void *winsys;
|
||||||
gboolean stub_winsys;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
CoglContext *
|
CoglContext *
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
#include "cogl-internal.h"
|
#include "cogl-internal.h"
|
||||||
#include "cogl-private.h"
|
#include "cogl-private.h"
|
||||||
#include "cogl-winsys-private.h"
|
#include "cogl-winsys-private.h"
|
||||||
|
#include "cogl-winsys-stub-private.h"
|
||||||
#include "cogl-profile.h"
|
#include "cogl-profile.h"
|
||||||
#include "cogl-util.h"
|
#include "cogl-util.h"
|
||||||
#include "cogl-context-private.h"
|
#include "cogl-context-private.h"
|
||||||
@ -162,8 +163,6 @@ cogl_context_new (CoglDisplay *display,
|
|||||||
|
|
||||||
context->display = display;
|
context->display = display;
|
||||||
|
|
||||||
#ifdef COGL_HAS_FULL_WINSYS
|
|
||||||
context->stub_winsys = FALSE;
|
|
||||||
winsys = _cogl_context_get_winsys (context);
|
winsys = _cogl_context_get_winsys (context);
|
||||||
if (!winsys->context_init (context, error))
|
if (!winsys->context_init (context, error))
|
||||||
{
|
{
|
||||||
@ -171,20 +170,6 @@ cogl_context_new (CoglDisplay *display,
|
|||||||
g_free (context);
|
g_free (context);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
/* In this case Clutter is still responsible for creating a GL
|
|
||||||
* context. */
|
|
||||||
context->stub_winsys = TRUE;
|
|
||||||
if (!_cogl_gl_check_version (error))
|
|
||||||
{
|
|
||||||
g_free (context);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
_cogl_gl_update_features (context);
|
|
||||||
#ifdef COGL_HAS_XLIB_SUPPORT
|
|
||||||
_cogl_xlib_query_damage_extension ();
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Initialise the driver specific state */
|
/* Initialise the driver specific state */
|
||||||
_cogl_init_feature_overrides (context);
|
_cogl_init_feature_overrides (context);
|
||||||
@ -284,7 +269,7 @@ cogl_context_new (CoglDisplay *display,
|
|||||||
* the OpenGL binding API and for creating onscreen framebuffers and
|
* the OpenGL binding API and for creating onscreen framebuffers and
|
||||||
* so we have to add a dummy framebuffer to represent the backend
|
* so we have to add a dummy framebuffer to represent the backend
|
||||||
* owned window... */
|
* owned window... */
|
||||||
if (context->stub_winsys)
|
if (_cogl_context_get_winsys (context) == _cogl_winsys_stub_get_vtable ())
|
||||||
{
|
{
|
||||||
CoglOnscreen *window = _cogl_onscreen_new ();
|
CoglOnscreen *window = _cogl_onscreen_new ();
|
||||||
cogl_set_framebuffer (COGL_FRAMEBUFFER (window));
|
cogl_set_framebuffer (COGL_FRAMEBUFFER (window));
|
||||||
|
@ -104,18 +104,14 @@ gboolean
|
|||||||
cogl_display_setup (CoglDisplay *display,
|
cogl_display_setup (CoglDisplay *display,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
#ifdef COGL_HAS_FULL_WINSYS
|
|
||||||
const CoglWinsysVtable *winsys;
|
const CoglWinsysVtable *winsys;
|
||||||
#endif
|
|
||||||
|
|
||||||
if (display->setup)
|
if (display->setup)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
#ifdef COGL_HAS_FULL_WINSYS
|
|
||||||
winsys = _cogl_display_get_winsys (display);
|
winsys = _cogl_display_get_winsys (display);
|
||||||
if (!winsys->display_setup (display, error))
|
if (!winsys->display_setup (display, error))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
#endif
|
|
||||||
|
|
||||||
display->setup = TRUE;
|
display->setup = TRUE;
|
||||||
|
|
||||||
|
@ -1372,11 +1372,9 @@ bind_gl_framebuffer (CoglContext *ctx,
|
|||||||
COGL_OFFSCREEN (framebuffer)->fbo_handle));
|
COGL_OFFSCREEN (framebuffer)->fbo_handle));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifdef COGL_HAS_FULL_WINSYS
|
|
||||||
const CoglWinsysVtable *winsys =
|
const CoglWinsysVtable *winsys =
|
||||||
_cogl_framebuffer_get_winsys (framebuffer);
|
_cogl_framebuffer_get_winsys (framebuffer);
|
||||||
winsys->onscreen_bind (COGL_ONSCREEN (framebuffer));
|
winsys->onscreen_bind (COGL_ONSCREEN (framebuffer));
|
||||||
#endif
|
|
||||||
/* glBindFramebuffer is an an extension with OpenGL ES 1.1 */
|
/* glBindFramebuffer is an an extension with OpenGL ES 1.1 */
|
||||||
if (cogl_features_available (COGL_FEATURE_OFFSCREEN))
|
if (cogl_features_available (COGL_FEATURE_OFFSCREEN))
|
||||||
GE (glBindFramebuffer (target, 0));
|
GE (glBindFramebuffer (target, 0));
|
||||||
|
@ -39,8 +39,7 @@
|
|||||||
#include "cogl-renderer-private.h"
|
#include "cogl-renderer-private.h"
|
||||||
#include "cogl-display-private.h"
|
#include "cogl-display-private.h"
|
||||||
#include "cogl-winsys-private.h"
|
#include "cogl-winsys-private.h"
|
||||||
|
#include "cogl-winsys-stub-private.h"
|
||||||
#ifdef COGL_HAS_FULL_WINSYS
|
|
||||||
|
|
||||||
#ifdef COGL_HAS_GLX_SUPPORT
|
#ifdef COGL_HAS_GLX_SUPPORT
|
||||||
extern const CoglWinsysVtable *_cogl_winsys_glx_get_vtable (void);
|
extern const CoglWinsysVtable *_cogl_winsys_glx_get_vtable (void);
|
||||||
@ -65,10 +64,9 @@ static CoglWinsysVtableGetter _cogl_winsys_vtable_getters[] =
|
|||||||
#ifdef COGL_HAS_WGL_SUPPORT
|
#ifdef COGL_HAS_WGL_SUPPORT
|
||||||
_cogl_winsys_wgl_get_vtable,
|
_cogl_winsys_wgl_get_vtable,
|
||||||
#endif
|
#endif
|
||||||
|
_cogl_winsys_stub_get_vtable,
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* COGL_HAS_FULL_WINSYS */
|
|
||||||
|
|
||||||
static void _cogl_renderer_free (CoglRenderer *renderer);
|
static void _cogl_renderer_free (CoglRenderer *renderer);
|
||||||
|
|
||||||
COGL_OBJECT_DEFINE (Renderer, renderer);
|
COGL_OBJECT_DEFINE (Renderer, renderer);
|
||||||
@ -100,10 +98,8 @@ native_filter_closure_free (CoglNativeFilterClosure *closure)
|
|||||||
static void
|
static void
|
||||||
_cogl_renderer_free (CoglRenderer *renderer)
|
_cogl_renderer_free (CoglRenderer *renderer)
|
||||||
{
|
{
|
||||||
#ifdef COGL_HAS_FULL_WINSYS
|
|
||||||
const CoglWinsysVtable *winsys = _cogl_renderer_get_winsys (renderer);
|
const CoglWinsysVtable *winsys = _cogl_renderer_get_winsys (renderer);
|
||||||
winsys->renderer_disconnect (renderer);
|
winsys->renderer_disconnect (renderer);
|
||||||
#endif
|
|
||||||
|
|
||||||
g_slist_foreach (renderer->event_filters,
|
g_slist_foreach (renderer->event_filters,
|
||||||
(GFunc) native_filter_closure_free,
|
(GFunc) native_filter_closure_free,
|
||||||
@ -151,7 +147,6 @@ cogl_renderer_check_onscreen_template (CoglRenderer *renderer,
|
|||||||
CoglOnscreenTemplate *onscreen_template,
|
CoglOnscreenTemplate *onscreen_template,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
#ifdef COGL_HAS_FULL_WINSYS
|
|
||||||
CoglDisplay *display;
|
CoglDisplay *display;
|
||||||
const CoglWinsysVtable *winsys = _cogl_renderer_get_winsys (renderer);
|
const CoglWinsysVtable *winsys = _cogl_renderer_get_winsys (renderer);
|
||||||
|
|
||||||
@ -166,7 +161,7 @@ cogl_renderer_check_onscreen_template (CoglRenderer *renderer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
cogl_object_unref (display);
|
cogl_object_unref (display);
|
||||||
#endif
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,16 +170,13 @@ cogl_renderer_check_onscreen_template (CoglRenderer *renderer,
|
|||||||
gboolean
|
gboolean
|
||||||
cogl_renderer_connect (CoglRenderer *renderer, GError **error)
|
cogl_renderer_connect (CoglRenderer *renderer, GError **error)
|
||||||
{
|
{
|
||||||
#ifdef COGL_HAS_FULL_WINSYS
|
|
||||||
int i;
|
int i;
|
||||||
char *renderer_name = getenv ("COGL_RENDERER");
|
char *renderer_name = getenv ("COGL_RENDERER");
|
||||||
#endif
|
|
||||||
GString *error_message;
|
GString *error_message;
|
||||||
|
|
||||||
if (renderer->connected)
|
if (renderer->connected)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
#ifdef COGL_HAS_FULL_WINSYS
|
|
||||||
error_message = g_string_new ("");
|
error_message = g_string_new ("");
|
||||||
for (i = 0; i < G_N_ELEMENTS (_cogl_winsys_vtable_getters); i++)
|
for (i = 0; i < G_N_ELEMENTS (_cogl_winsys_vtable_getters); i++)
|
||||||
{
|
{
|
||||||
@ -221,10 +213,6 @@ cogl_renderer_connect (CoglRenderer *renderer, GError **error)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
#else
|
|
||||||
renderer->connected = TRUE;
|
|
||||||
return TRUE;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CoglFilterReturn
|
CoglFilterReturn
|
||||||
|
@ -95,7 +95,6 @@ cogl_get_proc_address (const char* name)
|
|||||||
{
|
{
|
||||||
void *address;
|
void *address;
|
||||||
static GModule *module = NULL;
|
static GModule *module = NULL;
|
||||||
#ifdef COGL_HAS_FULL_WINSYS
|
|
||||||
const CoglWinsysVtable *winsys;
|
const CoglWinsysVtable *winsys;
|
||||||
|
|
||||||
_COGL_GET_CONTEXT (ctx, NULL);
|
_COGL_GET_CONTEXT (ctx, NULL);
|
||||||
@ -103,9 +102,6 @@ cogl_get_proc_address (const char* name)
|
|||||||
winsys = _cogl_context_get_winsys (ctx);
|
winsys = _cogl_context_get_winsys (ctx);
|
||||||
|
|
||||||
address = winsys->get_proc_address (name);
|
address = winsys->get_proc_address (name);
|
||||||
#else
|
|
||||||
address = _cogl_winsys_get_proc_address (name);
|
|
||||||
#endif
|
|
||||||
if (address)
|
if (address)
|
||||||
return address;
|
return address;
|
||||||
|
|
||||||
|
30
cogl/winsys/cogl-winsys-stub-private.h
Normal file
30
cogl/winsys/cogl-winsys-stub-private.h
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
/*
|
||||||
|
* 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_WINSYS_STUB_PRIVATE_H
|
||||||
|
#define __COGL_WINSYS_STUB_PRIVATE_H
|
||||||
|
|
||||||
|
const CoglWinsysVtable *
|
||||||
|
_cogl_winsys_stub_get_vtable (void);
|
||||||
|
|
||||||
|
#endif /* __COGL_WINSYS_STUB_PRIVATE_H */
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||||
*
|
*
|
||||||
* Copyright (C) 2010 Intel Corporation.
|
* Copyright (C) 2011 Intel Corporation.
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
@ -16,97 +16,144 @@
|
|||||||
* Lesser General Public License for more details.
|
* Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
* 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/>.
|
* License along with this library. If not, see
|
||||||
|
* <http://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
* Authors:
|
||||||
|
* Robert Bragg <robert@linux.intel.com>
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "cogl-renderer-private.h"
|
||||||
|
#include "cogl-display-private.h"
|
||||||
|
#include "cogl-context-private.h"
|
||||||
#include "cogl-framebuffer-private.h"
|
#include "cogl-framebuffer-private.h"
|
||||||
|
#include "cogl-private.h"
|
||||||
|
|
||||||
/* This provides a stub winsys implementation for when Clutter still handles
|
#include <string.h>
|
||||||
* creating an OpenGL context. This is useful so we don't have to guard all
|
|
||||||
* calls into the winsys layer with #ifdef COGL_HAS_FULL_WINSYS
|
static int _cogl_winsys_stub_dummy_ptr;
|
||||||
|
|
||||||
|
/* This provides a NOP winsys. This can be useful for debugging or for
|
||||||
|
* integrating with toolkits that already have window system
|
||||||
|
* integration code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
CoglFuncPtr
|
static CoglFuncPtr
|
||||||
_cogl_winsys_get_proc_address (const char *name)
|
_cogl_winsys_get_proc_address (const char *name)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
_cogl_winsys_onscreen_swap_buffers (CoglOnscreen *onscreen)
|
_cogl_winsys_renderer_disconnect (CoglRenderer *renderer)
|
||||||
{
|
{
|
||||||
|
renderer->winsys = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static gboolean
|
||||||
_cogl_winsys_onscreen_swap_region (CoglOnscreen *onscreen,
|
_cogl_winsys_renderer_connect (CoglRenderer *renderer,
|
||||||
int *rectangles,
|
GError **error)
|
||||||
int n_rectangles)
|
|
||||||
{
|
{
|
||||||
|
renderer->winsys = &_cogl_winsys_stub_dummy_ptr;
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
_cogl_winsys_onscreen_update_swap_throttled (CoglOnscreen *onscreen)
|
_cogl_winsys_display_destroy (CoglDisplay *display)
|
||||||
{
|
{
|
||||||
|
display->winsys = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int
|
static gboolean
|
||||||
_cogl_winsys_onscreen_add_swap_buffers_callback (CoglOnscreen *onscreen,
|
_cogl_winsys_display_setup (CoglDisplay *display,
|
||||||
CoglSwapBuffersNotify callback,
|
GError **error)
|
||||||
void *user_data)
|
|
||||||
{
|
{
|
||||||
g_assert (0);
|
display->winsys = &_cogl_winsys_stub_dummy_ptr;
|
||||||
return 0;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static gboolean
|
||||||
_cogl_winsys_onscreen_remove_swap_buffers_callback (CoglOnscreen *onscreen,
|
_cogl_winsys_context_init (CoglContext *context, GError **error)
|
||||||
unsigned int id)
|
|
||||||
{
|
{
|
||||||
g_assert (0);
|
context->winsys = &_cogl_winsys_stub_dummy_ptr;
|
||||||
|
|
||||||
|
if (!_cogl_gl_check_version (error))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
_cogl_gl_update_features (context);
|
||||||
|
|
||||||
|
memset (context->winsys_features, 0, sizeof (context->winsys_features));
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef COGL_HAS_XLIB_SUPPORT
|
static void
|
||||||
XVisualInfo *
|
_cogl_winsys_context_deinit (CoglContext *context)
|
||||||
_cogl_winsys_xlib_get_visual_info (void)
|
|
||||||
{
|
{
|
||||||
g_assert (0);
|
context->winsys = NULL;
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef COGL_HAS_X11_SUPPORT
|
static gboolean
|
||||||
guint32
|
|
||||||
_cogl_winsys_onscreen_x11_get_window_xid (CoglOnscreen *onscreen)
|
|
||||||
{
|
|
||||||
g_assert (0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
gboolean
|
|
||||||
_cogl_winsys_onscreen_init (CoglOnscreen *onscreen,
|
_cogl_winsys_onscreen_init (CoglOnscreen *onscreen,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
_cogl_winsys_onscreen_deinit (CoglOnscreen *onscreen)
|
_cogl_winsys_onscreen_deinit (CoglOnscreen *onscreen)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
_cogl_winsys_context_deinit (CoglContext *context)
|
_cogl_winsys_onscreen_bind (CoglOnscreen *onscreen)
|
||||||
{
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_cogl_winsys_onscreen_swap_buffers (CoglOnscreen *onscreen)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_cogl_winsys_onscreen_update_swap_throttled (CoglOnscreen *onscreen)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_cogl_winsys_onscreen_set_visibility (CoglOnscreen *onscreen,
|
||||||
|
gboolean visibility)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static CoglWinsysVtable _cogl_winsys_vtable =
|
||||||
|
{
|
||||||
|
.name = "STUB",
|
||||||
|
.get_proc_address = _cogl_winsys_get_proc_address,
|
||||||
|
.renderer_connect = _cogl_winsys_renderer_connect,
|
||||||
|
.renderer_disconnect = _cogl_winsys_renderer_disconnect,
|
||||||
|
.display_setup = _cogl_winsys_display_setup,
|
||||||
|
.display_destroy = _cogl_winsys_display_destroy,
|
||||||
|
.context_init = _cogl_winsys_context_init,
|
||||||
|
.context_deinit = _cogl_winsys_context_deinit,
|
||||||
|
|
||||||
|
.onscreen_init = _cogl_winsys_onscreen_init,
|
||||||
|
.onscreen_deinit = _cogl_winsys_onscreen_deinit,
|
||||||
|
.onscreen_bind = _cogl_winsys_onscreen_bind,
|
||||||
|
.onscreen_swap_buffers = _cogl_winsys_onscreen_swap_buffers,
|
||||||
|
.onscreen_update_swap_throttled =
|
||||||
|
_cogl_winsys_onscreen_update_swap_throttled,
|
||||||
|
.onscreen_set_visibility = _cogl_winsys_onscreen_set_visibility,
|
||||||
|
};
|
||||||
|
|
||||||
|
const CoglWinsysVtable *
|
||||||
|
_cogl_winsys_stub_get_vtable (void)
|
||||||
|
{
|
||||||
|
return &_cogl_winsys_vtable;
|
||||||
}
|
}
|
||||||
|
40
configure.ac
40
configure.ac
@ -486,24 +486,6 @@ dnl ========================================================
|
|||||||
dnl Check window system integration libraries...
|
dnl Check window system integration libraries...
|
||||||
dnl ========================================================
|
dnl ========================================================
|
||||||
|
|
||||||
dnl The "stub" winsys is a fallback option we use when Cogl doesn't
|
|
||||||
dnl yet have support for a window system. It enables a toolkit like
|
|
||||||
dnl Clutter to provide external support instead. Currently this is
|
|
||||||
dnl not compatible with other window system backends.
|
|
||||||
AC_ARG_ENABLE(
|
|
||||||
[stub-winsys],
|
|
||||||
[AC_HELP_STRING([--enable-stub-winsys=@<:@no/yes@:>@], [Enable support stub winsys @<:@default=no@:>@])],
|
|
||||||
[],
|
|
||||||
enable_stub_winsys=no
|
|
||||||
)
|
|
||||||
AS_IF([test "x$enable_stub_winsys" = "xyes"],
|
|
||||||
[
|
|
||||||
GL_WINSYS_APIS="$GL_WINSYS_APIS stub"
|
|
||||||
ALLOW_GLX=no
|
|
||||||
ALLOW_WGL=no
|
|
||||||
])
|
|
||||||
AM_CONDITIONAL(SUPPORT_STUB, [test "x$enable_stub_winsys" = "xyes"])
|
|
||||||
|
|
||||||
AC_ARG_ENABLE(
|
AC_ARG_ENABLE(
|
||||||
[glx],
|
[glx],
|
||||||
[AC_HELP_STRING([--enable-glx=@<:@no/yes@:>@], [Enable support GLX @<:@default=auto@:>@])],
|
[AC_HELP_STRING([--enable-glx=@<:@no/yes@:>@], [Enable support GLX @<:@default=auto@:>@])],
|
||||||
@ -512,9 +494,6 @@ AC_ARG_ENABLE(
|
|||||||
)
|
)
|
||||||
AS_IF([test "x$enable_glx" = "xyes"],
|
AS_IF([test "x$enable_glx" = "xyes"],
|
||||||
[
|
[
|
||||||
AS_IF([test "x$enable_stub_winsys" = "xyes"],
|
|
||||||
[AC_MSG_ERROR([Stub winsys not currently compatible with others])])
|
|
||||||
|
|
||||||
AS_IF([test "x$ALLOW_GLX" != "xyes"],
|
AS_IF([test "x$ALLOW_GLX" != "xyes"],
|
||||||
[AC_MSG_ERROR([GLX not supported with $COGL_DRIVER driver])])
|
[AC_MSG_ERROR([GLX not supported with $COGL_DRIVER driver])])
|
||||||
|
|
||||||
@ -523,8 +502,6 @@ AS_IF([test "x$enable_glx" = "xyes"],
|
|||||||
GL_WINSYS_APIS="$GL_WINSYS_APIS glx"
|
GL_WINSYS_APIS="$GL_WINSYS_APIS glx"
|
||||||
|
|
||||||
AC_DEFINE([COGL_HAS_GLX_SUPPORT], [1], [Cogl supports OpenGL using the GLX API])
|
AC_DEFINE([COGL_HAS_GLX_SUPPORT], [1], [Cogl supports OpenGL using the GLX API])
|
||||||
AC_DEFINE([COGL_HAS_FULL_WINSYS], [1],
|
|
||||||
[Cogl can create its own OpenGL context])
|
|
||||||
|
|
||||||
# We might fall back to DRM for sync-to-vblank on GLX
|
# We might fall back to DRM for sync-to-vblank on GLX
|
||||||
PKG_CHECK_EXISTS([libdrm],
|
PKG_CHECK_EXISTS([libdrm],
|
||||||
@ -544,9 +521,6 @@ AC_ARG_ENABLE(
|
|||||||
)
|
)
|
||||||
AS_IF([test "x$enable_wgl" = "xyes"],
|
AS_IF([test "x$enable_wgl" = "xyes"],
|
||||||
[
|
[
|
||||||
AS_IF([test "x$enable_stub_winsys" = "xyes"],
|
|
||||||
[AC_MSG_ERROR([Stub winsys not currently compatible with others])])
|
|
||||||
|
|
||||||
AS_IF([test "x$ALLOW_WGL" != "xyes"],
|
AS_IF([test "x$ALLOW_WGL" != "xyes"],
|
||||||
[AC_MSG_ERROR([WGL not supported with $COGL_DRIVER driver])])
|
[AC_MSG_ERROR([WGL not supported with $COGL_DRIVER driver])])
|
||||||
|
|
||||||
@ -555,9 +529,6 @@ AS_IF([test "x$enable_wgl" = "xyes"],
|
|||||||
|
|
||||||
AC_DEFINE([COGL_HAS_WGL_SUPPORT], [1], [Cogl supports OpenGL using the WGL API])
|
AC_DEFINE([COGL_HAS_WGL_SUPPORT], [1], [Cogl supports OpenGL using the WGL API])
|
||||||
COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_WIN32_SUPPORT"
|
COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_WIN32_SUPPORT"
|
||||||
|
|
||||||
AC_DEFINE([COGL_HAS_FULL_WINSYS], [1],
|
|
||||||
[Cogl can create its own OpenGL context])
|
|
||||||
])
|
])
|
||||||
AM_CONDITIONAL(SUPPORT_WGL, [test "x$SUPPORT_WGL" = "xyes"])
|
AM_CONDITIONAL(SUPPORT_WGL, [test "x$SUPPORT_WGL" = "xyes"])
|
||||||
|
|
||||||
@ -571,9 +542,6 @@ AC_ARG_ENABLE(
|
|||||||
)
|
)
|
||||||
AS_IF([test "x$enable_null_egl_platform" = "xyes"],
|
AS_IF([test "x$enable_null_egl_platform" = "xyes"],
|
||||||
[
|
[
|
||||||
AS_IF([test "x$enable_stub_winsys" = "xyes"],
|
|
||||||
[AC_MSG_ERROR([Stub winsys not currently compatible with others])])
|
|
||||||
|
|
||||||
EGL_PLATFORM_COUNT=$((EGL_PLATFORM_COUNT+1))
|
EGL_PLATFORM_COUNT=$((EGL_PLATFORM_COUNT+1))
|
||||||
NEED_EGL=yes
|
NEED_EGL=yes
|
||||||
EGL_PLATFORMS="$EGL_PLATFORMS null"
|
EGL_PLATFORMS="$EGL_PLATFORMS null"
|
||||||
@ -591,9 +559,6 @@ AC_ARG_ENABLE(
|
|||||||
)
|
)
|
||||||
AS_IF([test "x$enable_gdl_egl_platform" == "xyes"],
|
AS_IF([test "x$enable_gdl_egl_platform" == "xyes"],
|
||||||
[
|
[
|
||||||
AS_IF([test "x$enable_stub_winsys" = "xyes"],
|
|
||||||
[AC_MSG_ERROR([Stub winsys not currently compatible with others])])
|
|
||||||
|
|
||||||
EGL_PLATFORM_COUNT=$((EGL_PLATFORM_COUNT+1))
|
EGL_PLATFORM_COUNT=$((EGL_PLATFORM_COUNT+1))
|
||||||
NEED_EGL=yes
|
NEED_EGL=yes
|
||||||
EGL_PLATFORMS="$EGL_PLATFORMS gdl"
|
EGL_PLATFORMS="$EGL_PLATFORMS gdl"
|
||||||
@ -670,9 +635,6 @@ AC_ARG_ENABLE(
|
|||||||
)
|
)
|
||||||
AS_IF([test "x$enable_xlib_egl_platform" = "xyes"],
|
AS_IF([test "x$enable_xlib_egl_platform" = "xyes"],
|
||||||
[
|
[
|
||||||
AS_IF([test "x$enable_stub_winsys" = "xyes"],
|
|
||||||
[AC_MSG_ERROR([Stub winsys not currently compatible with others])])
|
|
||||||
|
|
||||||
EGL_PLATFORM_COUNT=$((EGL_PLATFORM_COUNT+1))
|
EGL_PLATFORM_COUNT=$((EGL_PLATFORM_COUNT+1))
|
||||||
NEED_EGL=yes
|
NEED_EGL=yes
|
||||||
NEED_XLIB=yes
|
NEED_XLIB=yes
|
||||||
@ -712,8 +674,6 @@ AS_IF([test "x$NEED_EGL" = "xyes"],
|
|||||||
SUPPORT_EGL=yes
|
SUPPORT_EGL=yes
|
||||||
GL_WINSYS_APIS="$GL_WINSYS_APIS egl"
|
GL_WINSYS_APIS="$GL_WINSYS_APIS egl"
|
||||||
COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_EGL_SUPPORT"
|
COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_EGL_SUPPORT"
|
||||||
AC_DEFINE([COGL_HAS_FULL_WINSYS], [1],
|
|
||||||
[Cogl can create its own OpenGL context])
|
|
||||||
])
|
])
|
||||||
|
|
||||||
AM_CONDITIONAL(SUPPORT_EGL, [test "x$SUPPORT_EGL" = "xyes"])
|
AM_CONDITIONAL(SUPPORT_EGL, [test "x$SUPPORT_EGL" = "xyes"])
|
||||||
|
Loading…
Reference in New Issue
Block a user