C Board  

Go Back   C Board > General Programming Boards > Game Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 10-27-2006, 02:27 PM   #1
Registered User
 
Tonto's Avatar
 
Join Date: Jun 2005
Location: New York
Posts: 1,465
DX - CreateDevice - D3DERR_INVALIDCALL

I am trying to create an adaptor device (I think). I am using the debug libraries, which spit this at me:

Code:
Direct3D9: (ERROR) :Device cannot perform hardware processing. ValidateCreateDevice failed.

D3D9 Helper: IDirect3D9::CreateDevice failed: D3DERR_INVALIDCALL
Test 2
Direct3D9: (ERROR) :    [0] : Address 00D0D4CB
Direct3D9: (ERROR) :    [1] : Address 00D0D59B
Direct3D9: (ERROR) :    [2] : Address 00D0D440
Direct3D9: (ERROR) :    [3] : Address 00D01D44
Direct3D9: (ERROR) :    [4] : Address 00401605
Direct3D9: (ERROR) :    [5] : Address 004022EE
Direct3D9: (ERROR) :    [6] : Address 7C816FD7
Direct3D9: (ERROR) :    [7] : Address 00000000
Direct3D9: (ERROR) :    [8] : Address 00000000
Direct3D9: (ERROR) :    [9] : Address 00000000
Direct3D9: (ERROR) :    [10] : Address 00000000
Direct3D9: (ERROR) :    [11] : Address 00000000
Direct3D9: (ERROR) :    [12] : Address 00000000
Direct3D9: (ERROR) :    [13] : Address 00000000
Direct3D9: (ERROR) :    [14] : Address 00000000
Direct3D9: (ERROR) :    [15] : Address 00000000
Direct3D9: (ERROR) :    [0] : Address 00D04064
Direct3D9: (ERROR) :    [1] : Address 00D04E4F
Direct3D9: (ERROR) :    [2] : Address 00D05588
Direct3D9: (ERROR) :    [3] : Address 00D01D65
Direct3D9: (ERROR) :    [4] : Address 00401605
Direct3D9: (ERROR) :    [5] : Address 004022EE
Direct3D9: (ERROR) :    [6] : Address 7C816FD7
Direct3D9: (ERROR) :    [7] : Address 00000000
Direct3D9: (ERROR) :    [8] : Address 00000000
Direct3D9: (ERROR) :    [9] : Address 00000000
Direct3D9: (ERROR) :    [10] : Address 00000000
Direct3D9: (ERROR) :    [11] : Address 00000000
Direct3D9: (ERROR) :    [12] : Address 00000000
Direct3D9: (ERROR) :    [13] : Address 00000000
Direct3D9: (ERROR) :    [14] : Address 00000000
Direct3D9: (ERROR) :    [15] : Address 00000000
Direct3D9: (ERROR) :    [0] : Address 00D0572F
Direct3D9: (ERROR) :    [1] : Address 00D01D65
Direct3D9: (ERROR) :    [2] : Address 00401605
Direct3D9: (ERROR) :    [3] : Address 004022EE
Direct3D9: (ERROR) :    [4] : Address 7C816FD7
Direct3D9: (ERROR) :    [5] : Address 00000000
Direct3D9: (ERROR) :    [6] : Address 00000000
Direct3D9: (ERROR) :    [7] : Address 00000000
Direct3D9: (ERROR) :    [8] : Address 00000000
Direct3D9: (ERROR) :    [9] : Address 00000000
Direct3D9: (ERROR) :    [10] : Address 00000000
Direct3D9: (ERROR) :    [11] : Address 00000000
Direct3D9: (ERROR) :    [12] : Address 00000000
Direct3D9: (ERROR) :    [13] : Address 00000000
Direct3D9: (ERROR) :    [14] : Address 00000000
Direct3D9: (ERROR) :    [15] : Address 00000000
Direct3D9: (ERROR) :    [0] : Address 00D0D4CB
Direct3D9: (ERROR) :    [1] : Address 00D0D59B
Direct3D9: (ERROR) :    [2] : Address 00D0D440
Direct3D9: (ERROR) :    [3] : Address 00D7C2D5
Direct3D9: (ERROR) :    [4] : Address 00D7A696
Direct3D9: (ERROR) :    [5] : Address 00D01DBE
Direct3D9: (ERROR) :    [6] : Address 00401605
Direct3D9: (ERROR) :    [7] : Address 004022EE
Direct3D9: (ERROR) :    [8] : Address 7C816FD7
Direct3D9: (ERROR) :    [9] : Address 00000000
Direct3D9: (ERROR) :    [10] : Address 00000000
Direct3D9: (ERROR) :    [11] : Address 00000000
Direct3D9: (ERROR) :    [12] : Address 00000000
Direct3D9: (ERROR) :    [13] : Address 00000000
Direct3D9: (ERROR) :    [14] : Address 00000000
Direct3D9: (ERROR) :    [15] : Address 00000000
I try to find a valid device using this code.

