DirectX with Windows 7 and Windows 8 - windows-8

I am developing an application with DirectX11 on Windows 7 environment with DirectX SDK (June 2010). Windows 8 and 8.1 come with Windows SDK (which includes DirectX SDK). I found out that some of the header files from DirectX SDK are not included in Windows SDK. (D3DX11Core.h, D3DX11.h, etc)
My questions are:
Will my application run on Windows 8 & 8.1 environment?
Backward compatibility on Windows 8 and 8.1 for DirectX 11 or DirectX 10
What if my application uses deprecated header file (eg D3DX11.h), will it work on windows 8
This is my current working envrionment
OS = Windows 7
DirectX = DirectX SDK (June 2010)
DirectX 11 with Direct3D 11
Windows Kits (Installed with Visual Studio)

D3DX is deprecated since the inclusion of DirectX in the Windows SDK done first with the Windows kits 8 shipped with VS2012.
An application built with the June 2010 SDK and D3DX will of course work on all windows with the proper redist.
Still, the DirectX June 2010 sdk is deprecated for years, you miss some revised API that are useful to write Windows Apps for the Metro interface and mixing the two will give you conflicts and a strong headache.

Direct3D 11 Win32 desktop applications will run on Windows 8.x assuming you install the required Visual C++ REDIST. If you are using the legacy components in the DirectX SDK such as D3DX, D3DCompiler #43, XAudio 2.7, XInput 1.3, or XACT you need to also run the DirectX End-User Runtime REDIST. Note that there are some known issues with the DirectX REDIST which have been addressed after the DXSDK (June 2010) release. See this blog post.
If you want to build with VS 2012/2013 and the legacy DirectX SDK, you can. You just need to reverse the include/lib paths order per the instructions non MSDN.
Also, if you are using D3DX11 there are lots of options to replacing it without picking up additional DLL dependencies.

Related

Are applications with C++/WinRT supported on Windows 11

With the arrival of Windows 11 as a new OS after Windows 10. Can apps with C++/WinRT libraries built for Windows 10 still be used and supported on Windows 11 without any issues?
Windows 11 supports the same applications (generally speaking) as Windows 10, including Universal Windows Platform (UWP) apps written with the C++/WinRT projections or the C++/CX language extensions.
See Microsoft Docs: Compatibility for Windows 11
The supportedOS GUID used for Win32 desktop applications for Windows 11 is the same as the one for Windows 10. See Windows version check and this blog post.
Not directly related to your question, but FYI: Windows 11 on ARM64 adds support for x64 emulation. Windows 10 on ARM64 already supported x86 emulation. There is now a new ARM64EC ABI for ARM64 platforms as well.

Windows Runtime of Windows 8 improved by Windows 10

Is the Windows Runtime library that was introduced with Windows 8 the predecessor of the Windows Universal library in Windows 10?
Or is the Windows Universal library something totally build from the ground up?
It's the same thing. The Windows Runtime for Universal Windows apps is a continuation of the Windows Runtime that first shipped in Windows 8.

can a directx executable be statically linked such that the redistributable dll's are not needed on the system?

Please can anyone tell me if it's possible to statically link in all the directx libs.
Basically can i build an exe that will run on any windows system that does not have the directx redistribu installed?
As noted, you can't statically link the "DirectX" libraries i.e. Direct3D, DirectInput, DirectSound, etc. That said, depending exactly on your definition of "any Windows system" you actually do not need the DirectX "Redist". It doesn't do what you think it does. See Not So DirectSetup for the a longer discussion of this.
If you use Direct3D 9 or later, DirectDraw, DirectSound 8, DirectInput 8, DirectShow, DirectMusic, DirectPlay, etc. i.e. what historically has been called "DirectX 9.0c" (aka the Summer 2004 release), those bits are always present on Windows starting with Windows XP Service Pack 2, Windows Server 2003 Service Pack 1, and Windows XP x64 Edition. Therefore, as long as you require those as your minimum OS (or something greater), you don't need any DirectX Redist because it doesn't actually install any of those things. Take a look at What's in a version number? for examples of the "you must be this high to ride this ride" checks that guarantee this. Supporting Windows 2000, Windows 9x, or Windows ME or even Windows XP RTM/SP1 these days seems way out of scope.
For Direct3D 11, read Direct3D 11 Deployment for Game Developers. Direct3D 11.0 is built into Windows 8.x and Windows 7. It is on Windows Vista Service Pack 2 with KB 971644 installed which was pushed by Windows Update so it's basically everywhere.
Where it gets murky is if you are using other stuff in the DirectX SDK:
All versions of D3DX9, D3DX10, and D3DX11 are deprecated (see MSDN). If you depend on these, you still need the legacy DirectSetup. The good news is that with Direct3D 11, you don't need to use it at all. Instead see Living without D3DX for a bunch of new support libraries that are statically linked to your application as well as available shared-source--which includes DirectX Tool Kit mentioned in the other answer.
The HLSL compiler is not actually in D3DX anymore, and if you use the Windows 8.x SDK version of D3DCompile you can deploy that DLL side-by-side with your application avoiding the need for the DirectX Redist. See HLSL, FXC, and D3DCompile. Note that this DLL only supports Windows Vista or later, so runtime HLSL compilation on Windows XP still requires the legacy DirectX SDK and DirectX Redist. If you pre-build your shaders and are not using the Effects (FX) framework, this is not an issue.
If you use XINPUT, you should use XINPUT 9.1.0 (the original version) unless you are specifically using the headset audio features of XInput 1.3. This version is built into Windows Vista and later. If you require Windows 8.0 or later, you can use XInput 1.4. See XINPUT and Windows 8. Note that Server editions of Windows do not have XInput 9.1.0 or 1.4.
If you are using XAUDIO2, then you have a choice to make. If you require Windows 8.0 or later, then you can use XAudio 2.8 as it's built-in to the OS. Otherwise you need to use XAudio 2.7 which still requires the legacy DirectX REDIST to deploy. See XAudio2 and Windows 8.
If you use XACT, then you have to use the legacy DirectX REDIST as that's the only way to deploy the XACT engine.
If you are using the legacy DirectX Managed Assemblies for .NET 1.1, you should move to something else like SlimDX or SharpDX for a host of reasons. See DirectX and .NET
If you are making use of other "DirectX" things, you should read DirectX SDKs of a certain age for some guidance. In short: Don't use Direct3D Retained Mode, DirectPlay Voice, or DirectX 7/8 Visual Basic 6.0 as they aren't in the OS starting with Windows Vista.
No, the DirectX redist binaries are not available as static libs, though most of the useful functionality is now available as source in the DirectX Tool Kit.

