This adds an example of using libcogl-gles2 as a way to port existing
GLES 2.0 based code. This is a port of es2gears in the Mesa demos repo.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit fcb947178858e9d675c5f76e50510282c6b0bf8d)
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)
This adds a simple example based on the hello example but that forces
the SDL winsys and listens for mouse motion events to move the
triangle.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
It could be nice to extend this as Cogl gains more APIs for
introspecting its own features but for now cogl-info just uses the new
cogl_foreach_feature() API to enumerate the available features for
a default context and prints those to the terminal.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
This adds a very basic test of onscreen and offscreen multisample
rendering with 4 samples per pixel. The test simply draws two triangles;
the one on the left is rendered directly to the onscreen framebuffer and
the other is first rendered offscreen before copying it onscreen.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
This namespaces all of the examples and marks them for installation
if --enable-examples-install has been passed to ./configure. This
simplifies packaging the examples which can be quite convenient
for smoke testing Cogl on various platform.
https://bugzilla.gnome.org/show_bug.cgi?id=656755
Reviewed-by: Neil Roberts <neil@linux.intel.com>
G_DISABLE_DEPRECATED is only intended for developers of Cogl and it
sometimes breaks the build for people just trying to build a
release. This patch adds an option to enable deprecated Glib
features. By default it is enabled for non-git versions of Cogl.
The patch is based on similar code in Clutter except it adds the flags
to COGL_EXTRA_CFLAGS instead of having a separate variable.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
The crate example uses the cogl_pango API and perviously we just
explicitly said to link with the libcogl-pango.la but that doesn't seem
to be enough (not really sure why since libtool should know the required
dependencies to brining in for linking) so we now pass
$(COGL_PANGO_DEP_LIBS) when linking the crate demo.
https://bugzilla.gnome.org/show_bug.cgi?id=656441
Only cogl-pango needs a dependency on pangocairo so we are now careful to
separate the pangocairo pkg-config flags from the others so we can avoid
having libcogl builds refer to them.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
Based on the Cogl example we had on wiki.clutter-project.org this shows
how to use the primitive API to draw a simple spinning crate.
Signed-off-by: Neil Roberts <neil@linux.intel.com>
The x11-foreign example directly uses the X11 API at it seems that more
recent versions of binutils complain if we don't directly link the test
with libX11 as opposed to relying on indirect linkage via cogl.
This adds an example cogl compositor to test the
_cogl_wayland_texture_2d_new_from_buffer API. The compositor emulates 4
output displays but doesn't support input since Cogl doesn't deal with
input. It's quite a minimal example of what it takes to write a wayland
compositor so could be interesting to anyone learning about wayland.
This adds a simple standalone Cogl application that can be used to
smoke test a standalone build of Cogl without Clutter.
This also adds an x11-foreign app that shows how a toolkit can ask Cogl
to draw to an X Window that it owns instead of Cogl being responsible
for automatically creating and mapping an X Window for CoglOnscreen.