- M_BMPDATA->m_display = wxGlobalDisplay();
-
- wxASSERT_MSG( M_BMPDATA->m_display, wxT("No display") );
-
- int xscreen = DefaultScreen( (Display*) M_BMPDATA->m_display );
- Window xroot = RootWindow( (Display*) M_BMPDATA->m_display, xscreen );
-
- int bpp = DefaultDepth( (Display*) M_BMPDATA->m_display, xscreen );
- if (depth == -1) depth = bpp;
-
- wxCHECK_MSG( (depth == bpp) ||
- (depth == 1), FALSE, wxT("invalid bitmap depth") )
-
- M_BMPDATA->m_mask = (wxMask *) NULL;
- M_BMPDATA->m_width = width;
- M_BMPDATA->m_height = height;
-
-#if wxUSE_NANOX
- M_BMPDATA->m_pixmap = (WXPixmap) GrNewPixmap(width, height, NULL);
- M_BMPDATA->m_bpp = bpp;
-
- wxASSERT_MSG( M_BMPDATA->m_pixmap, wxT("Bitmap creation failed") );
-#else
- if (depth == 1)
- {
- M_BMPDATA->m_bitmap = (WXPixmap) XCreatePixmap( (Display*) M_BMPDATA->m_display, xroot, width, height, 1 );
-
- wxASSERT_MSG( M_BMPDATA->m_bitmap, wxT("Bitmap creation failed") );
-
- M_BMPDATA->m_bpp = 1;
- }
- else
- {
- M_BMPDATA->m_pixmap = (WXPixmap) XCreatePixmap( (Display*) M_BMPDATA->m_display, xroot, width, height, depth );
-
- wxASSERT_MSG( M_BMPDATA->m_pixmap, wxT("Pixmap creation failed") );
-
- M_BMPDATA->m_bpp = depth;
- }
-#endif
- return Ok();