Archived

This topic is now archived and is closed to further replies.

CreateDevice not working for me. I need some enlightened information.

This topic is 5815 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Can anyone fill me in on what effects hardware can have on the call to ''CreateDevice''. I am at my whits end trying to get just a basic red pixel to display. I have even tried to run the example that comes with DirectX 8.0 SDK package in \mssdk\samples\Multimedia\Direct3D\Tutorials\Tut01_CreateDevice. The tutorial doesn''t work for me either. I''m to the point where I think it must be hardware related. Can anyone out there shed any light on where I should look. thanks in advance, DMB

Share this post


Link to post
Share on other sites
If you can create a Direct3D8 object, call GetDeviceCaps and/or GetAdapterDisplayMode to retrieve information on the specified adapter and its current configuration. Note that, and then try creating a device with that info.

[ GDNet Start Here | GDNet FAQ | MS RTFM | STL | Google ]
Thanks to Kylotan for the idea!

Share this post


Link to post
Share on other sites
quote:
Original post by TheToad
Can anyone fill me in on what effects hardware can have on the call to ''CreateDevice''. I am at my whits end trying to get just a basic red pixel to display. I have even tried to run the example that comes with DirectX 8.0 SDK package in \mssdk\samples\Multimedia\Direct3D\Tutorials\Tut01_CreateDevice. The tutorial doesn''t work for me either. I''m to the point where I think it must be hardware related. Can anyone out there shed any light on where I should look.

thanks in advance,
DMB


How old is your video hw? Some of the ancient boards out there do not support d3d8 in hw (I had that same problem recently with a virge/gx2 chipset). You may have to stick with sw only rendering (use the D3DDEVTYPE_REF flag). Run dxcapsviewer app and see if the parameters you passed to CreateDevice are compatible w/ the caps given.

Share this post


Link to post
Share on other sites
If your initialisation code looks something like this, and it doesn''t work, you have a problem

  
// Create the D3D Object

if( NULL == ( m_pD3D = Direct3DCreate8( D3D_SDK_VERSION ) ) )
{
throw CHException( _T( "Failed to create D3D Object" ) );
}


// Retrieve the primary adapter''s current settings

D3DDISPLAYMODE d3ddm;
m_pD3D->GetAdapterDisplayMode( D3DADAPTER_DEFAULT, &d3ddm );

D3DPRESENT_PARAMETERS d3dpp;
ZeroMemory( &d3dpp, sizeof(d3dpp) );
d3dpp.Windowed = TRUE;
d3dpp.SwapEffect = D3DSWAPEFFECT_COPY;
d3dpp.BackBufferFormat = d3ddm.Format;


// Attempt to create a device using the current settings

HRESULT hr = m_pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, m_hWnd,
D3DCREATE_SOFTWARE_VERTEXPROCESSING,
&d3dpp, &m_pD3DDevice );


if( FAILED( hr ) )
{
CHException e;
e.ParseD3DError( hr );
throw e;
}


People might not remember what you said, or what you did, but they will always remember how you made them feel.

Share this post


Link to post
Share on other sites
You might try changing the device type to reference or hardware emulation... if after that it still doesn''t work, it''s probably a hardware/driver problem.


People might not remember what you said, or what you did, but they will always remember how you made them feel.

Share this post


Link to post
Share on other sites
Thanks everyone for the responses. I am running a Voodoo3 3000 with Win2k and DirectX 8.0. I am currently looking to download the latest drivers out there. Hopefully they will help. Has anyone else run across this issue with the hardware/software set I explained above. I would be very interested in a solution that doesn''t require a new computer.

Thanks again everyone!!!!
TheToad

Share this post


Link to post
Share on other sites