G_BEGIN_DECLS
typedef enum {
- COGL_DEBUG_MISC = 1 << 0,
- COGL_DEBUG_TEXTURE = 1 << 1,
- COGL_DEBUG_MATERIAL = 1 << 2,
- COGL_DEBUG_SHADER = 1 << 3,
- COGL_DEBUG_OFFSCREEN = 1 << 4,
- COGL_DEBUG_DRAW = 1 << 5,
- COGL_DEBUG_PANGO = 1 << 6
+ COGL_DEBUG_MISC = 1 << 0,
+ COGL_DEBUG_TEXTURE = 1 << 1,
+ COGL_DEBUG_MATERIAL = 1 << 2,
+ COGL_DEBUG_SHADER = 1 << 3,
+ COGL_DEBUG_OFFSCREEN = 1 << 4,
+ COGL_DEBUG_DRAW = 1 << 5,
+ COGL_DEBUG_PANGO = 1 << 6,
+ COGL_DEBUG_RECTANGLES = 1 << 7
} CoglDebugFlags;
#ifdef COGL_ENABLE_DEBUG
{ "shader", COGL_DEBUG_SHADER },
{ "offscreen", COGL_DEBUG_OFFSCREEN },
{ "draw", COGL_DEBUG_DRAW },
- { "pango", COGL_DEBUG_PANGO }
+ { "pango", COGL_DEBUG_PANGO },
+ { "rectangles", COGL_DEBUG_RECTANGLES }
};
static const gint n_cogl_debug_keys = G_N_ELEMENTS (cogl_debug_keys);
/* DEBUGGING CODE XXX:
- * Uncommenting this will cause all rectangles to be drawn with a red, green
+ * This path will cause all rectangles to be drawn with a red, green
* or blue outline with no blending. This may e.g. help with debugging
* texture slicing issues or blending issues, plus it looks quite cool.
*/
-#if 0
+ if (cogl_debug_flags & COGL_DEBUG_RECTANGLES)
{
static CoglHandle outline = COGL_INVALID_HANDLE;
static int color = 0;
outline = cogl_material_new ();
cogl_enable (COGL_ENABLE_VERTEX_ARRAY);
- for (i = 0; i < batch_len; i++, color = (++color) % 3)
+ for (i = 0; i < batch_len; i++, color = (color + 1) % 3)
{
cogl_material_set_color4ub (outline,
color == 0 ? 0xff : 0x00,
GE( glDrawArrays (GL_LINE_LOOP, 4 * i, 4) );
}
}
-#endif
}
void