Click here to Skip to main content
Licence 
First Posted 28 Aug 2004
Views 62,797
Downloads 867
Bookmarked 9 times

DirectX Lessons, Lesson 2 (Direct3D Device Initialization)

The second lesson in the DirectX lessons in C#
24 votes, 96.0%
1

2

3

4
1 vote, 4.0%
5
1.00/5 - 25 votes
1 removed
μ 1.09, σa 1.40 [?]

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

Web Developer

United States United States

Member
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

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralMy vote of 1 Pinmemberpolygon20002:29 7 Oct '10  
GeneralMy vote of 1 Pinmemberfpnt10:24 10 Jan '10  
GeneralSome help is required PinmemberMohd Imran18:57 22 Nov '04  
GeneralRe: Some help is required PinmemberMohamed Meshref19:53 22 Nov '04  
GeneralRe: Some help is required PinsussAnonymous22:55 22 Nov '04  
GeneralRe: Some help is required PinsussAnonymous22:59 22 Nov '04  
GeneralRe: Some help is required PinmemberMohd Imra23:03 22 Nov '04  
GeneralMy knowledge includes: --> PinsussAnonymous10:14 30 Aug '04  
GeneralA few thoughts PinsupporterMichael P Butler5:30 30 Aug '04  
GeneralF U C K, post sth on yr own code! PinsussAnonymous4:53 30 Aug '04  
GeneralRe: F U C K, post sth on yr own code! PinmemberMohamed Meshref5:11 30 Aug '04  
QuestionWhat are you trying to explain? PinmemberWillemM0:27 29 Aug '04  
AnswerRe: What are you trying to explain? PinmemberMohamed Meshref1:13 29 Aug '04  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120210.1 | Last Updated 29 Aug 2004
Article Copyright 2004 by Mohamed Meshref
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid