- // Retrieve info
-
- XVisualInfo vinfo_template;
- XVisualInfo *vi;
-
- vinfo_template.visual = xvisual;
- vinfo_template.visualid = XVisualIDFromVisual( xvisual );
- vinfo_template.depth = bpp;
- int nitem = 0;
-
- vi = XGetVisualInfo( xdisplay, VisualIDMask|VisualDepthMask, &vinfo_template, &nitem );
- wxASSERT_MSG( vi, wxT("No visual info") );
-
- int red_prec,green_prec,blue_prec;
- int red_shift,green_shift,blue_shift;
- wxCalcPrecAndShift( vi->red_mask, &red_shift, &red_prec );
- wxCalcPrecAndShift( vi->green_mask, &green_shift, &green_prec );
- wxCalcPrecAndShift( vi->blue_mask, &blue_shift, &blue_prec );
- if (bpp == 16) bpp = red_prec + green_prec + blue_prec;
-
- red_shift_right = red_shift;
- red_shift_left = 8-red_prec;
- green_shift_right = green_shift;
- green_shift_left = 8-green_prec;
- blue_shift_right = blue_shift;
- blue_shift_left = 8-blue_prec;
+ red_shift_right = wxTheApp->m_visualRedShift;
+ red_shift_left = 8-wxTheApp->m_visualRedPrec;
+ green_shift_right = wxTheApp->m_visualGreenShift;
+ green_shift_left = 8-wxTheApp->m_visualGreenPrec;
+ blue_shift_right = wxTheApp->m_visualBlueShift;
+ blue_shift_left = 8-wxTheApp->m_visualBluePrec;