- switch ( depth )
- {
- case -1:
- wxASSERT_MSG( g_displayDC, wxT("MGL display DC not created yet.") );
-
- g_displayDC->getPixelFormat(pf_dummy);
- mglDepth = g_displayDC->getBitsPerPixel();
- pf = &pf_dummy;
- break;
- case 1:
- case 8:
- pf = NULL;
- break;
- case 15:
- pf = &gs_pixel_format_15;
- break;
- case 16:
- pf = &gs_pixel_format_16;
- break;
- case 24:
- pf = &gs_pixel_format_24;
- break;
- case 32:
- pf = &gs_pixel_format_32;
- break;
- default:
- wxASSERT_MSG( 0, wxT("invalid bitmap depth") );
- return false;
- }
-
- m_refData = new wxBitmapRefData();
- M_BMPDATA->m_mask = (wxMask *) NULL;
- M_BMPDATA->m_palette = (wxPalette *) NULL;
- M_BMPDATA->m_width = width;
- M_BMPDATA->m_height = height;
- M_BMPDATA->m_bpp = mglDepth;
-
- if ( mglDepth != 1 )
- {
- M_BMPDATA->m_bitmap = MyMGL_createBitmap(width, height, mglDepth, pf);
- }
- else