Abc of DirectX

28
of DirectX-- Prabodh Pand

description

An Introduction to Computer graphics and DirectX

Transcript of Abc of DirectX

Page 1: Abc of DirectX

of DirectX… --

Prabodh Panda

Page 2: Abc of DirectX

Agenda

• Warm Up– Graphics Card – Computer Graphics– Image Types– GDI / GDI+– OpenGL (Open Graphics Library )

• Introduction to DirectX– History – Architecture– Library

• DirectX vs OpenGL

• Demo

• Hello world Program

• Questions & Discussions

Page 3: Abc of DirectX

Warm Up …

Page 4: Abc of DirectX

Graphics Card

• Part of the computer that controls and enhances graphics(Picture, Video, 3D animation) that are displayed in the computer screen.

• Types of Graphics card :– AGP– PCI– On Board

Page 5: Abc of DirectX

Computer Graphics

• Representation and manipulation of Image data by a computer.– The development of CG has made it easy for us to interact with the computer.– CG has brought about a revolution in the fields of :

Animation Movies(Spl. Effects) Video Games Scientific Research Industrial automation Flight Simulation

Page 6: Abc of DirectX

Image Types

• 2D Computer Image– Raster Image– Vector Image

• 3D Computer Image

Page 7: Abc of DirectX

Raster Graphics

• It is a data structure representing a rectangular grid of pixels or points of colors.

Page 8: Abc of DirectX

Vector Graphics

• It uses geometrical primitives like points, lines, curves & Polygons) based on mathematical equation to represent Images.

Page 9: Abc of DirectX

Raster vs. Vector

Page 10: Abc of DirectX

3D Computer Graphics

• The use the 3 dimensions (X,Y & Z) axis for the representation of image data.

Page 11: Abc of DirectX

Computer Generated Imagery (CGI)

• Popularly known as Computer Animation.• It is the field of Creating 3D images move.• Movie Industry

– Animation Movies– Generating Spl. Effects

Page 12: Abc of DirectX

GDI / GDI+

• Enables window based Application to use graphics and formatted text on both video display and printer.

• Drawing fonts ,Lines , Curves and handling palettes.

Window Application

GDI / GDI+

Window Graphics Driver

x

• GDI cannot access complex graphics and needs OpenGL or DirectX for graphics rendering.

Page 13: Abc of DirectX

GDI / GDI+ Objects in MFC

Page 14: Abc of DirectX

OpenGL

• Open Graphics Library (OpenGL) is a cross platform API for 2D/3D computer graphics.

• OpenGL was developed by Silicon Graphics Inc. (SGI) in the year 1992.• Cross platform (Windows, Linux and Mac OS)• Used in

– CAD– Virtual Reality– Flight simulation– Scientific – Video Games

vs.

Page 15: Abc of DirectX

DirectX

• Low level API’s Provided by Microsoft for – Creating Games– Multimedia Application– 2D and 3D Support– Network Application (e.g. Multiplayer games)

• Works only with windows Platform(95/98/ME/2000/xp/vista/Win 7)– Released Version 1.0 to latest Version 11.0– Win Xp Supports DirectX 9.0– Vista Supports DirectX 10.0– Win 7 Supports DirectX 11.0

Page 16: Abc of DirectX

History

• Craig Eisler, Alex St. John, and Eric Engstrom creators of DirectX.• Direct Access : DirectX (Video Cards, M, Sound Device and other Hardware). • DirectX1.0 -- Sep 1995 as Windows Games SDK.• DirectX 11.0 is the latest SDK.

Page 17: Abc of DirectX

Architecture

Page 18: Abc of DirectX

HAL / HEL

DirectX uses two drivers to send request to graphics hardware devices • Hardware Abstraction Layer (HAL) : Uses hardware function capability.• Hardware Emulation Layer (HEL) : Use to emulate capability through software.

Device Driver Interface (DDI)• It is layer to allow high level computer programs to interact with hardware devices

Page 19: Abc of DirectX

Library

DirectX is SDK composed of collection of COM libraries

• Direct3D– API to provide 2D and 3D graphics.– Setting resolution to the screens.

• DirectInput– All user input is handles through API.– It supports devices such as keyboard, mouse, gamepad and joysticks.

• DirectPlay– Network Support like multiplayer API.

Page 20: Abc of DirectX

Library (cont…)

• DirectSound– API for Sound Effect.– Include Support for more than One or more sound files.

• DirectMusic– Allow to make dynamic soundtrack.

• DirectShow– Accessing Cut Scenes.– Streaming Audio (mp3, AVI, MPEG..).

• DirectSetup– Create a Setup wizard for your game.

Page 21: Abc of DirectX

DirectX vs. OpenGL

Controlled by Microsoft.

Gaming and Multimedia Programming

Support Windows OS.

Difficult to Learn (Less Documentation provided)

API : COM

Vertex Blending : Yes

Two-sided lighting: No

Controlled by ARB OpenGL

General Purposes 2D and 3D graphics.

Platform Independent (Window, Linux, Unix and Mac )

Easy to learn.

API : Includes and Library

Vertex Blending : NA

Two-sided lighting: Yes

Page 22: Abc of DirectX

DirectX SDK• MSDN website

Page 23: Abc of DirectX

Visual Studio Setup

Page 24: Abc of DirectX

My First DirectX Program..

Page 25: Abc of DirectX

Demo

Page 26: Abc of DirectX

Books & References

Page 27: Abc of DirectX

Questions & Discussions

Page 28: Abc of DirectX

Thank You all…