XM Magdalena 3D print, GGeorgy (3D)
LC #42 Pipers Alley

View Full Version : DirectX - CreateDevice

02-08-2007, 03:02 PM

I'm trying to create a device (using c# 2003 on .Net 1.1) by using the statement;

sampleFramework.CreateDevice(0,true,Framework.Defa ultSizeWidth, Framework.DefaultSizeHeight, gameEngine);

and then got the following error message box:Could not find any compatible Direct3D devices.

The example is from the book: Beginning 3D game programming by Tom Miller but when I run the game code off the CD, I don't get this error message.

Does anyone know what's wrong? I can't understand why it can't find a compatible device, yet the original code can.


02-27-2007, 01:01 AM

sampleFramework.CreateDevice(0,true,Framework.Defa ultSizeWidth, Framework.DefaultSizeHeight, gameEngine);

Maybe the space in "Defa ultSizeWidth" if its not a typo error on the forum... else i cant help you except if you explain more how the function sampleFramework.CreateDevice take is adapter, device type, render window etc...

usually, createdevice look like :
Direct3D.Device(0, Direct3D.DeviceType.Hardware, m_renderWindow, CreateFlags.SoftwareVertexProcessing, m_presentParams);

02-27-2007, 03:07 PM
Atheist (http://forums.cgsociety.org/member.php?u=160317)
Thanks for the reply, but I found the problem.

When I enumerated through the available graphics devices, I misplaced a NOT sign within the if statement which returns the available devices. Therefore, when I did found a compatible device, my if statement ignored the device and gave me the error message.

It's always the small mistakes, which breakes the program properly!

Thanks once again,

CGTalk Moderation
02-27-2007, 03:07 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.