directx 9 with visual studio 2012 express - c++

I decided to learn directx on my old laptop that has an ATI Radeon X1200 card.
Using the program GPU-Z.0.7.2 I found that my card support directx 9 /SM2.0 and has shadrers of 4 Pixel / 2 Vertex.
Using dxdiag on my windows 7 I found that directx version is directx 11. Then I downloaded visual studio 2012 express but I did not install it yet.
Since my card supports only directx 9 im going to read the book Introduction to 3D Game Programming with DirectX 9.
Now what version of the direct SDK do I have to download ? and after downloading the SDK what should I install first the SDK or visual studio 2012 express ? Is the book ok ? I mean there are other editions of the book but they supprt directx 9c , directx 10 and directx 11.
Thank u so much.

Using dxdiag on my windows 7 I found that directx version is directx
11.
This is the DirectX runtime version, not SDK version. so it does not matter which version of SDK you use to develop your program.
As others said, the installation order does not matter.
The book you mentioned is good for new starters. but I recommend you to start from the shader version, since fixed pipeline functionalities such as transforming and lighting was abandoned start from DirectX 10, they all moved to shaders, there is a shader version of that book.
there are lots of materials and resources to learn DirectX, I paste some pages for your reference.
http://www.directxtutorial.com/LessonList.aspx?listid=9
http://www.braynzarsoft.net/index.php?p=DX11Lessons
http://www.rastertek.com/tutindex.html
DirectX SDK examples are also very good choice.

You should be able to use Direct3D 11 whilst still targeting a Direct3D 9 device via the D3D_FEATURE_LEVEL enum, which you can specify in your D3D11CreateDeviceAndSwapChain.

The Microsoft DirectX SDK (June 2010) contains both DirectX 11 and DirectX 9 headers and documentation. The install order doesn't really matter (I've used the SDK in Code::Blocks before installing Visual Studio and it worked fine) since it's really just a collection of header files and debug dlls, plus a bunch of stuff to get you started.
Personally I don't use books when learning a library - I look at the documentation, which is a firsthand explanation of the material, or search up a tutorial (though you should take anything you read in a tutorial with a grain of salt). There are also several websites and videos that explain the graphics pipeline really well. I can't really comment on the book otherwise.

If you not targeting Windows XP or earlier OS, throw DirectX 9 book, forget it (same with DirectX 10 if you not targeting Vista without Service packs), and take DirectX 11 one
Luna's books are great, but, IMO, online tutorials that zdd mentioned are better. And free. But still, to write something cool, you will need to read much more than one book or one series of tutorials. Take the best parts and mix it!
You can develop with DirectX 11 API (for Windows Vista SP2 and later OSes), but still targeting DirectX 9 hardware (feature level 9.3). Shaders is a must. Love them!
When you installing Visual Studio 2012 or higher, you also get a copy of Windows SDK. Do not install standalone DirectX SDK, because it is obsolete. Since Windows 8, DirectX SDK is a part of Windows SDK. Install standalone DirectX SDK only if you really-really need that old stuff, such as D3D11X or effects framework (for Luna books).
Happy coding!

Related

Why d3dx is deprecated?

