Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 27 Nov 2013
Online Last Active Today, 09:29 AM

Posts I've Made

In Topic: Understanding the purpose of a code snippet from Diredt3D tutorial, and some...

16 October 2014 - 08:48 AM

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.

In Topic: Questions on first Win32 windows application

04 October 2014 - 09:30 AM

Ohhhhh.. thanks.. for some reason I thought it was a built in windows function, I forgot they declared it as that name in the function prototype.

Thanks for clearing that up

In Topic: Questions on first Win32 windows application

04 October 2014 - 08:28 AM

Thank you wintertime, may I please have clarification on the following things:


3. Its a callback you provide, only the function address matters and you can choose any name you like for it. Under some circumstances it may be even useful to have more than one.


What I was actually referring to was the WndProc() function. In some win32 examples I have seen WinProc() written instead, and cannot understand the difference between these two functions.



5. You cant just add a magic number to a (hidden) pointer and expect the program to still work. Read up on what alternative values you can provide to change it.


In this case, I was just mucking around to see what that option did. But what I was trying to ask, is in the case that the RegisterClassE() fails (such as it did when I entered an invalid number), how is one supposed to make sure the program shuts down correctly and does not sit in task manager?


Thanks again for your time and knowledge.

In Topic: Mapping problem onto a 2D quad

30 March 2014 - 07:34 AM

It just looks like your texture co-ordinates are not being mapped correctly. I haven't had a good look at your code, but this is what I use to texture a full image to a quad. You do have to be very careful which texture coordinates you map to which point on your quad (and in the correct order).

    SimpleVertex vertices[] =
        { XMFLOAT3(-1.0f, -1.0f, 0.0f), XMFLOAT2(0.0f, 1.0f) },
        { XMFLOAT3(-1.0f, 1.0f, 0.0f), XMFLOAT2(0.0f, 0.0f) },
        { XMFLOAT3(1.0f, -1.0f, 0.0f), XMFLOAT2(1.0f, 1.0f) },
        { XMFLOAT3(1.0f, 1.0f, 0.0f), XMFLOAT2(1.0f, 0.0f) },

In Topic: Highly confused about simple quad texturing

01 February 2014 - 11:37 PM

I finally got around to making this work in its own separate program so thanks. I have a question though:


Right now my 'game' consists of primitive shapes that just have a color, and textured shapes which are the walls. When compiling the game objects and shaders, it is better to use separate .fx files for each different game asset, or just add everything you need in one big shader file.


I hope the question makes sense because I am still quite confused about vertex and pixel shaders.


Thanks again