From 94e60c393b6be8b69140da01835a377409f6a77b Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Wed, 16 Sep 2009 17:12:30 +0100 Subject: [PATCH] [test-cogl-multitexture] Print an error if textures can't be loaded I just wasted a silly amount time trying to bisect an apparently broken cogl-test-multitexture until I realized it was just silently failing to load any textures. --- tests/interactive/test-cogl-multitexture.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/interactive/test-cogl-multitexture.c b/tests/interactive/test-cogl-multitexture.c index 6d7047845..621a045cf 100644 --- a/tests/interactive/test-cogl-multitexture.c +++ b/tests/interactive/test-cogl-multitexture.c @@ -51,6 +51,7 @@ material_rectangle_paint (ClutterActor *actor, gpointer data) G_MODULE_EXPORT int test_cogl_multitexture_main (int argc, char *argv[]) { + GError *error = NULL; ClutterTimeline *timeline; ClutterBehaviour *r_behave; ClutterActor *stage; @@ -85,17 +86,25 @@ test_cogl_multitexture_main (int argc, char *argv[]) cogl_texture_new_from_file ("redhand_alpha.png", COGL_TEXTURE_NO_SLICING, COGL_PIXEL_FORMAT_ANY, - NULL); + &error); + if (!state->alpha_tex) + g_critical ("Failed to load redhand_alpha.png: %s", error->message); + state->redhand_tex = cogl_texture_new_from_file ("redhand.png", COGL_TEXTURE_NO_SLICING, COGL_PIXEL_FORMAT_ANY, - NULL); + &error); + if (!state->redhand_tex) + g_critical ("Failed to load redhand.png: %s", error->message); + state->light_tex0 = cogl_texture_new_from_file ("light0.png", COGL_TEXTURE_NO_SLICING, COGL_PIXEL_FORMAT_ANY, - NULL); + &error); + if (!state->light_tex0) + g_critical ("Failed to load light0.png: %s", error->message); state->material = cogl_material_new (); cogl_material_set_layer (state->material, 0, state->alpha_tex);