|
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.

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
| You must Sign In to use this message board. |
|
| | Msgs 1 to 11 of 11 (Total in Forum: 11) (Refresh) | FirstPrevNext |
|
|
 |
|
|
sir i have a simple problem the problem is that i have two devices in Direct3D with names dev1 and dev2 both represent some figure say dev1 represent cube and dev2 represent triangle i want something like that when i run programe it draws cube and there is command button when i clink that button then triangle should be present but the previous cube should not be disappeared. that is both should be drawn to the screen.
Muhammad Imran
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Why you're using 2 devices??
Mohamed Meshref Computer Science Ain Shams (4) http://www.programmingplanet.net IT and Game Developer N.E.T Egypt http://www.egnet4u.com Microsoft DirectX Beta Tester NVidia Registered Developer
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
sir actually the problem with me is that i have a project in which i have to some figures like point, lines, planes and curves in Direct3D.now what i have to do is that when i program starts it draws a three dimenstional structure say that x,y and z axes, now user enter some sort of equation say equation of plane or line. i have to show that line, for this, idea in my mine is that the axes are in one device and then the line or plane are in second one when programe starts it draws first one and then after clicking some command button it draws the second on the first, that is the first should not disappeared and the second is also present that i want drawing in that axes, this is the whole problem thanks for reply
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
sir actually the problem with me is that i have a project in which i have to some figures like point, lines, planes and curves in Direct3D.now what i have to do is that when i program starts it draws a three dimenstional structure say that x,y and z axes, now user enter some sort of equation say equation of plane or line. i have to show that line, for this, idea in my mine is that the axes are in one device and then the line or plane are in second one when programe starts it draws first one and then after clicking some command button it draws the second on the first, that is the first should not disappeared and the second is also present that i want drawing in that axes, this is the whole problem thanks for reply
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
sir actually the problem with me is that i have a project in which i have to some figures like point, lines, planes and curves in Direct3D.now what i have to do is that when i program starts it draws a three dimenstional structure say that x,y and z axes, now user enter some sort of equation say equation of plane or line. i have to show that line, for this, idea in my mine is that the axes are in one device and then the line or plane are in second one when programe starts it draws first one and then after clicking some command button it draws the second on the first, that is the first should not disappeared and the second is also present that i want drawing in that axes, this is the whole problem thanks for reply
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
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
sounds like u are a superman, but yr article is a sh*t
|
| Sign In·View Thread·PermaLink | 1.80/5 (2 votes) |
|
|
|
 |
|
|
First, lose the bold/strong formatting on the text. It makes your article very difficult to read. Have a look at other articles such as A guide to writing articles for Code Project[^]
Secondly. You have an interesting writing style, writing as if you were speaking, giving a lecture. It doesn't work for me. I find it very jarring, but that may be down to language/translation problems. I'm assuming English isn't your first language.
Finally. I think you need to add more content to the articles. This article doesn't contain much information. You seem to be doing a series of articles on Direct X. Perhaps you may want to combine a number of lessons into one article, so that you have some useful content in each article.
Michael
CP Blog [^]
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
|
 |
|
|
Who's the Mr. Lazy talker?
Mohamed Meshref Computer Science Ain Shams (4) http://www.programmingplanet.net IT and Game Developer N.E.T Egypt http://www.egnet4u.com Microsoft DirectX Beta Tester NVidia Registered Developer
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I love the scheme, but what are you trying to show us? I don't see any explaination how to exactly initialize a device in Direct3D.
"Every rule in a world of bits and bytes can be bend or eventually be broken"
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Iam trying to make a DirectX lessons, i had explained what's meant by DirectX device and what's meant by initializing it, the real initialization is inside the Code i had attached with the article
Mohamed Meshref Computer Science Ain Shams (4) http://www.programmingplanet.net IT and Game Developer N.E.T Egypt http://www.egnet4u.com Microsoft DirectX Beta Tester NVidia Registered Developer
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
General News Question Answer Joke Rant Admin
|