Post on 01-Nov-2014
description
of DirectX… --
Prabodh Panda
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
Warm Up …
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
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
Image Types
• 2D Computer Image– Raster Image– Vector Image
• 3D Computer Image
Raster Graphics
• It is a data structure representing a rectangular grid of pixels or points of colors.
Vector Graphics
• It uses geometrical primitives like points, lines, curves & Polygons) based on mathematical equation to represent Images.
Raster vs. Vector
3D Computer Graphics
• The use the 3 dimensions (X,Y & Z) axis for the representation of image data.
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
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.
GDI / GDI+ Objects in MFC
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.
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
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.
Architecture
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
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.
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.
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
Visual Studio Setup
My First DirectX Program..
Demo
Books & References
Questions & Discussions
Thank You all…