Code:
	D3DDISPLAYMODE d3ddm = { 0 };
	bool bDesired = false;

	int nModes = mpd3dInterface->GetAdapterModeCount( D3DADAPTER_DEFAULT, 
		D3DFMT_X8R8G8B8 );

	for( int i = 0; i < nModes; ++i )
	{
		if( FAILED( mpd3dInterface->EnumAdapterModes
			( D3DADAPTER_DEFAULT, D3DFMT_X8R8G8B8, i, &d3ddm ) ) )
		{
			return 0;
		}

		if( d3ddm.Width != mnWidth || d3ddm.Height != mnHeight ) continue;
		if( d3ddm.Format != D3DFMT_X8R8G8B8 ) continue;
		if( d3ddm.RefreshRate != 75 ) continue;

		bDesired = true;
		break;
	}

	if( !bDesired )
	{
		return 0;
	}

	if( FAILED( mpd3dInterface->CheckDeviceType
		( D3DADAPTER_DEFAULT,
		D3DDEVTYPE_HAL,
		D3DFMT_X8R8G8B8,
		D3DFMT_X8R8G8B8,
		FALSE ) ) )
	{
		return 0;
	}

	if( FAILED( mpd3dInterface->CheckDeviceFormat
		( D3DADAPTER_DEFAULT,
		D3DDEVTYPE_HAL,
		D3DFMT_X8R8G8B8,
		D3DUSAGE_DEPTHSTENCIL,
		D3DRTYPE_SURFACE,
		D3DFMT_D16 ) ) )
	{
		return 0;
	}

	D3DCAPS9 d3dcaps;
	ZeroMemory(&d3dcaps, sizeof d3dcaps);

	if( FAILED( mpd3dInterface->GetDeviceCaps
		( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, 
		&d3dcaps ) ) )
	{
		return 0;
	}

	DWORD dwBehaviorFlags = 0;

	if( d3dcaps.VertexProcessingCaps != 0 )
		dwBehaviorFlags |= D3DCREATE_HARDWARE_VERTEXPROCESSING;
	else
		dwBehaviorFlags |= D3DCREATE_SOFTWARE_VERTEXPROCESSING;



	md3dpp.Windowed               = FALSE;
	md3dpp.EnableAutoDepthStencil = TRUE;
	md3dpp.AutoDepthStencilFormat = D3DFMT_D16;
	md3dpp.SwapEffect             = D3DSWAPEFFECT_DISCARD;
	md3dpp.BackBufferWidth        = mnWidth;
	md3dpp.BackBufferHeight       = mnHeight;
	md3dpp.BackBufferFormat       = D3DFMT_X8R8G8B8;

	if( FAILED( mpd3dInterface->CreateDevice
		( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, 
		mhWnd, dwBehaviorFlags, &md3dpp, 
		&mpd3dDevice ) ) )
	{
		return 0;
	}
I don't know much about hardware compatibility, but it just seems to not be working getting a 640x480 'device' wven though the enumeration found it.
__________________

╔╗╔╦══╦╗╔╦══╦╗
║╚╝║╔╗║╚╝║╔╗║║
║╔╗║╠╣║╔╗║╠╣╠╣
╚╝╚╩╝╚╩╝╚╩╝╚╩╝

codez http://code.google.com/p/zxcvbn/

Last edited by Tonto; 10-27-2006 at 02:40 PM.
Tonto is offline   Reply With Quote
Old 11-30-2006, 02:43 AM   #2
Registered User
 
Tonto's Avatar
 
Join Date: Jun 2005
Location: New York
Posts: 1,465
It is interesting to note that:

1) This code works on an XP pro machine with a giant flatscreen than can support all sorts of devices I would guess
2) This code does not work on an XP home machine with some sort of CRT monitor with a max of resolution of 1024 x 768
3) That I do not fill out all the fields of the D3DPRESENT_PARAMETERS structure
4) That I would like to get this to work
5) That I don't know much about 'hardware compatibility'
__________________

╔╗╔╦══╦╗╔╦══╦╗
║╚╝║╔╗║╚╝║╔╗║║
║╔╗║╠╣║╔╗║╠╣╠╣
╚╝╚╩╝╚╩╝╚╩╝╚╩╝

codez http://code.google.com/p/zxcvbn/
Tonto is offline   Reply With Quote
Old 12-01-2006, 06:36 PM   #3
Registered User
 
Tonto's Avatar
 
Join Date: Jun 2005
Location: New York
Posts: 1,465
Could it have anything to do with the device I find not supporting a 32-bit color depth? Is there any way I can work around that?
__________________

╔╗╔╦══╦╗╔╦══╦╗
║╚╝║╔╗║╚╝║╔╗║║
║╔╗║╠╣║╔╗║╠╣╠╣
╚╝╚╩╝╚╩╝╚╩╝╚╩╝

codez http://code.google.com/p/zxcvbn/
Tonto is offline   Reply With Quote
Old 12-01-2006, 07:17 PM   #4
Super Moderator
 
Bubba's Avatar
 
Join Date: Aug 2001
Posts: 7,472
Set the format to D3DFMT_UNKNOWN and try it or set it to a lower color depth.

Create normally fails when one of the following occurs:
  • Invalid depth buffer format
  • Invalid color depth
  • Invalid resolution
  • Invalid refresh rate
  • Invalid back buffer format
  • Invalid multi sample
  • Invalid vertex processing
  • Invalid window handle
  • Invalid back buffer format for windowed mode
  • Invalid refresh for windowed mode (must be 0)
  • Device does not support D3D.

I would say from the error message your video card does not support hardware transformation of vertices. Set this to software and it probably will work. And after that go buy a new video card b/c if it does not support hardware T&L it is ancient.
Bubba is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
DX or OpenGL? michaelp Game Programming 31 01-10-2008 06:26 PM
Checking for DX in setup and deployment in MSVS 05 .NET Bubba General Discussions 0 10-15-2006 03:32 PM
Assembly Tutorials JoshR General Discussions 13 06-11-2005 09:56 AM
Having some trouble setting up Dev-c++ for DX Iamien Game Programming 7 08-25-2003 07:30 PM
My graphics library stupid_mutt C Programming 3 11-26-2001 06:05 PM


All times are GMT -6. The time now is 06:52 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22