This is a mirror of official site: http://jasper-net.blogspot.com/

Understanding Direct3D 10 Application Code

| Thursday, December 30, 2010
Understanding Direct3D 10 Application Code

Preface

Nearly everything you do in Direct3D is done to manipulate the graphics hardware itself. This is why DirectX is not so much a game platform as it is a hardware interface. The most important piece of hardware that we are concerned with is called the GPU, or graphics processing unit. The GPU is a separate integrated circuit chip that executes "shader" files. Think of shaders as mini programs that are executed on the GPU: they are written in HLSL and loaded as FX (effect) files, having an .fx file extension. While the CPU (microprocessor) performs calculations that can direct the entire system, the GPU performs calculations on graphics, directing graphics output to the monitor. This is why it is good idea to ascertain the capabilities of your machine’s graphics hardware. Identify your GPU (and its capabilities) by going to the “download latest drivers update” section of http://www.nvidia.com.  

Making any Direct3D program requires one to first create a window, a standard window identified by a window handle. You can use the normal Win32 API functions or other technologies like MFC. The purpose of creating a main window is to receive messages and provide a canvas upon which Direct3D will render drawings or images. Direct3D will draw all of its data onto this window. Upon creating the Direct3D object, we then create the Direct3D device. The Direct3D device is the most important interface in Direct3D.

The DirectX Graphics Infrastructure: DXGI

Since all our rendering is done with a Direct3D device, the first thing we need to do is construct a device. This also involves constructing a swap chain, consisting of a back buffer and primary surface. Doing this requires us to fill out a structure called DXGI_SWAP_CHAIN_DESC and then call the D3D10CreateDeviceAndSwapChain() function. These structures will be discussed after our first example. The DXGI is a component that lies at the base of all of the most recent versions of Direct3D. It handles the fundamental tasks involved with Direct3D, such as verifying the appropriate resolution rate and displaying images on the screen. DXGI is not actually a part of the DirectX API, but rather underlies it and other graphic components. That is, it acts as an interface between Direct3D and the hardware.

Read more: Codeproject

Posted via email from .NET Info

0 comments: