src/video/x11/SDL_x11modes.c
changeset 10746 95c57a177719
parent 10737 3406a0f8b041
child 10780 4ea5472ed455
equal deleted inserted replaced
10745:7461fcef6ae2 10746:95c57a177719
   462                 mode.driverdata = modedata;
   462                 mode.driverdata = modedata;
   463 
   463 
   464                 displaydata->screen = screen;
   464                 displaydata->screen = screen;
   465                 displaydata->visual = vinfo.visual;
   465                 displaydata->visual = vinfo.visual;
   466                 displaydata->depth = vinfo.depth;
   466                 displaydata->depth = vinfo.depth;
   467                 displaydata->hdpi = ((float) mode.w) * 25.4f / display_mm_width;
   467                 displaydata->hdpi = display_mm_width ? (((float) mode.w) * 25.4f / display_mm_width) : 0.0f;
   468                 displaydata->vdpi = ((float) mode.h) * 25.4f / display_mm_height;
   468                 displaydata->vdpi = display_mm_height ? (((float) mode.h) * 25.4f / display_mm_height) : 0.0f;
   469                 displaydata->ddpi = SDL_ComputeDiagonalDPI(mode.w, mode.h, ((float) display_mm_width) / 25.4f,((float) display_mm_height) / 25.4f);
   469                 displaydata->ddpi = SDL_ComputeDiagonalDPI(mode.w, mode.h, ((float) display_mm_width) / 25.4f,((float) display_mm_height) / 25.4f);
   470                 displaydata->scanline_pad = scanline_pad;
   470                 displaydata->scanline_pad = scanline_pad;
   471                 displaydata->x = display_x;
   471                 displaydata->x = display_x;
   472                 displaydata->y = display_y;
   472                 displaydata->y = display_y;
   473                 displaydata->use_xrandr = 1;
   473                 displaydata->use_xrandr = 1;