2008-11-28 17:36:37 +00:00
|
|
|
|
|
|
|
#include <clutter/clutter.h>
|
|
|
|
#include <cogl/cogl.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "test-conform-common.h"
|
|
|
|
|
2008-11-28 17:45:54 +00:00
|
|
|
#ifdef CLUTTER_COGL_HAS_GL
|
|
|
|
|
2008-11-28 17:36:37 +00:00
|
|
|
/* Size the texture so that it is just off a power of two to enourage
|
|
|
|
it so use software tiling when NPOTs aren't available */
|
[cogl] Remove max_waste argument from Texture ctors
The CoglTexture constructors expose the "max-waste" argument for
controlling the maximum amount of wasted areas for slicing or,
if set to -1, disables slicing.
Slicing is really relevant only for large images that are never
repeated, so it's a useful feature only in controlled use cases.
Specifying the amount of wasted area is, on the other hand, just
a way to mess up this feature; 99% the times, you either pull this
number out of thin air, hoping it's right, or you try to do the
right thing and you choose the wrong number anyway.
Instead, we can use the CoglTextureFlags to control whether the
texture should not be sliced (useful for Clutter-GST and for the
texture-from-pixmap actors) and provide a reasonable value for
enabling the slicing ourself. At some point, we might even
provide a way to change the default at compile time or at run time,
for particular platforms.
Since max_waste is gone, the :tile-waste property of ClutterTexture
becomes read-only, and it proxies the cogl_texture_get_max_waste()
function.
Inside Clutter, the only cases where the max_waste argument was
not set to -1 are in the Pango glyph cache (which is a POT texture
anyway) and inside the test cases where we want to force slicing;
for the latter we can create larger textures that will be bigger than
the threshold we set.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Signed-off-by: Robert Bragg <robert@linux.intel.com>
Signed-off-by: Neil Roberts <neil@linux.intel.com>
2009-05-23 18:18:18 +00:00
|
|
|
#define TEXTURE_SIZE 257
|
2008-11-28 17:36:37 +00:00
|
|
|
|
2008-11-28 17:45:54 +00:00
|
|
|
#else /* CLUTTER_COGL_HAS_GL */
|
|
|
|
|
|
|
|
/* We can't use the funny-sized texture on GL ES because it will break
|
|
|
|
cogl_texture_polygon. However there is only one code path for
|
|
|
|
rendering quads so there is no need */
|
[cogl] Remove max_waste argument from Texture ctors
The CoglTexture constructors expose the "max-waste" argument for
controlling the maximum amount of wasted areas for slicing or,
if set to -1, disables slicing.
Slicing is really relevant only for large images that are never
repeated, so it's a useful feature only in controlled use cases.
Specifying the amount of wasted area is, on the other hand, just
a way to mess up this feature; 99% the times, you either pull this
number out of thin air, hoping it's right, or you try to do the
right thing and you choose the wrong number anyway.
Instead, we can use the CoglTextureFlags to control whether the
texture should not be sliced (useful for Clutter-GST and for the
texture-from-pixmap actors) and provide a reasonable value for
enabling the slicing ourself. At some point, we might even
provide a way to change the default at compile time or at run time,
for particular platforms.
Since max_waste is gone, the :tile-waste property of ClutterTexture
becomes read-only, and it proxies the cogl_texture_get_max_waste()
function.
Inside Clutter, the only cases where the max_waste argument was
not set to -1 are in the Pango glyph cache (which is a POT texture
anyway) and inside the test cases where we want to force slicing;
for the latter we can create larger textures that will be bigger than
the threshold we set.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Signed-off-by: Robert Bragg <robert@linux.intel.com>
Signed-off-by: Neil Roberts <neil@linux.intel.com>
2009-05-23 18:18:18 +00:00
|
|
|
#define TEXTURE_SIZE 32
|
2008-11-28 17:45:54 +00:00
|
|
|
|
|
|
|
#endif /* CLUTTER_COGL_HAS_GL */
|
|
|
|
|
2008-11-28 17:36:37 +00:00
|
|
|
/* Amount of pixels to skip off the top, bottom, left and right of the
|
|
|
|
texture when reading back the stage */
|
[cogl] Remove max_waste argument from Texture ctors
The CoglTexture constructors expose the "max-waste" argument for
controlling the maximum amount of wasted areas for slicing or,
if set to -1, disables slicing.
Slicing is really relevant only for large images that are never
repeated, so it's a useful feature only in controlled use cases.
Specifying the amount of wasted area is, on the other hand, just
a way to mess up this feature; 99% the times, you either pull this
number out of thin air, hoping it's right, or you try to do the
right thing and you choose the wrong number anyway.
Instead, we can use the CoglTextureFlags to control whether the
texture should not be sliced (useful for Clutter-GST and for the
texture-from-pixmap actors) and provide a reasonable value for
enabling the slicing ourself. At some point, we might even
provide a way to change the default at compile time or at run time,
for particular platforms.
Since max_waste is gone, the :tile-waste property of ClutterTexture
becomes read-only, and it proxies the cogl_texture_get_max_waste()
function.
Inside Clutter, the only cases where the max_waste argument was
not set to -1 are in the Pango glyph cache (which is a POT texture
anyway) and inside the test cases where we want to force slicing;
for the latter we can create larger textures that will be bigger than
the threshold we set.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Signed-off-by: Robert Bragg <robert@linux.intel.com>
Signed-off-by: Neil Roberts <neil@linux.intel.com>
2009-05-23 18:18:18 +00:00
|
|
|
#define TEST_INSET 4
|
|
|
|
|
|
|
|
/* Size to actually render the texture at */
|
|
|
|
#define TEXTURE_RENDER_SIZE 32
|
2008-11-28 17:36:37 +00:00
|
|
|
|
|
|
|
typedef struct _TestState
|
|
|
|
{
|
|
|
|
CoglHandle texture;
|
2009-10-22 18:01:27 +00:00
|
|
|
CoglHandle offscreen;
|
|
|
|
CoglHandle offscreen_tex;
|
2008-11-28 17:36:37 +00:00
|
|
|
} TestState;
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
validate_part (int xnum, int ynum, gboolean shown)
|
|
|
|
{
|
|
|
|
guchar *pixels, *p;
|
|
|
|
gboolean ret = TRUE;
|
|
|
|
|
2009-10-22 18:01:27 +00:00
|
|
|
pixels = g_malloc0 ((TEXTURE_RENDER_SIZE - TEST_INSET * 2)
|
|
|
|
* (TEXTURE_RENDER_SIZE - TEST_INSET * 2) * 4);
|
|
|
|
|
2008-11-28 17:36:37 +00:00
|
|
|
/* Read the appropriate part but skip out a few pixels around the
|
|
|
|
edges */
|
2009-10-22 18:01:27 +00:00
|
|
|
cogl_read_pixels (xnum * TEXTURE_RENDER_SIZE + TEST_INSET,
|
|
|
|
ynum * TEXTURE_RENDER_SIZE + TEST_INSET,
|
|
|
|
TEXTURE_RENDER_SIZE - TEST_INSET * 2,
|
|
|
|
TEXTURE_RENDER_SIZE - TEST_INSET * 2,
|
|
|
|
COGL_READ_PIXELS_COLOR_BUFFER,
|
2010-03-01 18:08:41 +00:00
|
|
|
COGL_PIXEL_FORMAT_RGBA_8888_PRE,
|
2009-10-22 18:01:27 +00:00
|
|
|
pixels);
|
2008-11-28 17:36:37 +00:00
|
|
|
|
|
|
|
/* Make sure every pixels is the appropriate color */
|
|
|
|
for (p = pixels;
|
[cogl] Remove max_waste argument from Texture ctors
The CoglTexture constructors expose the "max-waste" argument for
controlling the maximum amount of wasted areas for slicing or,
if set to -1, disables slicing.
Slicing is really relevant only for large images that are never
repeated, so it's a useful feature only in controlled use cases.
Specifying the amount of wasted area is, on the other hand, just
a way to mess up this feature; 99% the times, you either pull this
number out of thin air, hoping it's right, or you try to do the
right thing and you choose the wrong number anyway.
Instead, we can use the CoglTextureFlags to control whether the
texture should not be sliced (useful for Clutter-GST and for the
texture-from-pixmap actors) and provide a reasonable value for
enabling the slicing ourself. At some point, we might even
provide a way to change the default at compile time or at run time,
for particular platforms.
Since max_waste is gone, the :tile-waste property of ClutterTexture
becomes read-only, and it proxies the cogl_texture_get_max_waste()
function.
Inside Clutter, the only cases where the max_waste argument was
not set to -1 are in the Pango glyph cache (which is a POT texture
anyway) and inside the test cases where we want to force slicing;
for the latter we can create larger textures that will be bigger than
the threshold we set.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Signed-off-by: Robert Bragg <robert@linux.intel.com>
Signed-off-by: Neil Roberts <neil@linux.intel.com>
2009-05-23 18:18:18 +00:00
|
|
|
p < pixels + ((TEXTURE_RENDER_SIZE - TEST_INSET * 2)
|
|
|
|
* (TEXTURE_RENDER_SIZE - TEST_INSET * 2));
|
2008-11-28 17:36:37 +00:00
|
|
|
p += 4)
|
|
|
|
{
|
|
|
|
if (p[0] != (shown ? 255 : 0))
|
|
|
|
ret = FALSE;
|
|
|
|
if (p[1] != 0)
|
|
|
|
ret = FALSE;
|
|
|
|
if (p[2] != 0)
|
|
|
|
ret = FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_free (pixels);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2009-10-22 18:01:27 +00:00
|
|
|
do_test_backface_culling (TestState *state)
|
2008-11-28 17:36:37 +00:00
|
|
|
{
|
|
|
|
int i;
|
2009-06-04 15:04:57 +00:00
|
|
|
CoglHandle material = cogl_material_new ();
|
|
|
|
|
|
|
|
cogl_material_set_layer_filters (material, 0,
|
|
|
|
COGL_MATERIAL_FILTER_NEAREST,
|
|
|
|
COGL_MATERIAL_FILTER_NEAREST);
|
2008-11-28 17:36:37 +00:00
|
|
|
|
2009-05-26 15:55:11 +00:00
|
|
|
cogl_set_backface_culling_enabled (TRUE);
|
2008-11-28 17:36:37 +00:00
|
|
|
|
|
|
|
cogl_push_matrix ();
|
|
|
|
|
|
|
|
/* Render the scene twice - once with backface culling enabled and
|
|
|
|
once without. The second time is translated so that it is below
|
|
|
|
the first */
|
|
|
|
for (i = 0; i < 2; i++)
|
|
|
|
{
|
[cogl] Remove max_waste argument from Texture ctors
The CoglTexture constructors expose the "max-waste" argument for
controlling the maximum amount of wasted areas for slicing or,
if set to -1, disables slicing.
Slicing is really relevant only for large images that are never
repeated, so it's a useful feature only in controlled use cases.
Specifying the amount of wasted area is, on the other hand, just
a way to mess up this feature; 99% the times, you either pull this
number out of thin air, hoping it's right, or you try to do the
right thing and you choose the wrong number anyway.
Instead, we can use the CoglTextureFlags to control whether the
texture should not be sliced (useful for Clutter-GST and for the
texture-from-pixmap actors) and provide a reasonable value for
enabling the slicing ourself. At some point, we might even
provide a way to change the default at compile time or at run time,
for particular platforms.
Since max_waste is gone, the :tile-waste property of ClutterTexture
becomes read-only, and it proxies the cogl_texture_get_max_waste()
function.
Inside Clutter, the only cases where the max_waste argument was
not set to -1 are in the Pango glyph cache (which is a POT texture
anyway) and inside the test cases where we want to force slicing;
for the latter we can create larger textures that will be bigger than
the threshold we set.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Signed-off-by: Robert Bragg <robert@linux.intel.com>
Signed-off-by: Neil Roberts <neil@linux.intel.com>
2009-05-23 18:18:18 +00:00
|
|
|
float x1 = 0, x2, y1 = 0, y2 = (float)(TEXTURE_RENDER_SIZE);
|
2008-11-28 17:36:37 +00:00
|
|
|
CoglTextureVertex verts[4];
|
|
|
|
|
2009-06-04 15:04:57 +00:00
|
|
|
cogl_set_source (material);
|
2008-11-28 17:36:37 +00:00
|
|
|
|
2009-06-04 15:04:57 +00:00
|
|
|
memset (verts, 0, sizeof (verts));
|
2008-11-28 17:36:37 +00:00
|
|
|
|
[cogl] Remove max_waste argument from Texture ctors
The CoglTexture constructors expose the "max-waste" argument for
controlling the maximum amount of wasted areas for slicing or,
if set to -1, disables slicing.
Slicing is really relevant only for large images that are never
repeated, so it's a useful feature only in controlled use cases.
Specifying the amount of wasted area is, on the other hand, just
a way to mess up this feature; 99% the times, you either pull this
number out of thin air, hoping it's right, or you try to do the
right thing and you choose the wrong number anyway.
Instead, we can use the CoglTextureFlags to control whether the
texture should not be sliced (useful for Clutter-GST and for the
texture-from-pixmap actors) and provide a reasonable value for
enabling the slicing ourself. At some point, we might even
provide a way to change the default at compile time or at run time,
for particular platforms.
Since max_waste is gone, the :tile-waste property of ClutterTexture
becomes read-only, and it proxies the cogl_texture_get_max_waste()
function.
Inside Clutter, the only cases where the max_waste argument was
not set to -1 are in the Pango glyph cache (which is a POT texture
anyway) and inside the test cases where we want to force slicing;
for the latter we can create larger textures that will be bigger than
the threshold we set.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Signed-off-by: Robert Bragg <robert@linux.intel.com>
Signed-off-by: Neil Roberts <neil@linux.intel.com>
2009-05-23 18:18:18 +00:00
|
|
|
x2 = x1 + (float)(TEXTURE_RENDER_SIZE);
|
2008-11-28 17:36:37 +00:00
|
|
|
|
|
|
|
/* Draw a front-facing texture */
|
2009-06-04 15:04:57 +00:00
|
|
|
cogl_material_set_layer (material, 0, state->texture);
|
2009-01-28 14:47:03 +00:00
|
|
|
cogl_rectangle (x1, y1, x2, y2);
|
2008-11-28 17:36:37 +00:00
|
|
|
|
|
|
|
x1 = x2;
|
[cogl] Remove max_waste argument from Texture ctors
The CoglTexture constructors expose the "max-waste" argument for
controlling the maximum amount of wasted areas for slicing or,
if set to -1, disables slicing.
Slicing is really relevant only for large images that are never
repeated, so it's a useful feature only in controlled use cases.
Specifying the amount of wasted area is, on the other hand, just
a way to mess up this feature; 99% the times, you either pull this
number out of thin air, hoping it's right, or you try to do the
right thing and you choose the wrong number anyway.
Instead, we can use the CoglTextureFlags to control whether the
texture should not be sliced (useful for Clutter-GST and for the
texture-from-pixmap actors) and provide a reasonable value for
enabling the slicing ourself. At some point, we might even
provide a way to change the default at compile time or at run time,
for particular platforms.
Since max_waste is gone, the :tile-waste property of ClutterTexture
becomes read-only, and it proxies the cogl_texture_get_max_waste()
function.
Inside Clutter, the only cases where the max_waste argument was
not set to -1 are in the Pango glyph cache (which is a POT texture
anyway) and inside the test cases where we want to force slicing;
for the latter we can create larger textures that will be bigger than
the threshold we set.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Signed-off-by: Robert Bragg <robert@linux.intel.com>
Signed-off-by: Neil Roberts <neil@linux.intel.com>
2009-05-23 18:18:18 +00:00
|
|
|
x2 = x1 + (float)(TEXTURE_RENDER_SIZE);
|
2008-11-28 17:36:37 +00:00
|
|
|
|
2009-09-06 20:47:46 +00:00
|
|
|
/* Draw a front-facing texture with flipped texcoords */
|
|
|
|
cogl_material_set_layer (material, 0, state->texture);
|
|
|
|
cogl_rectangle_with_texture_coords (x1, y1, x2, y2,
|
|
|
|
1.0, 0.0, 0.0, 1.0);
|
|
|
|
|
|
|
|
x1 = x2;
|
|
|
|
x2 = x1 + (float)(TEXTURE_RENDER_SIZE);
|
|
|
|
|
2008-11-28 17:36:37 +00:00
|
|
|
/* Draw a back-facing texture */
|
2009-06-04 15:04:57 +00:00
|
|
|
cogl_material_set_layer (material, 0, state->texture);
|
2009-01-28 14:47:03 +00:00
|
|
|
cogl_rectangle (x2, y1, x1, y2);
|
2008-11-28 17:36:37 +00:00
|
|
|
|
|
|
|
x1 = x2;
|
[cogl] Remove max_waste argument from Texture ctors
The CoglTexture constructors expose the "max-waste" argument for
controlling the maximum amount of wasted areas for slicing or,
if set to -1, disables slicing.
Slicing is really relevant only for large images that are never
repeated, so it's a useful feature only in controlled use cases.
Specifying the amount of wasted area is, on the other hand, just
a way to mess up this feature; 99% the times, you either pull this
number out of thin air, hoping it's right, or you try to do the
right thing and you choose the wrong number anyway.
Instead, we can use the CoglTextureFlags to control whether the
texture should not be sliced (useful for Clutter-GST and for the
texture-from-pixmap actors) and provide a reasonable value for
enabling the slicing ourself. At some point, we might even
provide a way to change the default at compile time or at run time,
for particular platforms.
Since max_waste is gone, the :tile-waste property of ClutterTexture
becomes read-only, and it proxies the cogl_texture_get_max_waste()
function.
Inside Clutter, the only cases where the max_waste argument was
not set to -1 are in the Pango glyph cache (which is a POT texture
anyway) and inside the test cases where we want to force slicing;
for the latter we can create larger textures that will be bigger than
the threshold we set.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Signed-off-by: Robert Bragg <robert@linux.intel.com>
Signed-off-by: Neil Roberts <neil@linux.intel.com>
2009-05-23 18:18:18 +00:00
|
|
|
x2 = x1 + (float)(TEXTURE_RENDER_SIZE);
|
2008-11-28 17:36:37 +00:00
|
|
|
|
|
|
|
/* Draw a front-facing texture polygon */
|
Fully integrates CoglMaterial throughout the rest of Cogl
This glues CoglMaterial in as the fundamental way that Cogl describes how to
fill in geometry.
It adds cogl_set_source (), which is used to set the material which will be
used by all subsequent drawing functions
It adds cogl_set_source_texture as a convenience for setting up a default
material with a single texture layer, and cogl_set_source_color is now also
a convenience for setting up a material with a solid fill.
"drawing functions" include, cogl_rectangle, cogl_texture_rectangle,
cogl_texture_multiple_rectangles, cogl_texture_polygon (though the
cogl_texture_* funcs have been renamed; see below for details),
cogl_path_fill/stroke and cogl_vertex_buffer_draw*.
cogl_texture_rectangle, cogl_texture_multiple_rectangles and
cogl_texture_polygon no longer take a texture handle; instead the current
source material is referenced. The functions have also been renamed to:
cogl_rectangle_with_texture_coords, cogl_rectangles_with_texture_coords
and cogl_polygon respectivly.
Most code that previously did:
cogl_texture_rectangle (tex_handle, x, y,...);
needs to be changed to now do:
cogl_set_source_texture (tex_handle);
cogl_rectangle_with_texture_coords (x, y,....);
In the less likely case where you were blending your source texture with a color
like:
cogl_set_source_color4ub (r,g,b,a); /* where r,g,b,a isn't just white */
cogl_texture_rectangle (tex_handle, x, y,...);
you will need your own material to do that:
mat = cogl_material_new ();
cogl_material_set_color4ub (r,g,b,a);
cogl_material_set_layer (mat, 0, tex_handle));
cogl_set_source_material (mat);
Code that uses the texture coordinates, 0, 0, 1, 1 don't need to use
cog_rectangle_with_texure_coords since these are the coordinates that
cogl_rectangle will use.
For cogl_texture_polygon; as well as dropping the texture handle, the
n_vertices and vertices arguments were transposed for consistency. So
code previously written as:
cogl_texture_polygon (tex_handle, 3, verts, TRUE);
need to be written as:
cogl_set_source_texture (tex_handle);
cogl_polygon (verts, 3, TRUE);
All of the unit tests have been updated to now use the material API and
test-cogl-material has been renamed to test-cogl-multitexture since any
textured quad is now technically a test of CoglMaterial but this test
specifically creates a material with multiple texture layers.
Note: The GLES backend has not been updated yet; that will be done in a
following commit.
2009-01-23 16:15:40 +00:00
|
|
|
verts[0].x = x1; verts[0].y = y2;
|
|
|
|
verts[1].x = x2; verts[1].y = y2;
|
|
|
|
verts[2].x = x2; verts[2].y = y1;
|
|
|
|
verts[3].x = x1; verts[3].y = y1;
|
|
|
|
verts[0].tx = 0; verts[0].ty = 0;
|
2009-01-20 16:20:54 +00:00
|
|
|
verts[1].tx = 1.0; verts[1].ty = 0;
|
|
|
|
verts[2].tx = 1.0; verts[2].ty = 1.0;
|
Fully integrates CoglMaterial throughout the rest of Cogl
This glues CoglMaterial in as the fundamental way that Cogl describes how to
fill in geometry.
It adds cogl_set_source (), which is used to set the material which will be
used by all subsequent drawing functions
It adds cogl_set_source_texture as a convenience for setting up a default
material with a single texture layer, and cogl_set_source_color is now also
a convenience for setting up a material with a solid fill.
"drawing functions" include, cogl_rectangle, cogl_texture_rectangle,
cogl_texture_multiple_rectangles, cogl_texture_polygon (though the
cogl_texture_* funcs have been renamed; see below for details),
cogl_path_fill/stroke and cogl_vertex_buffer_draw*.
cogl_texture_rectangle, cogl_texture_multiple_rectangles and
cogl_texture_polygon no longer take a texture handle; instead the current
source material is referenced. The functions have also been renamed to:
cogl_rectangle_with_texture_coords, cogl_rectangles_with_texture_coords
and cogl_polygon respectivly.
Most code that previously did:
cogl_texture_rectangle (tex_handle, x, y,...);
needs to be changed to now do:
cogl_set_source_texture (tex_handle);
cogl_rectangle_with_texture_coords (x, y,....);
In the less likely case where you were blending your source texture with a color
like:
cogl_set_source_color4ub (r,g,b,a); /* where r,g,b,a isn't just white */
cogl_texture_rectangle (tex_handle, x, y,...);
you will need your own material to do that:
mat = cogl_material_new ();
cogl_material_set_color4ub (r,g,b,a);
cogl_material_set_layer (mat, 0, tex_handle));
cogl_set_source_material (mat);
Code that uses the texture coordinates, 0, 0, 1, 1 don't need to use
cog_rectangle_with_texure_coords since these are the coordinates that
cogl_rectangle will use.
For cogl_texture_polygon; as well as dropping the texture handle, the
n_vertices and vertices arguments were transposed for consistency. So
code previously written as:
cogl_texture_polygon (tex_handle, 3, verts, TRUE);
need to be written as:
cogl_set_source_texture (tex_handle);
cogl_polygon (verts, 3, TRUE);
All of the unit tests have been updated to now use the material API and
test-cogl-material has been renamed to test-cogl-multitexture since any
textured quad is now technically a test of CoglMaterial but this test
specifically creates a material with multiple texture layers.
Note: The GLES backend has not been updated yet; that will be done in a
following commit.
2009-01-23 16:15:40 +00:00
|
|
|
verts[3].tx = 0; verts[3].ty = 1.0;
|
2009-06-04 15:04:57 +00:00
|
|
|
cogl_material_set_layer (material, 0, state->texture);
|
Fully integrates CoglMaterial throughout the rest of Cogl
This glues CoglMaterial in as the fundamental way that Cogl describes how to
fill in geometry.
It adds cogl_set_source (), which is used to set the material which will be
used by all subsequent drawing functions
It adds cogl_set_source_texture as a convenience for setting up a default
material with a single texture layer, and cogl_set_source_color is now also
a convenience for setting up a material with a solid fill.
"drawing functions" include, cogl_rectangle, cogl_texture_rectangle,
cogl_texture_multiple_rectangles, cogl_texture_polygon (though the
cogl_texture_* funcs have been renamed; see below for details),
cogl_path_fill/stroke and cogl_vertex_buffer_draw*.
cogl_texture_rectangle, cogl_texture_multiple_rectangles and
cogl_texture_polygon no longer take a texture handle; instead the current
source material is referenced. The functions have also been renamed to:
cogl_rectangle_with_texture_coords, cogl_rectangles_with_texture_coords
and cogl_polygon respectivly.
Most code that previously did:
cogl_texture_rectangle (tex_handle, x, y,...);
needs to be changed to now do:
cogl_set_source_texture (tex_handle);
cogl_rectangle_with_texture_coords (x, y,....);
In the less likely case where you were blending your source texture with a color
like:
cogl_set_source_color4ub (r,g,b,a); /* where r,g,b,a isn't just white */
cogl_texture_rectangle (tex_handle, x, y,...);
you will need your own material to do that:
mat = cogl_material_new ();
cogl_material_set_color4ub (r,g,b,a);
cogl_material_set_layer (mat, 0, tex_handle));
cogl_set_source_material (mat);
Code that uses the texture coordinates, 0, 0, 1, 1 don't need to use
cog_rectangle_with_texure_coords since these are the coordinates that
cogl_rectangle will use.
For cogl_texture_polygon; as well as dropping the texture handle, the
n_vertices and vertices arguments were transposed for consistency. So
code previously written as:
cogl_texture_polygon (tex_handle, 3, verts, TRUE);
need to be written as:
cogl_set_source_texture (tex_handle);
cogl_polygon (verts, 3, TRUE);
All of the unit tests have been updated to now use the material API and
test-cogl-material has been renamed to test-cogl-multitexture since any
textured quad is now technically a test of CoglMaterial but this test
specifically creates a material with multiple texture layers.
Note: The GLES backend has not been updated yet; that will be done in a
following commit.
2009-01-23 16:15:40 +00:00
|
|
|
cogl_polygon (verts, 4, FALSE);
|
2008-11-28 17:36:37 +00:00
|
|
|
|
|
|
|
x1 = x2;
|
[cogl] Remove max_waste argument from Texture ctors
The CoglTexture constructors expose the "max-waste" argument for
controlling the maximum amount of wasted areas for slicing or,
if set to -1, disables slicing.
Slicing is really relevant only for large images that are never
repeated, so it's a useful feature only in controlled use cases.
Specifying the amount of wasted area is, on the other hand, just
a way to mess up this feature; 99% the times, you either pull this
number out of thin air, hoping it's right, or you try to do the
right thing and you choose the wrong number anyway.
Instead, we can use the CoglTextureFlags to control whether the
texture should not be sliced (useful for Clutter-GST and for the
texture-from-pixmap actors) and provide a reasonable value for
enabling the slicing ourself. At some point, we might even
provide a way to change the default at compile time or at run time,
for particular platforms.
Since max_waste is gone, the :tile-waste property of ClutterTexture
becomes read-only, and it proxies the cogl_texture_get_max_waste()
function.
Inside Clutter, the only cases where the max_waste argument was
not set to -1 are in the Pango glyph cache (which is a POT texture
anyway) and inside the test cases where we want to force slicing;
for the latter we can create larger textures that will be bigger than
the threshold we set.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Signed-off-by: Robert Bragg <robert@linux.intel.com>
Signed-off-by: Neil Roberts <neil@linux.intel.com>
2009-05-23 18:18:18 +00:00
|
|
|
x2 = x1 + (float)(TEXTURE_RENDER_SIZE);
|
2008-11-28 17:36:37 +00:00
|
|
|
|
|
|
|
/* Draw a back-facing texture polygon */
|
Fully integrates CoglMaterial throughout the rest of Cogl
This glues CoglMaterial in as the fundamental way that Cogl describes how to
fill in geometry.
It adds cogl_set_source (), which is used to set the material which will be
used by all subsequent drawing functions
It adds cogl_set_source_texture as a convenience for setting up a default
material with a single texture layer, and cogl_set_source_color is now also
a convenience for setting up a material with a solid fill.
"drawing functions" include, cogl_rectangle, cogl_texture_rectangle,
cogl_texture_multiple_rectangles, cogl_texture_polygon (though the
cogl_texture_* funcs have been renamed; see below for details),
cogl_path_fill/stroke and cogl_vertex_buffer_draw*.
cogl_texture_rectangle, cogl_texture_multiple_rectangles and
cogl_texture_polygon no longer take a texture handle; instead the current
source material is referenced. The functions have also been renamed to:
cogl_rectangle_with_texture_coords, cogl_rectangles_with_texture_coords
and cogl_polygon respectivly.
Most code that previously did:
cogl_texture_rectangle (tex_handle, x, y,...);
needs to be changed to now do:
cogl_set_source_texture (tex_handle);
cogl_rectangle_with_texture_coords (x, y,....);
In the less likely case where you were blending your source texture with a color
like:
cogl_set_source_color4ub (r,g,b,a); /* where r,g,b,a isn't just white */
cogl_texture_rectangle (tex_handle, x, y,...);
you will need your own material to do that:
mat = cogl_material_new ();
cogl_material_set_color4ub (r,g,b,a);
cogl_material_set_layer (mat, 0, tex_handle));
cogl_set_source_material (mat);
Code that uses the texture coordinates, 0, 0, 1, 1 don't need to use
cog_rectangle_with_texure_coords since these are the coordinates that
cogl_rectangle will use.
For cogl_texture_polygon; as well as dropping the texture handle, the
n_vertices and vertices arguments were transposed for consistency. So
code previously written as:
cogl_texture_polygon (tex_handle, 3, verts, TRUE);
need to be written as:
cogl_set_source_texture (tex_handle);
cogl_polygon (verts, 3, TRUE);
All of the unit tests have been updated to now use the material API and
test-cogl-material has been renamed to test-cogl-multitexture since any
textured quad is now technically a test of CoglMaterial but this test
specifically creates a material with multiple texture layers.
Note: The GLES backend has not been updated yet; that will be done in a
following commit.
2009-01-23 16:15:40 +00:00
|
|
|
verts[0].x = x1; verts[0].y = y1;
|
|
|
|
verts[1].x = x2; verts[1].y = y1;
|
|
|
|
verts[2].x = x2; verts[2].y = y2;
|
|
|
|
verts[3].x = x1; verts[3].y = y2;
|
|
|
|
verts[0].tx = 0; verts[0].ty = 0;
|
2009-01-20 16:20:54 +00:00
|
|
|
verts[1].tx = 1.0; verts[1].ty = 0;
|
|
|
|
verts[2].tx = 1.0; verts[2].ty = 1.0;
|
Fully integrates CoglMaterial throughout the rest of Cogl
This glues CoglMaterial in as the fundamental way that Cogl describes how to
fill in geometry.
It adds cogl_set_source (), which is used to set the material which will be
used by all subsequent drawing functions
It adds cogl_set_source_texture as a convenience for setting up a default
material with a single texture layer, and cogl_set_source_color is now also
a convenience for setting up a material with a solid fill.
"drawing functions" include, cogl_rectangle, cogl_texture_rectangle,
cogl_texture_multiple_rectangles, cogl_texture_polygon (though the
cogl_texture_* funcs have been renamed; see below for details),
cogl_path_fill/stroke and cogl_vertex_buffer_draw*.
cogl_texture_rectangle, cogl_texture_multiple_rectangles and
cogl_texture_polygon no longer take a texture handle; instead the current
source material is referenced. The functions have also been renamed to:
cogl_rectangle_with_texture_coords, cogl_rectangles_with_texture_coords
and cogl_polygon respectivly.
Most code that previously did:
cogl_texture_rectangle (tex_handle, x, y,...);
needs to be changed to now do:
cogl_set_source_texture (tex_handle);
cogl_rectangle_with_texture_coords (x, y,....);
In the less likely case where you were blending your source texture with a color
like:
cogl_set_source_color4ub (r,g,b,a); /* where r,g,b,a isn't just white */
cogl_texture_rectangle (tex_handle, x, y,...);
you will need your own material to do that:
mat = cogl_material_new ();
cogl_material_set_color4ub (r,g,b,a);
cogl_material_set_layer (mat, 0, tex_handle));
cogl_set_source_material (mat);
Code that uses the texture coordinates, 0, 0, 1, 1 don't need to use
cog_rectangle_with_texure_coords since these are the coordinates that
cogl_rectangle will use.
For cogl_texture_polygon; as well as dropping the texture handle, the
n_vertices and vertices arguments were transposed for consistency. So
code previously written as:
cogl_texture_polygon (tex_handle, 3, verts, TRUE);
need to be written as:
cogl_set_source_texture (tex_handle);
cogl_polygon (verts, 3, TRUE);
All of the unit tests have been updated to now use the material API and
test-cogl-material has been renamed to test-cogl-multitexture since any
textured quad is now technically a test of CoglMaterial but this test
specifically creates a material with multiple texture layers.
Note: The GLES backend has not been updated yet; that will be done in a
following commit.
2009-01-23 16:15:40 +00:00
|
|
|
verts[3].tx = 0; verts[3].ty = 1.0;
|
2009-06-04 15:04:57 +00:00
|
|
|
cogl_material_set_layer (material, 0, state->texture);
|
Fully integrates CoglMaterial throughout the rest of Cogl
This glues CoglMaterial in as the fundamental way that Cogl describes how to
fill in geometry.
It adds cogl_set_source (), which is used to set the material which will be
used by all subsequent drawing functions
It adds cogl_set_source_texture as a convenience for setting up a default
material with a single texture layer, and cogl_set_source_color is now also
a convenience for setting up a material with a solid fill.
"drawing functions" include, cogl_rectangle, cogl_texture_rectangle,
cogl_texture_multiple_rectangles, cogl_texture_polygon (though the
cogl_texture_* funcs have been renamed; see below for details),
cogl_path_fill/stroke and cogl_vertex_buffer_draw*.
cogl_texture_rectangle, cogl_texture_multiple_rectangles and
cogl_texture_polygon no longer take a texture handle; instead the current
source material is referenced. The functions have also been renamed to:
cogl_rectangle_with_texture_coords, cogl_rectangles_with_texture_coords
and cogl_polygon respectivly.
Most code that previously did:
cogl_texture_rectangle (tex_handle, x, y,...);
needs to be changed to now do:
cogl_set_source_texture (tex_handle);
cogl_rectangle_with_texture_coords (x, y,....);
In the less likely case where you were blending your source texture with a color
like:
cogl_set_source_color4ub (r,g,b,a); /* where r,g,b,a isn't just white */
cogl_texture_rectangle (tex_handle, x, y,...);
you will need your own material to do that:
mat = cogl_material_new ();
cogl_material_set_color4ub (r,g,b,a);
cogl_material_set_layer (mat, 0, tex_handle));
cogl_set_source_material (mat);
Code that uses the texture coordinates, 0, 0, 1, 1 don't need to use
cog_rectangle_with_texure_coords since these are the coordinates that
cogl_rectangle will use.
For cogl_texture_polygon; as well as dropping the texture handle, the
n_vertices and vertices arguments were transposed for consistency. So
code previously written as:
cogl_texture_polygon (tex_handle, 3, verts, TRUE);
need to be written as:
cogl_set_source_texture (tex_handle);
cogl_polygon (verts, 3, TRUE);
All of the unit tests have been updated to now use the material API and
test-cogl-material has been renamed to test-cogl-multitexture since any
textured quad is now technically a test of CoglMaterial but this test
specifically creates a material with multiple texture layers.
Note: The GLES backend has not been updated yet; that will be done in a
following commit.
2009-01-23 16:15:40 +00:00
|
|
|
cogl_polygon (verts, 4, FALSE);
|
2008-11-28 17:36:37 +00:00
|
|
|
|
|
|
|
x1 = x2;
|
[cogl] Remove max_waste argument from Texture ctors
The CoglTexture constructors expose the "max-waste" argument for
controlling the maximum amount of wasted areas for slicing or,
if set to -1, disables slicing.
Slicing is really relevant only for large images that are never
repeated, so it's a useful feature only in controlled use cases.
Specifying the amount of wasted area is, on the other hand, just
a way to mess up this feature; 99% the times, you either pull this
number out of thin air, hoping it's right, or you try to do the
right thing and you choose the wrong number anyway.
Instead, we can use the CoglTextureFlags to control whether the
texture should not be sliced (useful for Clutter-GST and for the
texture-from-pixmap actors) and provide a reasonable value for
enabling the slicing ourself. At some point, we might even
provide a way to change the default at compile time or at run time,
for particular platforms.
Since max_waste is gone, the :tile-waste property of ClutterTexture
becomes read-only, and it proxies the cogl_texture_get_max_waste()
function.
Inside Clutter, the only cases where the max_waste argument was
not set to -1 are in the Pango glyph cache (which is a POT texture
anyway) and inside the test cases where we want to force slicing;
for the latter we can create larger textures that will be bigger than
the threshold we set.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Signed-off-by: Robert Bragg <robert@linux.intel.com>
Signed-off-by: Neil Roberts <neil@linux.intel.com>
2009-05-23 18:18:18 +00:00
|
|
|
x2 = x1 + (float)(TEXTURE_RENDER_SIZE);
|
2008-11-28 17:36:37 +00:00
|
|
|
|
|
|
|
/* Draw a regular rectangle (this should always show) */
|
2009-01-20 16:20:54 +00:00
|
|
|
cogl_set_source_color4f (1.0, 0, 0, 1.0);
|
2009-01-28 14:47:03 +00:00
|
|
|
cogl_rectangle (x1, y1, x2, y2);
|
2008-11-28 17:36:37 +00:00
|
|
|
|
|
|
|
/* The second time round draw beneath the first with backface
|
|
|
|
culling disabled */
|
[cogl] Remove max_waste argument from Texture ctors
The CoglTexture constructors expose the "max-waste" argument for
controlling the maximum amount of wasted areas for slicing or,
if set to -1, disables slicing.
Slicing is really relevant only for large images that are never
repeated, so it's a useful feature only in controlled use cases.
Specifying the amount of wasted area is, on the other hand, just
a way to mess up this feature; 99% the times, you either pull this
number out of thin air, hoping it's right, or you try to do the
right thing and you choose the wrong number anyway.
Instead, we can use the CoglTextureFlags to control whether the
texture should not be sliced (useful for Clutter-GST and for the
texture-from-pixmap actors) and provide a reasonable value for
enabling the slicing ourself. At some point, we might even
provide a way to change the default at compile time or at run time,
for particular platforms.
Since max_waste is gone, the :tile-waste property of ClutterTexture
becomes read-only, and it proxies the cogl_texture_get_max_waste()
function.
Inside Clutter, the only cases where the max_waste argument was
not set to -1 are in the Pango glyph cache (which is a POT texture
anyway) and inside the test cases where we want to force slicing;
for the latter we can create larger textures that will be bigger than
the threshold we set.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Signed-off-by: Robert Bragg <robert@linux.intel.com>
Signed-off-by: Neil Roberts <neil@linux.intel.com>
2009-05-23 18:18:18 +00:00
|
|
|
cogl_translate (0, TEXTURE_RENDER_SIZE, 0);
|
2009-05-26 15:55:11 +00:00
|
|
|
cogl_set_backface_culling_enabled (FALSE);
|
2008-11-28 17:36:37 +00:00
|
|
|
}
|
|
|
|
|
2009-10-22 18:01:27 +00:00
|
|
|
cogl_handle_unref (material);
|
|
|
|
|
2008-11-28 17:36:37 +00:00
|
|
|
cogl_pop_matrix ();
|
|
|
|
|
2009-10-22 18:01:27 +00:00
|
|
|
/* Front-facing texture */
|
|
|
|
g_assert (validate_part (0, 0, TRUE));
|
|
|
|
/* Front-facing texture with flipped tex coords */
|
|
|
|
g_assert (validate_part (1, 0, TRUE));
|
|
|
|
/* Back-facing texture */
|
|
|
|
g_assert (validate_part (2, 0, FALSE));
|
|
|
|
/* Front-facing texture polygon */
|
|
|
|
g_assert (validate_part (3, 0, TRUE));
|
|
|
|
/* Back-facing texture polygon */
|
|
|
|
g_assert (validate_part (4, 0, FALSE));
|
|
|
|
/* Regular rectangle */
|
|
|
|
g_assert (validate_part (5, 0, TRUE));
|
|
|
|
|
|
|
|
/* Backface culling disabled - everything should be shown */
|
|
|
|
|
|
|
|
/* Front-facing texture */
|
|
|
|
g_assert (validate_part (0, 1, TRUE));
|
|
|
|
/* Front-facing texture with flipped tex coords */
|
|
|
|
g_assert (validate_part (1, 1, TRUE));
|
|
|
|
/* Back-facing texture */
|
|
|
|
g_assert (validate_part (2, 1, TRUE));
|
|
|
|
/* Front-facing texture polygon */
|
|
|
|
g_assert (validate_part (3, 1, TRUE));
|
|
|
|
/* Back-facing texture polygon */
|
|
|
|
g_assert (validate_part (4, 1, TRUE));
|
|
|
|
/* Regular rectangle */
|
|
|
|
g_assert (validate_part (5, 1, TRUE));
|
|
|
|
|
|
|
|
}
|
2009-06-04 15:04:57 +00:00
|
|
|
|
2009-10-22 18:01:27 +00:00
|
|
|
static void
|
|
|
|
on_paint (ClutterActor *actor, TestState *state)
|
|
|
|
{
|
|
|
|
CoglColor clr;
|
|
|
|
float stage_viewport[4];
|
|
|
|
CoglMatrix stage_projection;
|
|
|
|
CoglMatrix stage_modelview;
|
|
|
|
|
2010-09-03 15:55:12 +00:00
|
|
|
cogl_color_init_from_4ub (&clr, 0x00, 0x00, 0x00, 0xff);
|
2009-10-22 18:01:27 +00:00
|
|
|
|
|
|
|
do_test_backface_culling (state);
|
|
|
|
|
|
|
|
/* Since we are going to repeat the test rendering offscreen we clear the
|
|
|
|
* stage, just to minimize the chance of a some other bug causing us
|
|
|
|
* mistakenly reading back the results from the stage and giving a false
|
|
|
|
* posistive. */
|
|
|
|
cogl_clear (&clr, COGL_BUFFER_BIT_COLOR|COGL_BUFFER_BIT_STENCIL);
|
|
|
|
|
|
|
|
/*
|
2009-11-26 19:06:35 +00:00
|
|
|
* Now repeat the test but rendered to an offscreen framebuffer...
|
2008-11-28 17:36:37 +00:00
|
|
|
*/
|
2009-10-22 18:01:27 +00:00
|
|
|
|
|
|
|
cogl_get_viewport (stage_viewport);
|
|
|
|
cogl_get_projection_matrix (&stage_projection);
|
|
|
|
cogl_get_modelview_matrix (&stage_modelview);
|
|
|
|
|
2009-11-26 19:06:35 +00:00
|
|
|
cogl_push_framebuffer (state->offscreen);
|
2009-10-22 18:01:27 +00:00
|
|
|
|
|
|
|
cogl_clear (&clr, COGL_BUFFER_BIT_COLOR|COGL_BUFFER_BIT_STENCIL);
|
|
|
|
|
|
|
|
cogl_set_viewport (stage_viewport[0],
|
|
|
|
stage_viewport[1],
|
|
|
|
stage_viewport[2],
|
|
|
|
stage_viewport[3]);
|
|
|
|
cogl_set_projection_matrix (&stage_projection);
|
|
|
|
cogl_set_modelview_matrix (&stage_modelview);
|
|
|
|
|
|
|
|
do_test_backface_culling (state);
|
|
|
|
|
2009-11-26 19:06:35 +00:00
|
|
|
cogl_pop_framebuffer ();
|
2009-10-22 18:01:27 +00:00
|
|
|
|
|
|
|
/* Incase we want feedback of what was drawn offscreen we draw it
|
|
|
|
* to the stage... */
|
|
|
|
cogl_set_source_texture (state->offscreen_tex);
|
|
|
|
cogl_rectangle (0, 0, stage_viewport[2], stage_viewport[3]);
|
|
|
|
|
|
|
|
/* Comment this out if you want visual feedback of what this test
|
|
|
|
* paints.
|
|
|
|
*/
|
|
|
|
clutter_main_quit ();
|
2008-11-28 17:36:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
queue_redraw (gpointer stage)
|
|
|
|
{
|
|
|
|
clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static CoglHandle
|
|
|
|
make_texture (void)
|
|
|
|
{
|
|
|
|
guchar *tex_data, *p;
|
|
|
|
CoglHandle tex;
|
|
|
|
|
|
|
|
tex_data = g_malloc (TEXTURE_SIZE * TEXTURE_SIZE * 4);
|
|
|
|
|
|
|
|
for (p = tex_data + TEXTURE_SIZE * TEXTURE_SIZE * 4; p > tex_data;)
|
|
|
|
{
|
|
|
|
*(--p) = 255;
|
|
|
|
*(--p) = 0;
|
|
|
|
*(--p) = 0;
|
|
|
|
*(--p) = 255;
|
|
|
|
}
|
|
|
|
|
|
|
|
tex = cogl_texture_new_from_data (TEXTURE_SIZE,
|
|
|
|
TEXTURE_SIZE,
|
2009-01-22 16:54:49 +00:00
|
|
|
COGL_TEXTURE_NONE,
|
2008-11-28 17:36:37 +00:00
|
|
|
COGL_PIXEL_FORMAT_RGBA_8888,
|
|
|
|
COGL_PIXEL_FORMAT_ANY,
|
|
|
|
TEXTURE_SIZE * 4,
|
|
|
|
tex_data);
|
|
|
|
|
|
|
|
g_free (tex_data);
|
|
|
|
|
|
|
|
return tex;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2009-11-27 00:28:39 +00:00
|
|
|
test_cogl_backface_culling (TestConformSimpleFixture *fixture,
|
|
|
|
gconstpointer data)
|
2008-11-28 17:36:37 +00:00
|
|
|
{
|
|
|
|
TestState state;
|
2009-10-22 18:01:27 +00:00
|
|
|
CoglHandle tex;
|
2008-11-28 17:36:37 +00:00
|
|
|
ClutterActor *stage;
|
2009-10-22 18:01:27 +00:00
|
|
|
float stage_width;
|
|
|
|
float stage_height;
|
|
|
|
const ClutterColor stage_color = { 0x0, 0x0, 0x0, 0xff };
|
2008-11-28 17:36:37 +00:00
|
|
|
ClutterActor *group;
|
|
|
|
guint idle_source;
|
|
|
|
|
2009-10-22 18:01:27 +00:00
|
|
|
stage = clutter_stage_get_default ();
|
|
|
|
clutter_actor_get_size (stage, &stage_width, &stage_height);
|
|
|
|
|
|
|
|
state.offscreen = COGL_INVALID_HANDLE;
|
2008-11-28 17:36:37 +00:00
|
|
|
|
|
|
|
state.texture = make_texture ();
|
|
|
|
|
2009-10-22 18:01:27 +00:00
|
|
|
tex = cogl_texture_new_with_size (stage_width, stage_height,
|
|
|
|
COGL_TEXTURE_NO_SLICING,
|
|
|
|
COGL_PIXEL_FORMAT_ANY); /* internal fmt */
|
|
|
|
state.offscreen = cogl_offscreen_new_to_texture (tex);
|
|
|
|
state.offscreen_tex = tex;
|
2008-11-28 17:36:37 +00:00
|
|
|
|
|
|
|
clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);
|
|
|
|
|
|
|
|
group = clutter_group_new ();
|
|
|
|
clutter_container_add_actor (CLUTTER_CONTAINER (stage), group);
|
|
|
|
|
|
|
|
/* We force continuous redrawing of the stage, since we need to skip
|
|
|
|
* the first few frames, and we wont be doing anything else that
|
|
|
|
* will trigger redrawing. */
|
|
|
|
idle_source = g_idle_add (queue_redraw, stage);
|
|
|
|
|
|
|
|
g_signal_connect (group, "paint", G_CALLBACK (on_paint), &state);
|
|
|
|
|
|
|
|
clutter_actor_show_all (stage);
|
|
|
|
|
|
|
|
clutter_main ();
|
|
|
|
|
|
|
|
g_source_remove (idle_source);
|
|
|
|
|
2009-10-22 18:01:27 +00:00
|
|
|
cogl_handle_unref (state.offscreen);
|
|
|
|
cogl_handle_unref (state.offscreen_tex);
|
2009-04-01 16:16:44 +00:00
|
|
|
cogl_handle_unref (state.texture);
|
2008-11-28 17:36:37 +00:00
|
|
|
|
|
|
|
if (g_test_verbose ())
|
|
|
|
g_print ("OK\n");
|
|
|
|
}
|
|
|
|
|