2D with DirectX

Started by
7 comments, last by Lillemanden 20 years, 6 months ago
Hey! I''m just starting to use DirectX, and I was hoping to make a small 2D game. But I’m not really all that interested in knowing the “inner workings” of DirectX; I just want to make my little game. So I started reading some of the tutorials here on GameDev, but most of them are outdated, or someone has commented that the author is doing it all wrong. So I was hoping that someone here could point me to a “newbie”-wrapper for making 2D graphics in DirectX, or preferably a 2D engine. It just has to fairly easy to use. And if possible have network support (if anyone knows of a good up to date DirectPlay tutorial that would be nice too). And of cause it has to be free. (I write in C++ BTW). Thanks in advance for any help. Jacob “Lillemanden” Richardt
Advertisement
If you are using DirectX 8 or later and c++ then all you have to do is draw a primitive and texture it or shade it in a color (dx8 and later don''t support 2d graphics like previous versions did). Also if you are looking for a wrapper check out some of the Directx framework files in the samples folder in the SDK directory. They can make somethings such as 2d easier in directx.

r3alityc0d3r
icq: 252463839
r3alityc0d3r@hotmail.com
"I am the Architect. I created the Matrix...Your life is the sum of a remainder of an unbalanced equation inherent to the programming of the Matrix. Which has led you, inexorably... here." Great Architect - Matrix Reloaded
r3alityc0d3ricq: 252463839r3alityc0d3r@hotmail.comwww.realitycoder.com"I am the Architect. I created the Matrix...Your life is the sum of a remainder of an unbalanced equation inherent to the programming of the Matrix. Which has led you, inexorably... here." Great Architect - Matrix Reloaded
If you want an easy to use 2D DirectX API, use DirectDraw. If you want it even more easier, use Managed DirectX (aka DirectX.NET).
quote:Original post by Lillemanden

But I’m not really all that interested in knowing the “inner workings” of DirectX; I just want to make my little game.



Maybe SDL is up your alley.

r3alityc0d3r: That is what i''ve been looking into, but since I have no experience with D3D, it''s not so easy for me to do that.

alnite: That might be what I''ll end up with, but then I won''t have hardware alphablending.

Anonymous Poster: I''ve heard of SDL before, I think I''m gonna take a look at it.

Thanks for the replies.
How about using DirecX8's ID3DXSprite and IDirect3DTexture8 interfaces, I think they're fairy simple to use as well as powerfull, and of course there'sthe advantage that you can conbine 2D and 3D

[edited by - j_vitel on October 10, 2003 1:38:56 AM]
My site Jvitel.com
that D3DXSprite is a good idea. I used it to make a tetris game and worked pretty good. The thing i got hung up on whas how to place them where i wanted them on the screen. enter translation.

r3alityc0d3r
icq: 252463839
r3alityc0d3r@hotmail.com
"I am the Architect. I created the Matrix...Your life is the sum of a remainder of an unbalanced equation inherent to the programming of the Matrix. Which has led you, inexorably... here." Great Architect - Matrix Reloaded
r3alityc0d3ricq: 252463839r3alityc0d3r@hotmail.comwww.realitycoder.com"I am the Architect. I created the Matrix...Your life is the sum of a remainder of an unbalanced equation inherent to the programming of the Matrix. Which has led you, inexorably... here." Great Architect - Matrix Reloaded
In fact, it''s quite simple to use : You just have to set up a orthogonal projection matrix... you then simply put the screen coords as your vertex x and y.

You can use z to do some kind of "depth" sorting for your elements.

Metron
----------------------------------------http://www.sidema.be----------------------------------------
Whats wrong with IDirect3DSurface? I made a CSurface function with it, and can easily create a surface, destroy it, and copy it to another surface. Is there something I''m missing?

This topic is closed to new replies.

Advertisement