Some options on DirectX control panel was disabled on Windows 8

I am using DirectX 9.0 on Windows 8, when I open the DirectX control panel, I found some options was disabled, I am running as a administrator, so this is not an privilege issue. why this happened? I can't turn on the debug version runtime since it is disabled. see picture below. the SDK I am using is June 2010
Answer from Microsoft XNA forum
The Direct3D 9 Developer Runtime (aka D3D9D.DLL) in the legacy DirectX SDK (June 2010) is not compatible with Windows 8. In fact, the entire Developer Runtime in the legacy DirectX SDK (June 2010) is not compatible with Windows 8 or with Windows 7 SP1 with KB 2370838 installed. The only way to obtain the Direct3D 9 Developer Runtime for Windows 8 is to install a 'checked' version of Windows 8. The Direct3D 10.x/11.x Developer Runtime for Windows 8 is installed by the Windows 8.0 SDK, VS 2012, or the VS 2012 Remote Debugging Tools packages.
See Where is the DirectX SDK?, Where is the DirectX SDK (2013 Edition)?, and DirectX 11.1 and Windows 7
Another option I found here is this:
Using regedit, go to key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Direct3D. The "Trusted Installer" has ownership of this key. Change ownership to Administrators, then grant "Full Access" to the Administrators (write access to values should be enough, but I didn't test this). Now run the DX Control Panel (as admin, of course). Now the changes should be saved.

Visual Studio 2012 thinks I'm on Windows 8 and demands libraries I don't have?

I implemented the code from one of the samples in the DirectX 11 SDK from June 2010.I open my project in 2012 and then I open the sample in 2012 too,however when I run mine,it requires XAudio2_8.dll.How is thsi even possible?That's the .dll in Windows 8 and the code from the SDK is from 2010 - such .dll didn't exist back then?The weirdest thing is the SDK sample builds and runs,while my project asks for the .dll.I linked all the libs,made all the includes,I checked around the project settings,searched the whole hard drive for such a dll,nothing...What could be causing such a problem?I've also been having all sorts of other problems in the SDK under VS2012,like not recognizing types in the dx11 headers and so on.
The Windows 8.x SDK has the DirectX SDK integrated into it, which for many areas means you don't need to use the legacy DirectX SDK at all. In particular, Direct3D, DirectSound, DirectInput, etc. all have the proper headers and libs in the Windows 8.x SDK.
The DirectX SDK is quite venerable, so there are a number of older things missing: no DirectMusic playback, DirectPlay, etc. I have a blog post that provides a full inventory of what happened to everything in the DirectX SDK.
Where it gets complicated is XAudio and XInput. Both XAudio 2.8 and XInput 1.4 are part of the Windows 8.x OS, but is not available on Windows 7. If you are targeting 'down-level' to Windows 7, you have to use XAudio 2.7 and either XInput 1.3 or XInput 9.1.0. This somewhat messy story is covered in two blog entries: one for XInput and one for XAudio. The good news is that most use of XInput is actually doable with XInput 9.1.0 which is part of the Windows OS starting with Windows Vista. It's XAudio 'down-level' that requires mixing the modern Windows 8.x SDK and the legacy DirectX SDK, plus having to use the legacy DirectX SDK REDIST (DirectSetup).
The root reason you are getting a 'runtime' error instead of a 'compile-time' error is that you didn't set _WIN32_WINNT to 0x0601 for Windows 7 (or 0x0600 for Windows Vista). If you had, the XINPUT.H header in the Windows 8.x SDK would automatically use the XInput 9.1.0 version and the XAUIOD2.H header in the Windows 8.x SDK would have errored out and told you it wasn't going to work for Windows 7.
Finally, I've cleaned up and reposted many of the old Direct SDK samples to MSDN Code Gallery in such a way that they don't need the legacy DirectX SDK.
The basic rule is, if you develop XAudio2 program on Win 8, use the Windows SDK, otherwise, use DirectX SDK.
If you are working on Win7, make sure
the head file XAudio2.h you are using comes from the DirectX SDK, that's something like C:\Program Files\Microsoft DirectX SDK (June 2010)\Include\XAudio2.h, not come from the Win8 SDK, something like C:\Program Files\Windows Kits\8.0\Include\um\XAudio2.h(in case you installed the Win8 SDK)
Call CoInitializeEx(NULL, COINIT_MULTITHREADED); before calling XAudio2Create, since the old version(before 2.8) of XAaudio2 was created by COM, so it does not need a .lib file, and there is no .lib file for XAudio2 before Win8.
This page below contains a detail introduction of the version of XAudio2, you can take a look.
XAudio2 Versions