I'm very new to DirectX, and learning it only for a week. A collection of powerful lessons I found and learn from is braynzarsoft d3d12 lessons. It's very difficult, there is a lot of information, but this is what I like.
The lessons seems to be unfinished, and I decided to search through the Internet on how to make a sphere, maybe there is ready vertices matrix, or some algorithm that will describe the sphere's vertices. I found this question, where one person says that what I am doing is actually deprecated and now I should program using the DirectX Tool Kit.
I am really confused - I am doing really well, yet all my code works perfectly, and as far as I want.
Can somebody, who has experience in DirectX programming, explain to me why what I am doing is deprecated, what I should do in general, and where I can get sphere vertices?
Currently, I wrote simple vertex and pixel shaders, initialized a d3d12 device, swap chain, command list, described vertices for a quad, and wrote a class that can add, move, rotate and scale cubes, which I do in an Update() call, before UpdatePipeline().
My try
In DirectxTK there is a function D3DXCreateSphere that has LPD3DXMESH *ppMesh and LPD3DXBUFFER *ppAdjacency interfaces as the output arguments. Perhaps, I can get vertex array I need from them. But anyway, I don’t will it be possible to combine DirectxTK code with my.
The short answer is that as part of the development effort for the Windows 8 SDK (circa 2011), the "DirectX SDK" was migrated into the Windows SDK. The DirectX libraries, headers, and tools were moved into the Windows SDK and the "DirectX SDK" was declared deprecated (i.e. the DirectX SDK June 2010 release was the last one ever made).
Microsoft moved samples online for Windows 8, so the majority of the samples in the DirectX SDK were abandoned in favor of Windows Store/UWP samples. As a personal project, I've put a bunch of the Direct3D 11 samples up on GitHub updated so they only use the Windows SDK.
A number of technologies were left behind in this migration as noted on the Microsoft Docs page.
Direct3D 9 development is considered legacy, and the primary reason for still using it was Windows XP support. The Windows 8 SDK doesn't support Windows XP development--Visual Studio 2012-2017 support Windows XP development by using the Windows 7.1A SDK. If you want to target Direct3D 9, you are basically stuck with using the legacy DirectX SDK--although some engines have enough of their own helper code that they don't really need D3DX9.
Direct3D 10 development is considered legacy. Direct3D 11 is a strict super-set of Direct3D 10, is supported by the same versions of Windows, and the Feature Level mechanism means Direct3D 11 works on more hardware than Direct3D 10 ever did. As such, the helper library D3DX10 is deprecated.
The XACT library was not carried forward. It was created primarily for Xbox 360, so it's been deprecated.
Managed DirectX 1.1 has been deprecated for ages (~2005)
See The Zombie DirectX SDK and Where is the DirectX SDK?
As for what you are supposed to use instead, I have created a number of libraries to replace what was in D3DX9/D3DX10/D3DX11. See Living Without D3DX
For DirectX 12 development, the legacy DirectX SDK never supported it. Samples are on GitHub, and otherwise you are supposed to just use the Windows 10 SDK. I have a version of DirectX Tool Kit for DirectX 12 as well on GitHub. That said, if you are new to DirectX you should really consider starting with DirectX 11.
There is such a thing as D3DX12, but it's not quite the same thing as the older D3DX11 library. D3DX11 had code for loading textures, doing BC compression, etc. and required both a header and a runtime DLL. The only way to ship that DLL with your game was to use the legacy DirectX Setup.
D3DX12 is just a header of some helper functions. There is no DLL and no REDIST. It typically gets copied into a project when you create a DirectX 12 Visual Studio template, and you can download it from GitHub. For more information on D3DX12, see this blog post.
DirectX Tool Kit for DX11 and DX12, DirectXTex, DirectXMesh, DirectXMath, and UVAtlas provide much of what D3DX9, D3DX10, and D3DX11 did but supports both DirectX 11 and DirectX 12. They are all open source, so there's no DLL or REDIST: you just build it yourself from source. They are not "drop-in" replacements, but they provide the same functionality in a more Modern C++ form. They support any C++ program written for classic "Win32" development, Universal Windows Platform (UWP) apps, or Xbox One.
Really this is the primary topic I've been covering in my blog for the past decade. Lots of details there if you want more information on what's been happening.
UPDATE: While using the open source replacements for D3DX9/D3DX10/D3DX11 are still recommended, and easy to adopt for Direct3D 11 or Direct3D 12, there are of course lots of existing tutorials and codebases that use D3DX. To support these scenarios without the messy quirks of trying to use the legacy DirectX SDK with modern Windows SDKs, you can make use of the Microsoft.DXSDK.D3DX NuGet package. Using this package, I was able to republish all of the Direct3D 9 and Direct3D 10 legacy DirectX SDK samples to GitHub.

Rastertek DirectX11 Tutorials on Windows 10

I have been trying to work my way through Rastertek's DX11 Tutorials on my Windows 10 system, and have had a lot of trouble trying to get them to work. Most of the issues I have been having are ".exe was not found" when trying to run the solutions they provide, or errors with the d3dx11 library. Does anyone have experience getting these totorials working, or have any pointers on how to get them to work on my Windows 10 system?
Thank you!
Those tutorials are a quite dated with the use of the legacy DirectX SDK content like D3DX11. You can get these to work with some effort per the instructions on Microsoft Docs.
The legacy DirectX SDK doesn't install the Direct3D debug device on Windows 10. You enable it as a Windows optional feature instead. See this blog post.
Many books on Direct3D 11 are still relevant, but the details around the legacy DirectX SDK are all out of date. See this blog post for some notes.
I'd recommend taking a looking at the DirectX Tool Kit.

