5,427,303 members and growing! (15,665 online)
Email Password   helpLost your password?
Multimedia » General Graphics » General     Intermediate

DirectX Lessons, Lesson 2 (Direct3D Device Initialization)

By Mohamed Meshref

The second lesson in the DirectX lessons in C#
C#.NET 1.1, Win2K, WinXP, Win2003, Vista, Windows, .NET, TabletPC, DirectX, Visual Studio, VS.NET2003, Dev

Posted: 28 Aug 2004
Updated: 28 Aug 2004
Views: 43,088
Bookmarked: 4 times
Announcements



Search    
Advanced Search
Sitemap
23 votes for this Article.
Popularity: 1.49 Rating: 1.09 out of 5
22 votes, 95.7%
1
0 votes, 0.0%
2
0 votes, 0.0%
3
0 votes, 0.0%
4
1 vote, 4.3%
5
Note: This is an unedited contribution. If this article is inappropriate, needs attention or copies someone else's work without reference then please Report This Article

Introduction

This is the second lesson in the Game Programming Using DirectX within C#, there's some thing i had forgotten to include in my first lesson, in order to run these lessons in your machine, you must have Microsoft Visual C# 2003 With .Net framework 1.1 and Microsoft DirectX Sdk 9C with managed DirectX installed on your machine.

 

Now back to our lesson,  now we had reached the beginning of our party, so what?s the Direct3D initialization?

Before answering this Question, we must know about some terminologies used by Direct3D, the most important term of them is the Device, so what?s the Device?

 

Every pc nowadays has a graphics card, we have hundreds of models, with variety of capabilities, so do we need to maintain a different ways to react with different cards, in other ways do we need to make a code to act with every card model?

No, because if this is true, no one will play any game, cause imagine you had packed you game, and after that a new card had been launched, if these words are true, your game wont work on the new card, so how we maintain the workability of our game on all cards?

Direct3D had answered this question for us, by using what?s known by Device, the rule played by the device is so easy, simply every card vendor make what?s known by Card Driver, which is an Interface to handle any specified use to the card, Direct3D simply uses this Drivers which have fixed framework whenever the vendor is, we?ll look now at this model.

This model is known by HAL (Hardware Abstraction Layer), The HAL is a device-specific interface, provided by the device manufacturer, that Direct3D uses to work directly with the display hardware. Applications never interact with the HAL. Rather, with the infrastructure that the HAL provides, Direct3D exposes a consistent set of interfaces and methods that an application uses to display graphics, for more information about this topic feel free to see the DirectX SDK.

Sample screenshot

 

Now we had known all what we need about the Device, so initialization is simply to initialize the Device object, in other words to choose its working modes, like resolution, color depth, type of vertex processing and so on, we?ll cover all these topics along we go through our course, but for now we are gonna just initialize the Device by the most simple properties to work with it in window mode without much capabilities.

 

Now the second lesson had been finished, and we'll jump into the third lesson in the part 3.

 

Mohamed Meshref

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Mohamed Meshref


I am a normal person, who likes Physics, Meta-Physics, Space Exploring, reading, computer and game programming, and watching movies.

My knowledge includes:

C,C++, STL, Visual C++ and MFC, Visual Basic, Visual Basic.Net, .Net Windows Forms, Assembly, Java and Java Applets, ASP.Net, Game Programming with DirectX, Com ATL and WTL, Prolog, Data Structures and Algorithms, Win32 Programming, Win32 Hooking and Interception, Win32 Cracking and System Debugging, Windows Sockets and Networking, Proxy Chaining and Proxy Communications, GDI/GDI+, ADO.Net, Sql Server 2000, XML, Oracle Designer and Developer
Occupation: Web Developer
Location: United States United States

Other popular Multimedia articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 11 of 11 (Total in Forum: 11) (Refresh)FirstPrevNext
Subject  Author Date 
GeneralSome help is requiredmemberMohd Imran18:57 22 Nov '04  
GeneralRe: Some help is requiredmemberMohamed Meshref19:53 22 Nov '04  
GeneralRe: Some help is requiredsussAnonymous22:55 22 Nov '04  
GeneralRe: Some help is requiredsussAnonymous22:59 22 Nov '04  
GeneralRe: Some help is requiredmemberMohd Imra23:03 22 Nov '04  
GeneralMy knowledge includes: -->sussAnonymous10:14 30 Aug '04  
GeneralA few thoughtssupporterMichael P Butler5:30 30 Aug '04  
GeneralF U C K, post sth on yr own code!sussAnonymous4:53 30 Aug '04  
GeneralRe: F U C K, post sth on yr own code!memberMohamed Meshref5:11 30 Aug '04  
GeneralWhat are you trying to explain?memberWillemM0:27 29 Aug '04  
GeneralRe: What are you trying to explain?memberMohamed Meshref1:13 29 Aug '04  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 28 Aug 2004
Editor:
Copyright 2004 by Mohamed Meshref
Everything else Copyright © CodeProject, 1999-2008
Web18 | Advertise on the Code Project