Advertisement

DX8 to DX9

Started by May 30, 2022 05:23 AM
5 comments, last by Tom Sloper 2 years, 3 months ago

Hi community,

I'm simply trying to port my app from DX8 to DX9, I read on Microsoft documentation that

 D3DRS_SOFTWAREVERTEXPROCESSING 

moved to

SetSoftwareVertexProcessing()

I have this in my code

BOOL isSoftwareVertexClipping=FALSE;
	if (!IsTLVertexClipping())
		isSoftwareVertexClipping=TRUE;

STATEMANAGER.SaveRenderState(D3DRS_SOFTWAREVERTEXPROCESSING, isSoftwareVertexClipping);

I'm struggling to convert to SetSoftwareVertexProcessing as it gives me this error:

Error (active) E0020 identifier "SetSoftwareVertexProcessing" is undefined

can someone please help?

thanks in advance

None

Is that a compiler error? If so, then maybe you are not including the D3D9 header.

The D3D9 docs say that the SetSoftwareVertexProcessing function works only on devices created with the mixed vertex processing flag. Did you pass this flag to the CreateDevice function?

Advertisement

I dont think you should use that feature. If you need the capability to have more compatibility for older video cards in your game, just simply do this at init, after setting up the d3d params you want:

	if(FAILED(g_pD3D -> CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING,&d3dpp, &g_pd3dDevice))){
		if(FAILED(g_pD3D -> CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING,&d3dpp, &g_pd3dDevice))){
			hibaD=1; // set error, try with other formats
		}
	}

ESries19 said:
Error (active) E0020 identifier "SetSoftwareVertexProcessing" is undefined

An “undefined identifier” means that the compiler doesn't know what the symbol means.

You don't show where that is created in your code.

There's a member function, IDirect3DDevice9::SetSoftwareVertexProcessing() which is probably what you're looking for. Assuming you've got D3D9.h included, as otherwise you'd be getting errors earlier, the next guess is that you're calling it as a free function rather than a member function.

Of course, I'd question the reason for using software made for Windows XP that targets 20 year old hardware, with the API's past End Of Life 7 years ago, that is only supported by more modern devices through multiple compatibility layers. It's certainly something you can do, but not recommended even for learning. I'd recommend you learn on API's that are actually supported on the hardware you're using.

Out of curiosity; is there a specific reason/ target audience why you're upgrading to dx9 instead of say dx11?

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me

cozzie said:

Out of curiosity; is there a specific reason/ target audience why you're upgrading to dx9 instead of say dx11?

You could have asked that 2 months ago when he first asked his question.

-- Tom Sloper -- sloperama.com

This topic is closed to new replies.

Advertisement