Using DirectX Effect11 with Visual Studio 2012 - directx

I recently updated to Visual Studio 2012 Ultimate. I was programming previously with DirectX 11 June 2010 SDK and want to continue to do so using Visual Studio 2012. However, I discovered that VS2012 comes with its own DirectX SDK (in Windows Kit 8.0) and I've been trying to migrate my code using the newer versions of d3d11. Everything went fine until I try to use effect files in my project (.fx files). I had to compile the Effects11 Sample in the DirectX SDK using VS2012 and link the lib file in my project. That went fine too. However, when I compile my project the function D3DX11CreateEffectFromMemory returns a E_NOINTERFACE error (no such interface is supported). Can anyone tell me why is that? Note that I'm using the d3d11.lib from the Windows Kit and the d3dx11.lib from the DirectX SDK. Perhaps I shouldn't mix them? However, everything else works fine when I mix them, except for the effect file creation.
Any help would be appreciated.
P.S. I don't know if this is helpful but just so you know, if I add an additional library directory in the project settings of "DirectXSDKInstallPath\lib\x86\" it works. Why is that? Does it mean I'm using the older version of the libraries? This will give a ton of warnings about redefined headers in winerror.h

D3DX Library has been deprecated for the newest version of DirectX 11 (Windows 8). See http://msdn.microsoft.com/en-us/library/windows/desktop/bb172965(v=vs.85).aspx
Effects are now handled a different way. You can program your own library to load effects or use DirectX Tool Kit (DirectXTK): http://directxtk.codeplex.com/
Microsoft has recommended this tool kit on their web site, see http://msdn.microsoft.com/en-us/library/windows/desktop/ee663275.aspx for more information.

Effect11 has moved to https://fx11.codeplex.com/, you need to compile it and link yourself.
DirectXTK does not provide the effect11 interface, but only simplified effects

This is probably caused by d3d library conflicts.
Make sure what d3d libraries you are using.Because there are 2 different d3d libraries.
One in DXSDK_DIR\Lib\x86 or \x64,and one in c:\program files(x86?)\Microsoft SDKs.
If you are using DXSDK, then pass $(DXSDK_DIR)Include $(DXSDK_DIR)Lib\x86 ahead of Microsoft SDKs' includes,libs directory in the Include directories and Library directories fields respectively.

In the previous version of Direct3D, the effects framework worked out of the box once you linked with the D3D10 library. In Direct3D 11, the effects framework has been moved to the D3DX library, and you have to include a separate header file (d3dx11Effect.h) and link with a separate library (D3DX11Effects.libfor release builds and D3DX11EffectsD.libfor debug builds).
Furthermore, in Direct3D 11, they give you the full source code for the effects library code (DirectX SDK\Samples\C++ \Effects11). Thus, you could modify the effects framework for your own needs. In this book, we will only be using the effects framework as is, without modification. In order to use the library, you need to first build the Effects11project in both release and debug mode to generate the D3DX11Effects.lib and D3DX11EffectsD.libfiles; you will only need to do this once unless the effects framework is updated (e.g., a new version of the DirectX SDK may update these files, so you may want to rebuild the .lib files to get the latest version). The d3dx11Effect.h header file can be found in DirectX SDK\Samples\C++\Effects11\Inc.
For our sample projects, we place the d3dx11Effect.h, D3DX11EffectsD.lib, and D3DX11Effects.libfiles in the Commondirectory that all of our projects share code from (see the “Introduction” for a description of the sample project organization).

Related

Importing DirectXTex

I am returning to an old DX9 project and have found a lot of my libraries have since been deprecated, specifically all D3DX files.
I'm trying to import DirectXTex to replace D3DX11Tex.
I've downloaded the library from its github page here
To add it I've added the file path to DirectXTex to additional dependencies but when I include it in my texture header file it's underlined in red.
Can anyone tell me what I'm doing wrong? Is it necessary to include additional dependencies in header files? I haven't open up visual studio in a long time and am a bit rusty.
What version of Visual Studio and the Windows SDK are you using? I have fairly detailed instructions here.
You should take a few moments to read this post as you may find that DirectX Tool Kit is a better fit for your project needs than DirectXTex or vice-versa.

DirectX Install Directory

So, I tried installing Microsoft DirectX 2010, when I was setting the directory of in the installer I put it to the wrong directory that I wanted it in. Now, every time I open the installer, it doesn't give me an option to change the directory, it just says continue and install. If anyone has a solution to this that would be really nice.
EDIT: Also forgot to note that when I installed it on my D: drive (its supposed to be on C: ) I get the error code S1023
The S1023 issue is detailed in this post. Because the setup just outright failed, and it's built on ancient pre-MSI technology, you need to clean out the old installation manually.
Delete the failed install directory
Using regedit to delete HKCU\Software\Microsoft\DirectX SDK, HKLM\Software\Microsoft\DirectX SDK. If you are on a x64 system (which I hope you are), also delete HKLM\SOFTWARE\WOW6432Node\Microsoft\DirectX SDK.
Edit your system environment variables and remove the entry for DXSDK_DIR.
The DirectX SDK is deprecated. If you are using VS 2012 or later -or- the Windows 8.0 SDK or later, and you are using DirectX 11 or DirectX 12, then you don't need it. See Microsoft Docs.
There are a few cases where it's still legitimate to use the legacy DirectX SDK as covered in The Zombie DirectX SDK, but for the most part you should avoid using it for new projects.
If you are trying to get an old game to work, try installing the latest DXSETUP/DXWSETUP but keep in mind that it doesn't actually install DirectX at all. See Not So Direct Setup
UPDATE: There are now really no reasons to use the legacy DirectX SDK at all. See Where is the DirectX SDK (2021 Edition)? for the overall status and details.
For legacy D3DX9/D3DX10/D3DX11, use the Microsoft.DXSDK.D3DX NuGet package per this blog post. No need for the legacy DirectX SDK or to use legacy DXSETUP for this solution.
For XAudio2 on Windows 7, use the Microsoft.XAudio2.Redist NuGet package per Microsoft Docs.