Direct3D (DirectX 9.0) Code Samples from codesampler [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I want to learn Direct3D from codesampler.
But this website can't open recently.
Is there anyone know how to download the sample code from this website, thanks in advance.
you can find the webpage and code sample data at wayback machine:
https://web.archive.org/web/20161003152649/http://www.codesampler.com/dx9src.htm
It looks like www.codesampler.com has lost their domain registry, and the Internet Archive Wayback Machine hasn't found that website since late 2016. It's probably just gone.
If you are looking to learn Direct3D today, you should focus on Direct3D 11. It's supported for Win32 classic desktop apps on Windows 7, Windows Vista SP2, Windows 8.x, and Windows 10. It's also supported on Xbox One and Universal Windows Platform apps. Direct3D 11 development is fully supported in modern versions of Visual Studio, and all the headers and the HLSL compiler you need are part of the Windows 8.x SDK and the Windows 10 SDK--you don't need to use the legacy DirectX SDK at all. You can find Direct3D 11 supporting replacements for all the deprecated D3DX library functionality as well.
MSDN
Where is the DirectX SDK (2015 Edition)?
Living without D3DX
DirectX SDK Samples Catalog
DirectX SDK Tools Catalog
There are indeed numerous resources online for learning Direct3D 11. Keep in mind that many of the Direct3D 11 learning resources were written prior to the deprecation of the legacy DirectX SDK, so they tend to focus on deprecated support code like D3DX11. I'd recommend starting with the DirectX Tool Kit for DirectX 11 tutorials, and once you work through those you can go back to resources like the rastertek.com tutorials knowing what's deprecated and what's not.
Getting Started with Direct3D 11
Book Recommendations
Direct3D 12 is also supported on Windows 10, Xbox One, and for the Universal Windows Platform, but it's an expert API that assumes you are already an expert on Direct3D 11. See Getting Started with Direct3D 12 and DirectX Tool Kit for DirectX 12.
Direct3D 10.x is fully replaced by Direct3D 11. There's no need to use Direct3D 10.x at all on any platform. Direct3D 11 supports all the Direct3D 10.x era hardware and more through the Direct3D hardware Feature Level mechanism, and is available on all supported versions of Windows that had Direct3D 10.x.
Direct3D 9 is a legacy API, and while its still supported for application compatibility purposes, a lot of the behavior is emulated on modern versions of the OS. Debugging and development support for Direct3D 9 on modern versions of Windows is minimal. Furthermore, the only place to get samples and utility libraries for Direct3D 9 is the legacy DirectX SDK. The only case where it makes sense to use Direct3D 9 for an application is if you have to target Windows XP Service Pack 3 or Windows Server 2003 Service Pack 2. See this post for some important information on this scenario.

directx sdk on windows 8

This is my first post here and please apologize me for my very poor English.
Current state:
I have a project that is very advanced, until now i use the DirectX SDK from June 2010, and several other librarys (Assimp, FreeImage, Bullet etc....).
My development environment is Win7, with VS2010 professional (win sdk 7.1A).
My question is, must i rewrite my DirectX code (with win sdk 8) to support windows 8?
I have searched around the web, and the only post that i find was the blog from Chuck Walbourn "http://blogs.msdn.com/b/chuckw/archive/2012/03/22/where-is-the-directx-sdk.aspx".
Thank you in advance
Behnam Karaj
(From Stuttgart - Good Old Germany)
No, you can use DirectX SDK and Windows SDK 7.1A. It will work in Windows 8. But you will can not use it's new features, and cannot make Windows Store Apps.
Also, if you want to migrate to Windows 8 SDK, you don't need change much in your code, just a headers and some functions names and parameters.
If you want make Windows Store Apps you need to to migrate to Windows 8 SDK and cut some things such as D3DCompiler.h, Effects framework etc.

OpenGL in WIndows7

I want to write code in OpenGL using Visual Studio 2010 . Now on opening opengl.org , I am redirected to http://user.xmission.com/~nate/glut.html ; which presumes I am using WindowsXP and Visual Studio 6 . The instructions in this page http://user.xmission.com/~nate/glut/README-win32.txt dates back to 2001 , and not in current context .
Long story short, is there any tutorial which will help me to program with OpenGL in Windows 7 using Visual Studio 2010 .
Thanks in advance for taking the time to answer my question . I am new to this , so please bear with me.
OpenGL development under Window-7 is the very same as it has been for Windows-NT 4, Windows 2k and Windows XP. All the tutorials remain valid.
You do not require a OpenGL SDK. Everything you need ships with your compiler. OpenGL is not a library, but an API implemented by the drivers. So make sure you download and install the most recent drivers directly from your GPU's vendor's homepage (don't use the drivers shipping with Windows, because those have only very limited support for OpenGL).
Since you surely want to use recent OpenGL functionality you should however get the GLEW library, which eases up the loading process for the so called "extensions" by several orders of magnitude; highly recommended. Then instead of the regular OpenGL header you include GL/glew.h and call glewInit() right after an OpenGL context has been made active.
Instead of the old, outdated, no longer maintained GLUT, you should use FreeGLUT or OpenGLUT; if using GLUT at all, because you'll hit its limitations very soon. I recommend using GLFW instead.
First of all, configure your project to link with opengl32.lib etc.:
OpenGL config in Visual Studio 2010.
Look at some NeHe tutorials http://nehe.gamedev.net/.
What about Visual Studio 2010 and Windows 7 - I don't think there is some significant differences in API with previous versions of Visual Studio and Windows (at least for simple examples).
Also look at: OpenGL API Documentation Overview