newbie question
- From: "PJ6" <noone@xxxxxxxxxxx>
- Date: Fri, 25 Aug 2006 14:00:21 -0400
I'm just starting to learn DirectX and have taken in a few things that are a
bit hard for me to swallow. Below (end of post) I take a quote from one of
the more newbie-informative posts I've found anywhere (thanks, Stephan). My
impression, coming from a background of developing WinForms controls with
GDI+, is that DirectX is utterly mismatched to the needs of business
applications.
Can someone please explain to me why everything has to be in traingles and
textured? To do the simplest things, the code seems so awful. I just don't
get it.
I don't want to re-invent the wheel, here. Can someone point me to a few
resources regarding the use of DirectX in business applications?
Thanks,
Paul
{
Now do realize that all the drawing commands available to you in GDI+
are not available to you in DirectX. Also remember that on the most
basic level you can do nothing beyond drawing a triangle and that
everything you do render needs to be composed of triangles.
So this means that if you want to draw a line, you need to create your
own command to do so which needs to create two triangles based on the
length and width of your line (if 1 pixel wide, you can actually tell
the video hardware to draw a 1 pixel line instead of using triangles).
Same goes for circles and the like. You need to create such geometry
by triangulating it. There is no command to do this for you.
For drawing images, you need to create 2 triangles that compose a
rectangle which you render with a texture map. The texture map is your
image.
Drawing text is a little trickier. Drawing text basically requires
rendering a series of texture mapped rectangles where each rectangle
consists of 1 letter with a texture of the letter you want to draw.
For performance reasons you would normally create a single texture map
that has all your letters on it and then use UV coordinates to grab
the right letter out of the one texture map. There is a Font class in
D3DX though that can do all this for you transparently in the
background.
}
.
- Follow-Ups:
- Re: newbie question
- From: Stephan Rose
- Re: newbie question
- Prev by Date: Re: Reading MinFilter property --> Error
- Next by Date: Re: newbie question
- Previous by thread: Reading MinFilter property --> Error
- Next by thread: Re: newbie question
- Index(es):
Relevant Pages
|