Video player in JUCE (C++) - building on Windows running on iOS

I'd like to know what is the simplest way to build a video playing app that runs under iOS. I'm using the JUCE Framework that allows to develop under Windows with e.g. Visual Studio and code programs for Android, iOS, etc.
I've looke around libVLC, FFMPEG and so on. But all of these are intended to be developed under Linux, I think.
Does somebody have an easy Example for JUCE to build an iOS player app working under Visual Studio?
Coding
There's nothing to step you writing the code itself; IDEs are just fancy text editors with other tools built in (in the case of Visual Studio, a full code translation toolchain).
You'll probably find that things like code completion won't work, as JUCE will #ifdef parts of the codebase out depending on what project type you're launching, but last I checked (when I worked there) there was no Visual Studio iOS project exporter available, so you'll have to just use a Windows compatible one and program through that.
Building
In order to build an iOS app, you need a Mac. If you take a look at the documentation, it states:
For iOS projects, connect to a networked Mac and start the Mac emulator from Visual Studio.
No cross-platform library that I know can circumvent this restriction; I believe it's due to a legal requirement enforced by Apple.
With that said, if you don't own a Mac you might be able to "rent" one using a service like Mac In Cloud. I'm not a lawyer, some please make sure you check the legality of using such a cloud service for building iOS apps before doing so.
Debugging
Since you need to be able to compile in order to debug a specific build of the application, the section on building applies. Of course, there's nothing stopping you from debugging it without a build by reading the source code carefully, but I'm guessing that's not what you're asking about.

Debugging HLSL for Windows 8 application

i'm currently in the process of creating a Windows 8 applicaiton using SharpDX (the managed c# directx wrapper). However I have ran into problems with one of my shaders and I want to know if its possible to debug such applications. PIX doesn't seem to work of directX apps as the executable does not like opening directly, and the new visual studio graphics debugging toolkit in VS2012 always states "unable to start the experiment" when I try to capture any information about my session.
Thanks!
I'm coming to this post a bit late, but I would just like to add for future visitors to this thread that I have successfully used the Visual Studio 2012 Graphics Diagnostics ('the DirectX Debugger') in both SlimDX and SharpDX projects. There are a few things that can disrupt the process, notably in SlimDX projects I couldn't debug apps with mixed DX10/11, DX10 doesn't seem to work with VS2012, at least for managed code. So if you have any text rendering for example, you will have to remove it for the debugging session. I'd say using the following to isolate your DX10 code should work
#define DXDIAGSESSION
// ...
#if DXDIAGSESSION
// your DX10 code goes here.
#endif
And for the SharpDX project (C# / WinRT / XAML / SharpDX) I couldn't use the Managed Only Debugger. I had to set the Debugger to Mixed (Managed and Native) to make it work.
The DirectX Visual Studio debugger only works with native code. You'll get the error that you are until you right-click on the project, select "Properties", go to the Debugging tab, and enable native debugging.
While that will remove the error it may or may not resolve the problem. I've got a similar scenario using SurfaceImageSource (C++) being hosted in a managed component and a DirectXPage in a C++ project. In both projects it appears that DirectX debugging is failing to capture frames. It appears this feature only works for programs that are using a DirectX UI (no managed UI components).

OpenCV 2.1 Strange Errors

I'm not sure if this is the right place for asking these kind of question but I have no better place in mind.
After LOTS of coding in OpenCV, I'm trying to migrate to new C++ interface of openCV which has been introduced in OpenCV 2.0. but I keep getting strange errors.
For example:
trying to use pre-built dlls and libs, I got exceptions in "cv::warpAffine" and "findContours" cv::function at runtime. I compiled the openCV, used my own build of libs and dlls and everything got fixed!
the same problem happened in linux.
linking the "Debug" built dlls with "Release" built of program cause some unexpected runtime errors, and vice versa.
and some other errors.
can anyone helping me with what I'm doing wrong? (please keep in mind that I coded alot with older version of openCV).
When I migrated to C++ interface I couldnt make openCV work until I compiled the source by myself. Probably DLL's and Libs that are installed with opencv are good only to a specific machine.
Another thing. Try to do the following if you use Visual Studio
go to Project Properties->Click the C/C++ folder->Code Generation->Runtime Library and change it to /MDd in Debug configuration and /MD in release
It solves a problem with esceptions related to STL
Some of the functions ave moved out to new libs (especially some of the stereo functions are in calib3d) and the header file structure is completely changed in 2.2
There are some guides to the configuration eg for visual studio

Resources