πŸŽ‰ Celebrating 25 Years of GameDev.net! πŸŽ‰

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

syntax error :

Started by
2 comments, last by Ultraporing 2Β years, 1Β month ago

Hello

Need some help. I'm not a programmer . I try port one old game Direkt x 8,1 to Direkt x 9

I have sucess , the code compiles but when i open game it will crach because old code i delete m_dwWaterPixelShader and m_dwWaterShader .

Now i restore this place old code and i get error

D3DXAssembleShader(strWaterPixelShader,strlen(strWaterPixelShader),0,NULL,(DWORD)&pCode,NULL,0);

BaseGraphicsLayer::GetDevice()->CreatePixelShader((DWORD*)pCode->GetBufferPointer(),(DWORD)&m_dwWaterPixelShader);

pCode->Release();

D3DXAssembleShader(strWaterVertexShader,strlen(strWaterVertexShader),0,NULL,(DWORD)&pCode,NULL,0);

BaseGraphicsLayer::GetDevice()->CreateVertexShader( (DWORD*)dwWaterVertexDecl, ((DWORD*)pCode->GetBufferPointer(), (DWORD)&m_dwWaterShader );

pCode->Release();

Cant use (DWORD)&m_dwWaterShader and (DWORD)&m_dwWaterPixelShader it will give error. Can some one help me this place ?

Ty anyway …

I hve try diffirent way fix this but all time FAIL

Advertisement

equlibrium24 said:
Need some help. I'm not a programmer . I try port one old game Direkt x 8,1 to Direkt x 9

Have you tried the mental health professionals in your area?

πŸ™‚πŸ™‚πŸ™‚πŸ™‚πŸ™‚<←The tone posse, ready for action.

At least at line 373 the number of β€œ(” parentheses and β€œ)” parentheses doesn't match.

EDIT: As for porting old code to new code, I never used DirectX so I don't know about this specific case, but in general, you need to understand first what the old code was doing, then find in the new version how you do that now, and then change the code accordingly.

It's not something that you can simply do without deeper understanding of the systems.

Pretty much what Alberth said,
since I got a bit of experience with DirectX and digged through the documentation and old tutorial websites found a few things that could help.

Firstly this DX9 implementation is newer, for example the CreateVertexShader Method requires only 2 parameters and one of them is the assembled shader code. Which should have been generated via D3DXAssembleShader Method, but your second to last parameter is NULL. That's the return value of the shader code object (IDirect3DVertexShader9) you need to pass the pointer to the CreateVertexShader Method. After fixing your bracket problems it should compile and maybe run without actually porting the code myself, since I have no Idea how old the dx9 is and so on.

You should get an experienced programmer to port it. Or you'll have to learn programming yourself.
This should at least get you started.

Here is the Documentation for those two methods. With this and googlefoo can you fix the the problems and it has all the info you need to port the directx.
Assemble Shader Docu: https://docs.microsoft.com/en-us/windows/win32/direct3d9/d3dxassembleshader
Create Vertex Method Docu: https://docs.microsoft.com/en-us/windows/win32/api/d3d9/nf-d3d9-idirect3ddevice9-createvertexshader

β€œIt's a cruel and random world, but the chaos is all so beautiful.”
― Hiromu Arakawa

This topic is closed to new replies.

Advertisement