|
|
|
|
|
|
|
|
#endif |
|
|
#endif |
|
|
{ |
|
|
{ |
|
|
#if !defined(WIN32) && !defined(__APPLE__) |
|
|
#if !defined(WIN32) && !defined(__APPLE__) |
|
|
if (!setupShm()) { |
|
|
|
|
|
|
|
|
if (!setupShm(width, height)) { |
|
|
xim = XCreateImage(fl_display, CopyFromParent, 32, |
|
|
xim = XCreateImage(fl_display, CopyFromParent, 32, |
|
|
ZPixmap, 0, 0, width, height, 32, 0); |
|
|
ZPixmap, 0, 0, width, height, 32, 0); |
|
|
if (!xim) |
|
|
if (!xim) |
|
|
|
|
|
|
|
|
return 0; |
|
|
return 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
bool PlatformPixelBuffer::setupShm() |
|
|
|
|
|
|
|
|
bool PlatformPixelBuffer::setupShm(int width, int height) |
|
|
{ |
|
|
{ |
|
|
int major, minor; |
|
|
int major, minor; |
|
|
Bool pixmaps; |
|
|
Bool pixmaps; |
|
|
|
|
|
|
|
|
shminfo = new XShmSegmentInfo; |
|
|
shminfo = new XShmSegmentInfo; |
|
|
|
|
|
|
|
|
xim = XShmCreateImage(fl_display, CopyFromParent, 32, |
|
|
xim = XShmCreateImage(fl_display, CopyFromParent, 32, |
|
|
ZPixmap, 0, shminfo, width(), height()); |
|
|
|
|
|
|
|
|
ZPixmap, 0, shminfo, width, height); |
|
|
if (!xim) |
|
|
if (!xim) |
|
|
goto free_shminfo; |
|
|
goto free_shminfo; |
|
|
|
|
|
|