xray-16 icon indicating copy to clipboard operation
xray-16 copied to clipboard

Windows SDK DirectX

Open nitrocaster opened this issue 9 years ago • 10 comments

It's known that DirectX SDK is now a part of Windows SDK. To eliminate potential problems with old DXSDK in future, we should get rid of it and use Windows SDK.

The most complicated problem I've found is that engine uses D3DX math (not everywhere though).

  • [ ] D3DX
    • [x] https://github.com/OpenXRay/xray-16/issues/261
    • [ ] D3DXTex
    • [ ] D3DXMesh
    • [ ] Other

Links related:

  • Where is the DirectX SDK: http://msdn.microsoft.com/en-us/library/windows/desktop/ee663275.aspx
  • Where is the DirectX SDK (2021 edition): https://walbourn.github.io/where-is-the-directx-sdk-2021-edition/
  • Living without D3DX: http://blogs.msdn.com/b/chuckw/archive/2013/08/21/living-without-d3dx.aspx

nitrocaster avatar Dec 06 '15 13:12 nitrocaster

D3DX Math functions are being used heavily in the sun shadow mapping code, however those functions already have equivalents in the XRay Matrix classes. As part of the OpenGL port I will be replacing those D3DX math functions with their XRay equivalents.

The other D3DX calls are related to converting between the Flexible Vertex Format and the Vertex Declaration Structure. Getting rid of that conversion is not necessary for the OpenGL port as my code supports either format. Probably the DirectX code will also need to be changed to support both formats without conversions if we want to get rid of D3DX.

CrossVR avatar Dec 06 '15 13:12 CrossVR

I've created a new branch no_dxsdk with some fixes for xrCore (dxerr) and xrRender (FVF utilities).

nitrocaster avatar Dec 06 '15 15:12 nitrocaster

That's pretty good, I can probably make use of that in the OpenGL port, will make the code a bit cleaner.

This is how I did it in OpenGL: https://github.com/Armada651/xray-16/blob/opengl/src/Layers/xrRenderGL/glBufferUtils.cpp

CrossVR avatar Dec 06 '15 15:12 CrossVR

нашел вот http://stackoverflow.com/questions/31053670/unresolved-external-symbol-vsnprintf-in-dxerr-lib по проблеме с dxerr.lib в vs2015 добавить библиотеку legacy_stdio_definitions.lib

fedan avatar Jan 21 '16 15:01 fedan

@fedan проблемы с dxerr нет с тех пор, как соответствующий API был реализован в xrCore.

nitrocaster avatar Jan 21 '16 20:01 nitrocaster

I use DirectX SDK on Windows 10 but i have done minor changes in DX SDK and it's works for me. For DirectX 11 or 11.1 or 10.1 i use older DX SDK which i have configured for me. For DirectX 12 actually i use Windows SDK of course. I have removed DXErr i am not using not in original DX API and not in DXUT. Actually DXErr.lib was working with VS 2010 not with more recent version of Visual Studio.

Postal86 avatar Feb 23 '16 15:02 Postal86

@Postal86 xrCore does implement DxErr.

nitrocaster avatar Feb 23 '16 15:02 nitrocaster

@nitrocaster gotcha.

Postal86 avatar Feb 23 '16 15:02 Postal86

So what are the views on DX dependencies? Personally, I'd like if we could still target even Win98-ish, just like the original binaries, and the VS2015.3 community release is a MONSTER - we're talking about (claimed, by its installer) 13GB for just the dev env and the "XP compatibility".

Looking forward, since there were never any 64-bit builds of any STALKER, we're pretty much free to (re-)define the interfaces if going 64-bit.

tamlin-mike avatar Jul 10 '16 00:07 tamlin-mike

Some chronology:

  1. DirectX SDK headers were copied to our repository using blog post by Chuck Walbourn to make things easier. (commit https://github.com/OpenXRay/xray-16/commit/b6c70455b1a1cd83fba0d6c8cd652b3cbcaecbf0)

Recent progress:

  1. Local DXSDK copy was replaced by the NuGet package. Thanks Chuck Walbourn, again. (commit https://github.com/OpenXRay/xray-16/commit/434b12b9845d555e38160c8c15a576d9e3ffa78a)
  2. Math part of D3DX was replaced by DirectXMath. (https://github.com/OpenXRay/xray-16/issues/261)

Xottab-DUTY avatar Jul 07 '21 15:07 Xottab-DUTY