Click here to Skip to main content
6,595,854 members and growing! (18,306 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, TabletPC, DirectX, VS.NET2003, Dev
Posted:28 Aug 2004
Views:52,668
Bookmarked:6 times
Unedited contribution
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
23 votes for this article.
Popularity: 1.49 Rating: 1.09 out of 5
22 votes, 95.7%
1

2

3

4
1 vote, 4.3%
5

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


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
Occupation: Web Developer
Location: United States United States

Other popular General Graphics articles:

  • A flexible charting library for .NET
    Looking for a way to draw 2D line graphs with C#? Here's yet another charting class library with a high degree of configurability, that is also easy to use.
  • CxImage
    CxImage is a C++ class to load, save, display, transform BMP, JPEG, GIF, PNG, TIFF, MNG, ICO, PCX, TGA, WMF, WBMP, JBG, J2K images.
  • 3D Pie Chart
    A class library for drawing 3D pie charts.
  • Barcode Image Generation Library
    This library was designed to give an easy class for developers to use when they need to generate barcode images from a string of data.
  • ImageStone
    An article on a library for image manipulation.
Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 11 of 11 (Total in Forum: 11) (Refresh)FirstPrevNext
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  
GeneralWhat are you trying to explain? PinmemberWillemM0:27 29 Aug '04  
GeneralRe: What are you trying to explain? PinmemberMohamed 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-2009
Web17 | Advertise on the Code Project