This is the mail archive of the cygwin-xfree@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Direct Draw Init Failed - How To Fix!!!


For all of you that get the "Direct Draw Init Failed" message, listen up.
You're problems are entirely due to not overriding the default graphics
settings used by Cygwin/XFree86.  I got poking around in the source code
tonight and uncovered this little treasure:

#define WIN_DEFAULT_WIDTH  1280
#define WIN_DEFAULT_HEIGHT 1024
#define WIN_DEFAULT_DEPTH  16

Hmm... default resolution of 1280x1024 at 16 bits per pixel?  No wonder so
many people get the "Direct Draw Init Failed" message: their graphics card
and monitor combination cannot support 1280x1024x16; not many monitors and
video cards can support that resolution and depth.

Okay, so you've tried to fix the problem by passing different parameters to
'start Xwin' to no avail.  The syntax for the screen resolution and color
depth are like so:

Xwin -screen SCREEN-NUMBER WIDTHxHEIGHTxBITS-PER-PIXEL

The Cygwin/XFree86 tarballs ship with a file 'startxwin.bat' that has the
following line:

start Xwin -screen 8 1024x768x16

Now, you've always seen screen 0 on your UNIX machines, right?  What is
screen 8?  Well, it simply does not exist; you are only running one
X/Server, so your screen number is going to be zero.  Notice that changing
the height, width, and color depth for screen 8 will have no effect on
window sizes/colors; this is because the command line analyzer ignores
screen information for screens that do not exist.

You need to run your X/Server at a resolution that your monitor and video
card can support at 16 bits per pixel.  I say 16bpp because X only uses 16
bits per pixel, and the colors look all funky at 32 bits per pixel.  Let me
suggest one of the two following lines for your 'startxwin.bat' file:

start Xwin -screen 0 1024x768x16                (note screen zero)
start Xwin -screen 0 800x600x16                 (this will work for almost
every monitor and video card out there)

Happy X'ing!

Harold

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]