mirror of
https://github.com/brl/mutter.git
synced 2024-11-30 03:50:47 -05:00
17c818a9a7
This adds an alternate version of the SDL winsys using the SDL 2 API. The two versions are mutually exclusive and share the same CoglWinsysID. Version 2 of SDL fits a little bit better with Cogl because it supports multiple windows and the video subsystem can be initialised entirely independently of the rest of the subsystems. The SDL2 winsys creates an invisible dummy window in order to bind the GL context after creating the Cogl display. This is similar to how the X11 winsys's work. SDL2 seems to support compiling with support for both GL and GLES. However there doesn't seem to be a way to select between the two backends outside of SDL. In fact if you do compile them both in it seems to break down because it will always try to use the window system functions from the GLES backend because those are filled in second in the vtable. However when creating the window it will always prefer to use the GL function to choose a visual. This function gets confused because the GL backend has not been initialised at that point. The Cogl backend therefore just leaves it up to SDL to pick a sensible backend. It will then verify that it picked a GL library which matches the Cogl driver by checking the string from glGetString(GL_VERSION). Reviewed-by: Robert Bragg <robert@linux.intel.com> (cherry picked from commit 6cb5ab41355e7bfe28f367cf4afa39a7afcfeec2)
100 lines
2.4 KiB
Makefile
100 lines
2.4 KiB
Makefile
include $(top_srcdir)/build/autotools/Makefile.am.silent
|
|
|
|
INCLUDES = \
|
|
-I$(top_srcdir)
|
|
|
|
AM_CFLAGS = \
|
|
$(COGL_DEP_CFLAGS) \
|
|
$(COGL_EXTRA_CFLAGS) \
|
|
-DCOGL_ENABLE_EXPERIMENTAL_2_0_API
|
|
|
|
if INSTALL_EXAMPLES
|
|
AM_CFLAGS += -DCOGL_EXAMPLES_DATA=\""$(pkgdatadir)/examples-data/"\"
|
|
else
|
|
AM_CFLAGS += -DCOGL_EXAMPLES_DATA=\""$(abs_top_srcdir)/examples/"\"
|
|
endif
|
|
|
|
common_ldadd = \
|
|
$(COGL_DEP_LIBS) \
|
|
$(top_builddir)/cogl/libcogl.la
|
|
|
|
programs = cogl-info
|
|
|
|
cogl_info_SOURCES = cogl-info.c
|
|
cogl_info_LDADD = $(common_ldadd)
|
|
|
|
if USE_GLIB
|
|
programs += cogl-hello cogl-msaa cogl-gles2-context
|
|
examples_datadir = $(pkgdatadir)/examples-data
|
|
examples_data_DATA =
|
|
|
|
cogl_hello_SOURCES = cogl-hello.c
|
|
cogl_hello_LDADD = $(common_ldadd)
|
|
cogl_info_SOURCES = cogl-info.c
|
|
cogl_info_LDADD = $(common_ldadd)
|
|
cogl_msaa_SOURCES = cogl-msaa.c
|
|
cogl_msaa_LDADD = $(common_ldadd)
|
|
|
|
if BUILD_COGL_PANGO
|
|
programs += cogl-crate
|
|
cogl_crate_SOURCES = cogl-crate.c
|
|
cogl_crate_LDADD = $(common_ldadd) $(COGL_PANGO_DEP_LIBS) $(top_builddir)/cogl-pango/libcogl-pango.la
|
|
cogl_crate_CFLAGS = $(AM_CFLAGS) $(COGL_PANGO_DEP_CFLAGS)
|
|
examples_data_DATA += crate.jpg
|
|
endif
|
|
|
|
if X11_TESTS
|
|
programs += cogl-x11-foreign cogl-x11-tfp
|
|
cogl_x11_foreign_SOURCES = cogl-x11-foreign.c
|
|
cogl_x11_foreign_LDADD = $(common_ldadd)
|
|
cogl_x11_tfp_SOURCES = cogl-x11-tfp.c
|
|
cogl_x11_tfp_LDADD = $(common_ldadd)
|
|
endif
|
|
|
|
if SUPPORT_WAYLAND_EGL_SERVER
|
|
programs += cogland
|
|
cogland_SOURCES = cogland.c
|
|
cogland_LDADD = $(common_ldadd)
|
|
endif
|
|
|
|
if SUPPORT_SDL
|
|
programs += cogl-sdl-hello
|
|
cogl_sdl_hello_SOURCES = cogl-sdl-hello.c
|
|
cogl_sdl_hello_LDADD = $(common_ldadd)
|
|
endif
|
|
|
|
if SUPPORT_SDL2
|
|
programs += cogl-sdl2-hello
|
|
cogl_sdl2_hello_SOURCES = cogl-sdl2-hello.c
|
|
cogl_sdl2_hello_LDADD = $(common_ldadd)
|
|
endif
|
|
|
|
cogl_gles2_context_SOURCES = cogl-gles2-context.c
|
|
cogl_gles2_context_LDADD = $(common_ldadd)
|
|
|
|
if BUILD_COGL_GLES2
|
|
programs += cogl-gles2-gears
|
|
cogl_gles2_gears_SOURCES = cogl-gles2-gears.c
|
|
cogl_gles2_gears_CFLAGS = -I$(top_srcdir)/cogl-gles2 $(AM_CFLAGS)
|
|
cogl_gles2_gears_LDADD = $(common_ldadd) $(top_builddir)/cogl-gles2/libcogl-gles2.la
|
|
endif
|
|
|
|
endif #USE_GLIB
|
|
|
|
if INSTALL_EXAMPLES
|
|
bin_PROGRAMS = $(programs)
|
|
else
|
|
noinst_PROGRAMS = $(programs)
|
|
endif
|
|
|
|
EXTRA_DIST = \
|
|
crate.jpg \
|
|
android/hello/AndroidManifest.xml \
|
|
android/hello/jni/Application.mk \
|
|
android/hello/jni/Android.mk \
|
|
android/hello/jni/main.c \
|
|
android/hello/res/values/strings.xml \
|
|
android/hello/.gitignore \
|
|
android/hello/build.xml
|
|
|