예제 #1
0
static void menu_display_d3d_draw_bg(
      unsigned width,
      unsigned height,
      uintptr_t texture,
      float handle_alpha,
      bool force_transparency,
      float *coord_color,
      float *coord_color2,
      const float *vertex,
      const float *tex_coord,
      size_t vertex_count,
      enum menu_display_prim_type prim_type)
{
   struct gfx_coords coords;
   const float *new_vertex    = NULL;
   const float *new_tex_coord = NULL;
   global_t     *global = global_get_ptr();
   settings_t *settings = config_get_ptr();
   d3d_video_t *d3d = (d3d_video_t*)video_driver_get_ptr(NULL);

   if (!d3d)
      return;

   new_vertex    = vertex;
   new_tex_coord = tex_coord;

   if (!new_vertex)
      new_vertex = &d3d_vertexes[0];
   if (!new_tex_coord)
      new_tex_coord = &d3d_tex_coords[0];

   coords.vertices      = vertex_count;
   coords.vertex        = new_vertex;
   coords.tex_coord     = new_tex_coord;
   coords.lut_tex_coord = new_tex_coord;
   coords.color         = (const float*)coord_color;

   menu_display_d3d_blend_begin();

   menu_display_ctl(MENU_DISPLAY_CTL_SET_VIEWPORT, NULL);

   if ((settings->menu.pause_libretro
      || !global->inited.main || (global->inited.core.type == CORE_TYPE_DUMMY))
      && !force_transparency
      && texture)
      coords.color = (const float*)coord_color2;

   menu_display_d3d_draw(0, 0, width, height,
         &coords, (math_matrix_4x4*)menu_display_d3d_get_default_mvp(),
         (uintptr_t)texture, prim_type);

   menu_display_d3d_blend_end();

#if 0
   gl->coords.color = gl->white_color_ptr;
#endif
}
예제 #2
0
static void menu_display_d3d_draw_bg(void *data)
{
   struct gfx_coords coords;
   const float    *new_vertex    = NULL;
   const float    *new_tex_coord = NULL;
   global_t              *global = global_get_ptr();
   settings_t          *settings = config_get_ptr();
   d3d_video_t              *d3d = d3d_get_ptr();
   menu_display_ctx_draw_t *draw = (menu_display_ctx_draw_t*)data;

   if (!d3d || !draw)
      return;

   (void)coords;

   new_vertex    = draw->vertex;
   new_tex_coord = draw->tex_coord;

   if (!new_vertex)
      new_vertex = &d3d_vertexes[0];
   if (!new_tex_coord)
      new_tex_coord = &d3d_tex_coords[0];

   coords.vertices      = draw->vertex_count;
   coords.vertex        = new_vertex;
   coords.tex_coord     = new_tex_coord;
   coords.lut_tex_coord = new_tex_coord;
   coords.color         = (const float*)draw->color;

   menu_display_d3d_blend_begin();

   menu_display_ctl(MENU_DISPLAY_CTL_SET_VIEWPORT, NULL);

   if (
         (   settings->menu.pause_libretro
          || !rarch_ctl(RARCH_CTL_IS_INITED, NULL) 
          || rarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL)
         )
      && !draw->force_transparency && draw->texture)
      coords.color = (const float*)draw->color2;

   draw->x           = 0;
   draw->y           = 0;
   draw->matrix_data = (math_matrix_4x4*)
      menu_display_d3d_get_default_mvp();

   menu_display_d3d_draw(draw);

   menu_display_d3d_blend_end();

#if 0
   gl->coords.color = gl->white_color_ptr;
#endif
}