🎉 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!

I want to learn C++ Directx9

Started by
10 comments, last by bmarci 1 year, 3 months ago

Hello, I would like your help on a subject that I have been trying to learn for a long time.

I have basic c++ knowledge but no knowledge of directx9 at all. The project I was working on was using directx8,
I updated the libraries and source codes to directx9.

Naturally, they didn't do me any good. New Directx9 compatible lightings, new shadows, new filters, new alpha channels etc. I want to use it, but unfortunately I have no information about how they are created, how they are applied and how they should be designed. I couldn't find a clear guide on this either. For example, how can I learn about the usage logic of concepts such as SaveTransform and SetTexture? I would really appreciate if you have examples that you can share with me.

Sorry for the bad english, thanks.

Advertisement

If you have no knowledge of DX9 then you should learn DX9 first. There are many tutorials on the web, try searching "DirectX9 tutorials" or grab a book on DX9.

cvaqabond said:
The project I was working on was using directx8

DX8 released November 2000, superseded in December 2002. End of life back in 2006.

cvaqabond said:
I updated the libraries and source codes to directx9.

DX9 released December 2002, with suplemental version 9.0b, 9.0c, and 9.0ex. It was superseded in November 2006. End of life began in 2010.

DirectX 10 ended support back in 2016.

DirectX 11 was tied to Windows 7 with an End Of Life in 2020.

DirectX 11.1 was tied to Windows 8 with an End Of Life two months ago, January 2023.

You are knowingly using technology that is 20 years old and has been past end of life support for more than a decade. It has been superseded five times now. No video cards still officially support it, and they won't be fixing any bugs or issues.

If you honestly intend to use DirectX 9, you should use tools, tech, and hardware from 2008 or so, just before support ended. That means using the Windows XP SDKs, probably Visual Studio 2008, and hardware (and drivers) from about a decade ago. If you can find some old MSDN Library sources from that time frame — people may still have binders of disks from that era — that have the documentation on there.

cvaqabond said:
I couldn't find a clear guide on this either.

This follows naturally from the dates above. I imagine most of those tutorials went away with GeoCities collapse back in 2009.

You might find some old books that people didn't throw out or some old online guides that nobody has bothered to update in the past decade. Honestly, the rest of the world has moved on.

Repeating from the earlier segment, I'd look for any sources of the 2008 MSDN Library, I'm sure it's available online if you hunt for it.

Hello. As my name suggests, I use DirectX 9.

cvaqabond said:

For example, how can I learn about the usage logic of concepts such as SaveTransform and SetTexture? I would really appreciate if you have examples that you can share with me.

The DirectX 9 SDK (June 2010) has a lot of code samples and documentation which are invaluable. The documentation is mirrored onto the Microsoft website. Beyond that, books and tutorials may help provide some more intuition for DirectX 9 concepts.

frob said:

End of life began in 2010.

This is not true. DirectX 9 is still “minimally supported” by Microsoft.

frob said:

If you honestly intend to use DirectX 9, you should use tools, tech, and hardware from 2008 or so, just before support ended. That means using the Windows XP SDKs, probably Visual Studio 2008, and hardware (and drivers) from about a decade ago.

It runs fine on newer hardware, and is currently maintained through a DX9→DX12 mapping layer. Here is quote from Microsoft's recent article on DX9:

“Microsoft is committed to bringing you a great gaming experience and in honor of the 20th anniversary of DirectX 9, we’re happy continue our dedication to the API through DirectX 9-on-12 Mapping Layers, which will ensure that gamers can continue to enjoy their favorite games for another 20 years. ”

There is also a DX9→Vulkan mapping layer.

Microsoft provides an emulation layer, but it isn't officially supported. If it happens to work for you then good, but that's the extent of it. Microsoft provides a software emulation layer, and a software-based renderer that may or may not take advantage of hardware acceleration.

With Windows 7 Microsoft created a DirectX9On11 driver that tried to re-implement the drivers and did an okay job. Not perfect, they were clear it was officially unsupported, but for the most part okay.

ATI/AMD ended support back in 2009, no longer officially supported as of Windows 7 and DX11. The games would continue to run and they offered to work with an emulation layer, but hardware support was no longer official. It was up to Microsoft's emulation levels to make up the difference.

NVidia lasted about a year longer, ending their official support in 2010, but still quickly following suit. Windows 7 technology was DX11, not the then-8-year-old technology of DX9. NVidia bowed out, Microsoft's emulation layers were to handle it, and Microsoft's emulation did a pretty good job.

Intel was probably the biggest supporter of DX9, but even they dropped native support about a year ago, lasting surprisingly long in my opinion.

With WIndows 10 Microsoft has switched to use D3D9On12​ drivers, which they released as an open source implementation of a D3D9 driver that re-implements the D3D9 interface using D3D12 commands along with software compositing and rendering. You don't see them on your computer unless you go looking, they're rather silent but still present on modern machines, you can go enumerate your driver details to see them. The implementation comes with no official support, but if you implement missing functionality or a fix you can submit a pull request. If it happens to work for you, great. You'll find these wrappers in the Windows\SySWOW64 directory and the various WinSxS compatibility directories.

Again, it is certainly a thing you can do if you're in to retro computing and outdated hardware and software, but don't expect many tutorials to have survived. It is NOT something I'd recommend in For Beginners. I'll only point out MSDN Library from 2008 and the 2008-era tools because that's when it was supported, and you can still find them around, coupled with a recommendation to use 2023's interfaces for programs you develop today.

I used DX9 some years back. Frank Luan's book pretty good for that. However, there really isn't a lot of reason not to go at least to DX11. I'm on DX12 now but that does come with a lot of added complexity and a big learning curve. But IMO jumping to DX11 should be fine.

+1 on @gnollrunner 's suggestion.

Imho 12 and 11 will likely live beside each other for quite a while, because as mentioned it's not ‘just an update on 11’, but a different way of approaching things (which I agree is more complex if you start with DX).

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me

Thanks everyone for all the suggestions.

Yes you are right Dx9 is very old, I would like to work with newer versions like dx11. However, as I mentioned, since I am very unfamiliar with this subject, it is not easy for me to switch versions. Maybe one day I'll be able to upgrade to more current versions after I get some knowledge.

Upgrading from dx8 to dx9 is easy, but upgrading from dx9 to higher versions is more difficult.
I will consider all your suggestions, I hope I succeed. Thanks again <3

You might would better off with opengl, you can make an engine with that supports not just the latest, but the very ancient hardware as well, not to mention linux, android and other non-microsoft platforms.

But les say you continue with directx9. First of all. You have updated from dx8 to dx9. I assume this means it compiles and works. Whats the problem then? Why you want to use previously unused features just for the sake of using them? You doesn't necessary need new unknown features especially if you were fine without them up to this point. Just because it has new functions, that doesn't means you HAVE to use every single one of them for your product :D

This topic is closed to new replies.

Advertisement