Hi all! I have released an experimental package of clutter that includes two additional patches (relatively to the maverick package):
1. debian/patches/remove_cogl_gl_types.patch: This patch removes all references to GL types and defines from the cogl and headers and additionally removes GL headers from cogl-defines.h. The reason for this patch is to ease cross-building of GLES2 clutter apps against libclutter-1.0-dev (instead of requiring libclutter-eglx-es20-1.0-dev). It also makes sense for Cogl (which is supposed to be an abstraction layer) to *not* force any particular GL header inclusion. The side effect of this patch is that applications that need to directly use GL functions, types etc must explicitly include the GL headers of their choice instead of relying on clutter to do this for them. This, of course, breaks some applications (clutk, mutter, gnome-shell to name a few) but the fix is trivial (just a correct GL header inclusion in the application itself). 2. debian/patches/rectangle-texture.patch: This patch exports an API for explicitly creating rectangle textures. It uses code backported from the 1.3 branch plus some additions needed to produce a complete API (eg clutter_texture_rectangle_new_from_file()). The purpose of this patch is to provide a GL-version-independent way for applications to use rectangle textures. This will make applications (eg mutter) GL agnostic and therefore make them more easy to package and use with different GL(ES) versions. Note that upstream is planning on following this approach and explicitly exporting API to create specific texture types. Hopefully, they will implement this soon :) For a simple test of this package (and especially the rectangle texture API) you can use the Cogl Basics example *with* the attached patch. The Cogl Basics examples is at: http://wiki.clutter-project.org/wiki/Cogl/CoglBasicsExample The packaging branch is at: lp:~linaro-user-platforms/ubuntu/maverick/clutter-1.0/clutter-1.0-texture-rectangle and packages are in: https://launchpad.net/~afrantzis/+archive/clutter-1.2 My next steps are to start patching clutk, mutter etc so that: a. They build. b. They make use of the rectangle texture API where needed. Any comments, feedback etc more than welcome :) Thanks, Alexandros
=== modified file 'crate.c' --- old/crate.c 2010-09-09 13:55:23 +0000 +++ new/crate.c 2010-09-09 15:13:20 +0000 @@ -1,3 +1,4 @@ +#include <GL/gl.h> #include <clutter/clutter.h> #include <cogl/cogl-pango.h> @@ -256,10 +257,15 @@ cogl_set_source (data->crate_material); /* Give Cogl some geometry to draw. */ + + /* Cogl doesn't currently support vertex buffers with rectangle textures + cogl_vertex_buffer_draw (data->vbo, COGL_VERTICES_MODE_TRIANGLES, 0, G_N_ELEMENTS (vertices)); + */ + cogl_rectangle(-1.0, 1.0, 1.0, -1.0); cogl_set_depth_test_enabled (FALSE); @@ -425,10 +431,31 @@ &vertices[0].tx); /* Load a jpeg crate texture from a file */ - data.texture = cogl_texture_new_from_file ("crate1.jpg", - COGL_TEXTURE_NO_SLICING, - COGL_PIXEL_FORMAT_ANY, - NULL); + if (cogl_features_available(COGL_FEATURE_TEXTURE_RECTANGLE)) { + g_message("Rectangle texture support is available, using it..."); + data.texture = cogl_texture_rectangle_new_from_file ("crate1.jpg", + COGL_TEXTURE_NO_SLICING, + COGL_PIXEL_FORMAT_ANY, + NULL); + } + else { + g_message("Rectangle texture support is *not* available, using TEXTURE_2D"); + data.texture = cogl_texture_new_from_file ("crate1.jpg", + COGL_TEXTURE_NO_SLICING, + COGL_PIXEL_FORMAT_ANY, + NULL); + } + + { + /* Just to make sure we really get a rectangle texture */ + GLint tex; + GLenum target; + cogl_texture_get_gl_texture(data.texture, &tex, &target); + g_message("Gltex: %u Target: 0x%X (%s)", tex, target, + target == 0x84F5 ? "TEXTURE_RECTANGLE" : + target == 0x0DE1 ? "TEXTURE_2D" : "unknown"); + } + /* a CoglMaterial conceptually describes all the state for vertex * processing, fragment processing and blending geometry. When
_______________________________________________ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev