RamblingBaba said:
I was wondering what the coding difference is between DirectX7 - DirectX9 and DirectX11?
ok so i assume that u understand that the fundamental concept in rendering a 2D or 3D object is essentially this:
2D and/or 3D Object → Renderer → Image
Then the renderer can be a DX7 renderer, a DX9 renderer or DX11 renderer or later…
Now, here are some of the differences between dx7, dx9 and dx11 :
- the way you would feed your 2D/3D Object data to each of these renderers has changed over the years
- the output image produced by each of these renderers for this Object data has improved over the years
- With DX7 the image rendering was purely done through a fixed rendering pipeline, today with DX11 or later, this pipeline is no longer fixed (it is programmable)
- and more… (performance, stability, picture clarity, etc…)
RamblingBaba said:
If I was to follow along using DirectX11 would I run into a lot of problems?
If you follow DX11 books or tutorials, you would be more update with current methods of rendering than with DX7. If you stick to DX7 in hope that you can easily switch to DX11 or later in the future, you would indeed run into a lot of problems because of the vast differences between them. Even DX12 has already got many differences from DX11;
These differences emerge because the hardware manufacturers of video cards keep evolving those cards. They never wait ?
For example, if you don't know what a Raytracer is or a Mesh Shader is then you need to catch up. I won't explain those here, but these are new Rendering features which are now supported on hardware running with DX12, which were not supported by hardware running with DX7;
So it's good idea to catch up with DX11 or DX12 if u can;
RamblingBaba said:
Basically, I was wondering how much has changed between the 3 versions? In what areas is it totally different and wouldn't translate directly. I'm sure some of it is the same? I hope that makes sense.
The fixed rendering pipeline aspect does not translate to the programmable rendering pipeline.
You cannot use a D3DLIGHT7 (or whatever it was in DX7) in the new DX11/DX12. In fact there is no D3DLIGHT structure anymore;
Some of it is the same? well, errm… I was going to say ‘yes’ but ‘no’ is better -lol-.
DirectX still uses COM-interfaces that's the same, initialising DESC structs to 0, oh yeah that's the same… that's it, the rest is different
-lol-
In DX7, you had a device; in DX11 you now have a device and a context;
RamblingBaba said:
Besides being cross-platform what are your thoughts on OpenGL vs DirectX? What about when it comes to 2D games?
As u rightly say, besides the cross-platform aspect, u can use either - i've used both, i see no issue - best is to create your renderer to work with both, some like this:
// pseudo
class renderer
{
abstract interface
};
class ogl: public renderer
{
ogl-specific render code
};
class vulkan: public renderer
{
vulkan-specific render code
};
class dx12: public renderer
{
dx12....
}
void CallOfDutyGhosts::create_renderer( )
{
renderer* r = new dx12(); // or new ogl() // or whatever..
// this way your game is renderer agnostic
r->create_device( );
...
}
That's it!
Anything not clarified here or explained in its entirety, i leave as an exercise for you to research and find out ?
All the best ?