PDA

View Full Version : DirectX - CreateDevice


suriva
02-08-2007, 03:02 PM
Hi,

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.

Thanks,

Atheist
02-27-2007, 01:01 AM
Hi,

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);

suriva
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,
Suriva

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.