Пример #1
0
static void
texture_tower_create_texture (MetaTextureTower *tower,
                              int               level,
                              int               width,
                              int               height)
{
  if ((!is_power_of_two (width) || !is_power_of_two (height)) &&
      meta_texture_rectangle_check (tower->textures[level - 1]))
    {
      ClutterBackend *backend = clutter_get_default_backend ();
      CoglContext *context = clutter_backend_get_cogl_context (backend);

      tower->textures[level] = cogl_texture_rectangle_new_with_size (context, width, height);
    }
  else
    {
      tower->textures[level] = cogl_texture_new_with_size (width, height,
                                                           COGL_TEXTURE_NO_AUTO_MIPMAP,
                                                           TEXTURE_FORMAT);
    }

  tower->invalid[level].x1 = 0;
  tower->invalid[level].y1 = 0;
  tower->invalid[level].x2 = width;
  tower->invalid[level].y2 = height;
}
Пример #2
0
static void
texture_tower_create_texture (MetaTextureTower *tower,
                              int               level,
                              int               width,
                              int               height)
{
  if ((!is_power_of_two (width) || !is_power_of_two (height)) &&
      meta_texture_rectangle_check (tower->textures[level - 1]))
    {
      tower->textures[level] =
        meta_texture_rectangle_new (width, height,
                                    /* data format */
                                    TEXTURE_FORMAT,
                                    /* rowstride */
                                    width * 4,
                                    /* data */
                                    NULL);
    }
  else
    {
      tower->textures[level] = cogl_texture_new_with_size (width, height,
                                                           COGL_TEXTURE_NO_AUTO_MIPMAP,
                                                           TEXTURE_FORMAT);
    }

  tower->invalid[level].x1 = 0;
  tower->invalid[level].y1 = 0;
  tower->invalid[level].x2 = width;
  tower->invalid[level].y2 = height;
}