Hello sir, thank you for your reply
May I ask you to check my understanding to make sure have some kind of ideas whats going on:
Question 1. What is the physical meaning of "enumerating graphics adapters", and "enumerating display modes"?
Question 2. With this in mind, what exactly are DXGI objects?
DXGI is the DirectX Graphics Interface. Its just a COM object that's used to query which GPUs your system has (some people have more than one) and to create SwpChain objects.
So to describe simply what is going on, "enumerating graphics adapters" means going through the system and seeing what gpus are available to use (such as an integrated one into a cpu, or a dedicated hardware card). "enumerating display modes" on the other hands looks what physical monitor is connected to these gpu's and what its resolution and properties are (such as the specs of a Dell monitor running?)
Question 3. Can someone please explain why this dxgiDevice is added now? What is its purpose? Why is it useful? Why do we WANT it?
Question 4. Why are we doing this? What is this actually doing or looking at physically (as in terms of computer hardware...?)
We are adding this object, because its job is to search for the GPU's and provide us access to work with them
A SwapChain is what binds a D3D render target to a window. It also provides some related services like handling full screen transitions, double and triple buffer mode, etc.
These terms still confuse me no matter how much I read their descriptions. So the SwapChain could be visualized as follows:
In this case I am trying to show a very simple idea of a swapChain consisting of a 30x30 final render area (on our monitor). Each square represents a possible pixel that we will see? SO it is literally two areas of memory where each block holds the final color (after some fancy DX maths)?
The render target still confuses me... the MSDN says "A render target is a memory buffer for rendering pixels.".. How is that different from the swap chain? is it just some other random area that is not the swapChain? (Like the equivalent of system RAM??) Is it held on the GPU or inside the RAM?
The CreateDevice and CreateDeviceAndSwapChain functions are helpers that create said objects using the default DXGIFactory. Unfirtubstrly they don't return the factory so if you need it for anything else you have to do the COM query dance you see in this code.
So once we have our device (the IDE's representation of our video card?) and the swap chain (somewhere on the video card...?). I dont fully understand what you mean by "they dont return the factory"? Is this "factory dance" used to just fully find out all possible gpus that we can use for DirectX on the current system?
Some people create the device without a swap chain shey write code like this to grab the factory from the device and then create the swap chain. Using CreateDrviceAndSeapChain you wouldn't have to do this.
Again I am not 100% sure what you mean by "grab the factory from the device"...
Is there a way to visualize these kinds of thing such as what exactly each function is looking at or doing in terms of the non video side of things:
(motherboard, cpu, ram),
and video side
(video card, video cards cores, video cards ram).
Eg. the swap chain is created on the video cards ram? But we need to know where the hardware address is in order to program it to the IDE...? Am I on the right track?
Thanks again for all your time.