010d16f647
This makes it possible to integrate existing GLES2 code with applications using Cogl as the rendering api. Currently all GLES2 usage is handled with separate GLES2 contexts to ensure that GLES2 api usage doesn't interfere with Cogl's own use of OpenGL[ES]. The api has been designed though so we can provide tighter integration later. The api would allow us to support GLES2 virtualized on top of an OpenGL/GLX driver as well as GLES2 virtualized on the core rendering api of Cogl itself. Virtualizing the GLES2 support on Cogl will allow us to take advantage of Cogl debugging facilities as well as let us optimize the cost of allocating multiple GLES2 contexts and switching between them which can both be very expensive with many drivers. As as a side effect of this patch Cogl can also now be used as a portable window system binding API for GLES2 as an alternative to EGL. Parts of this patch are based on work done by Tomeu Vizoso <tomeu.vizoso@collabora.com> who did the first iteration of adding GLES2 API support to Cogl so that WebGL support could be added to webkit-clutter. This patch adds a very minimal cogl-gles2-context example that shows how to create a gles2 context, clear the screen to a random color and also draw a triangle with the cogl api. Reviewed-by: Neil Roberts <neil@linux.intel.com> (cherry picked from commit 4bb6eff3dbd50d8fef7d6bdbed55c5aaa70036a8)
87 lines
2.0 KiB
Makefile
87 lines
2.0 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
|
|
|
|
cogl_gles2_context_SOURCES = cogl-gles2-context.c
|
|
cogl_gles2_context_LDADD = $(common_ldadd)
|
|
|
|
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
|
|
|