Skip to main content
gamedev.net
🔒 Locked

CreateDevice Failed

Started by a_insomniac Apr 10, 2002 at 10:12 AM 2 replies 8k views
Original Post
a_insomniac
a_insomniac
I have been working on some D3D code using DX8 and one thing in particular has me at a lost. When I run the program it crashes and below is the error message I get. //****************ERROR MESSAGE*********************** Direct3D8: (INFO) :======================= Hal SWVP device selected Direct3D8: (ERROR) :The specified mode is unsupported. CreateDevice/Reset Fails Direct3D8: (ERROR) :Failed to initialize Framework Device. CreateDevice Failed. ERROR: Could not create the render device ERROR: Initialization of the device failed ERROR: Initialization Failed First-chance exception in 041002sprite.exe: 0xC0000005: Access Violation. //***************************************************** Here is my question: Is this error caused by the video card not being able to handle what is being rendered or does it seem to be code related? I hope Im making sense, I will try and elaborate more if needed. Thanks in Advance A_INSOMNIAC If my compiler was voice activated with the voice of my mother-in-law....there would be no errors!
----------
 
S1CA
S1CA
It''s code related *AND* device related...

1) you asked for a screen mode/device format/depth format which the hardware didn''t support. For example many chips can''t use D3DFMT_R8G8B8 as a backbuffer format (most preferring D3DFMT_X8R8G8B8).

2) since you asked for something which isn''t supported without first checking to see whether the hardware supported it (CheckDeviceFormat, CheckDeviceType, CheckDepthStencilMatch, GetDeviceCaps etc), then your code is technically at fault.
PCs come in so many different shapes, sizes and flavours that programatically checking for support before trying to create something is vital!

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com
Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site
a_insomniac
a_insomniac
Hey thanks for the tips..... what I find odd is that this is code directly from the book Im learning with and none of those checks are in place..... Damn... It is making me rethink this book now.



a_insomniac
----------
 
S1CA
S1CA
Many tutorials and books are looking to teach you the essence of the interesting stuff - and aim to get you up and running as quickly as possible - for that reason, most leave off things like error checking etc as an excercise for the reader.
The book should however mention the importance in the text somewhere...


It''s the same with the DirectX SDK - the tutorials perform no in-depth checks whereas the full sample framework does provide much more complete checking.

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com
Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.