Commit Graph

12 Commits

Author SHA1 Message Date
Neil Roberts
b2e735ff7f Dynamically load the GL or GLES library
The GL or GLES library is now dynamically loaded by the CoglRenderer
so that it can choose between GL, GLES1 and GLES2 at runtime. The
library is loaded by the renderer because it needs to be done before
calling eglInitialize. There is a new environment variable called
COGL_DRIVER to choose between gl, gles1 or gles2.

The #ifdefs for HAVE_COGL_GL, HAVE_COGL_GLES and HAVE_COGL_GLES2 have
been changed so that they don't assume the ifdefs are mutually
exclusive. They haven't been removed entirely so that it's possible to
compile the GLES backends without the the enums from the GL headers.

When using GLX the winsys additionally dynamically loads libGL because
that also contains the GLX API. It can't be linked in directly because
that would probably conflict with the GLES API if the EGL is
selected. When compiling with EGL support the library links directly
to libEGL because it doesn't contain any GL API so it shouldn't have
any conflicts.

When building for WGL or OSX Cogl still directly links against the GL
API so there is a #define in config.h so that Cogl won't try to dlopen
the library.

Cogl-pango previously had a #ifdef to detect when the GL backend is
used so that it can sneakily pass GL_QUADS to
cogl_vertex_buffer_draw. This is now changed so that it queries the
CoglContext for the backend. However to get this to work Cogl now
needs to export the _cogl_context_get_default symbol and cogl-pango
needs some extra -I flags to so that it can include
cogl-context-private.h
2011-07-11 12:57:38 +01:00
Robert Bragg
3729bf2769 Make it clearer that the 2.0 API is experimental
This explicitly renames the cogl-2.0 reference manual to
cogl-2.0-experimental and renames the cogl-2.0 pkg-config file to
cogl-2.0-experimental.pc. Hopefully this should avoid
miss-understandings.
2011-06-14 17:09:55 +01:00
Neil Roberts
db954565d4 cogl-pango-render: Use the glyph size for unknown glyphs
When rendering a box for an unknown glyph it would previously just use
the average glyph size for the font. This causes problems because the
size calculations for the layout assume a different size so it can end
up rendering outside of the expected ink rectangle. This patch changes
it to query the size of the glyph in the font. Pango should end up
reporting the size of what would be the hex box which should be the
same as the sized used for the extents calculation.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2599
2011-06-10 14:03:50 +01:00
Emmanuele Bassi
c56d5436d0 Fix introspection annotations for CoglPango 2011-06-09 16:19:44 +01:00
Robert Bragg
f23a387359 pango: ensure g-ir-compiler can find Cogl-1.0.gir
This uses INTROSPECTION_COMPILER_ARGS to pass
--includedir=$(top_builddir)/cogl so when building the CoglPango typelib
the compiler can find the required Cogl-1.0.gir file.
2011-05-16 17:33:17 +01:00
Robert Bragg
b316241612 deprecate #include <cogl/cogl-pango.h>
cogl-pango is conceptually a separate library so it doesn't seem
appropriate to bundle the headers with all the other cogl headers. Also
in-tree the headers live in a cogl-pango directory so if we want
examples that can include cogl-pango consistently when built in or out
of tree using the convention #include <cogl-pango/cogl-pango.h> makes
that easy.

This adds a compatibility cogl/cogl-pango.h header that's will redirect
to cogl-pango/cogl-pango.h with a warning, or result in an error if
COGL_ENABLE_EXPERIMENTAL_2_0_API is defined.
2011-05-16 13:28:17 +01:00
Neil Roberts
d093c1b389 cogl-pango-render: Add the atlas reorg callback to the right cache
When creating a new display list the pango renderer tries to add a
callback to the glyph cache so that it can be notified whenever the
atlas is reorganized. However it was always registering the callback
for the glyph cache which doesn't use mipmapping so if mipmapping is
enabled then it wouldn't work correctly.

This patch moves the two sets of caches (pipeline cache and glyph
cache) into one struct so that it's a little bit easier to determine
which pair to use in the code.
2011-05-06 18:37:59 +01:00
Neil Roberts
0bd87220b3 cogl-pango/Makefile.am: Add $(top_builddir) to INCLUDES
Some of the sources need to include <cogl/cogl-defines.h> which is in
the build directory. I think this directory gets added to the include
flags anyway by something so the actual building works but when
building the introspection data out of tree it was not included so it
failed to scan.
2011-05-06 18:37:59 +01:00
Emmanuele Bassi
0d5b38c8bf build: Don't make cogl-pango-1.0 depend on cogl-2.0 2011-05-06 17:34:57 +01:00
Emmanuele Bassi
5c131e61e5 build: Generate CoglPango introspection data 2011-05-06 17:34:57 +01:00
Robert Bragg
8b4ee0964b Remove all the options for building cogl standalone
This removes all the remnants from being able to build Cogl standalone
while it was part of the Clutter repository. Now that Cogl has been
split out then standalone builds are the only option.
2011-05-06 12:36:39 +01:00
Robert Bragg
6f2193545e consistently refer to cogl-pango as "cogl-pango"
This renames the pango directory to cogl-pango and it renames the
installed library to libcogl-pango instead of libcoglpango.
2011-05-06 12:12:08 +01:00