2D With direct3d...
Members - Reputation: 743
Posted 24 February 2004 - 09:32 AM
Members - Reputation: 122
Posted 24 February 2004 - 10:52 AM
edit: couldn't get the link thing working so I'll just spell it out.
Basic idea is to form a "quad" (i.e. two triangles) and texture it.
I've heard you can also use D3DXSprite but haven't seen a good tutorial on that (I don't know why, maybe someone else can answer that?)
[edited by - TreborZehn on February 24, 2004 5:53:06 PM]
[edited by - TreborZehn on February 24, 2004 5:54:09 PM]
Members - Reputation: 253
Posted 24 February 2004 - 11:13 AM
D3DDevice is an initialized D3D device object.
TestTexture is an initialized texture object.
TestRect is a RECT that contains the source coordinates for D3DXSprite to draw.
D3DXCreateSprite( D3DDevice, &MainSprite );
And then, to draw:
MainSprite->Draw( TestTexture (texture), &TestRect (source RECT), &D3DXVECTOR2( scalex, scaley ) (scale), NULL (rotation center (D3DXVECTOR2)), 0.0 (rotation amount), &D3DXVECTOR2( posx, posy ) (position), D3DCOLOR_RGBA( r, g, b, a ) (color) );
Members - Reputation: 743
Posted 24 February 2004 - 11:59 AM
[edited by - DevLiquidKnight on February 24, 2004 7:02:25 PM]
Members - Reputation: 277
Posted 24 February 2004 - 01:28 PM
I've number them in the order I think I'd read them. Alot are numbered the same since they are kind of the same level, but just tell different ways of doing stuff. #2 is a very good article I think (though it starts with the complete basics).
(3) 2D Programming in a 3D World: Developing a 2D Game Engine Using DirectX 8 Direct3D
This shows how to use the ID3DXSprite interface in DX 8 and good explanation of how things have changed for 2D programmers after DX 8. However, it's probably more useful for those who either never want to use 3D or who are used to the old way.
(5) Direct3D8 Sprite Wrapper
It has white text on white background so you have to select everything to see it. This is similar to the previous one and is a wrapper for Direct3D8 to act like DirectDraw7 but still using ID3DXSprite.
(5) Dissecting Sprites in Direct3D
This is another sort of wrapper I think, but doesn't use ID3DXSprite. I think it instead sort of rewrites it. (I haven't read it yet.)
(5) Using Direct3D For 2D Tile Rendering
This one actually seems to use Direct3D, but is based on DX7. It focuses on tile-based isometric rendering, which may be what we want. (I haven't read it yet.)
(5) Introduction To Isometric Engines
Another Isometric article which may be useful for us. It is at more of a higher level and doesn't get into any of the details of which API to use. (I haven't read it yet.)
(5) Isometric Engines: Are they for you?
Looks nice. More articles on the main site too, though they're all fairly old. (I haven't read it yet.)
(5) More tile-based and Isometric articles
(I haven't read it yet.)
(5) 2D Rendering in DirectX 8
This shows how to use the real D3D interface (same as you would use for 3D) to do 2D graphics. (I haven't read it yet.)
(5) 2D in Direct3D using Textured Quads
This also shows how to use the real D3D interface (same as you would use for 3D) to do 2D graphics (written for DX 9). (I haven't read it yet.)
(4) DirectX 8 Graphics and Video: A Fresh Start
This looks like good background on how DX 8 is organized and how to work with it. (I haven't read it yet.)
(4) Starting Direct3D9: Setting Up a Window
This covers the basics of getting started in DirectX programming for DX9. (I haven't read it yet.)
This is sort of the history of DX and more on how it's organized, and it might be good for understanding DX in general. It's by LaMothe, but it's old (DX 5). (I haven't read it yet.)
(6) A DirectX Game: Tetris
A complete example with some explanations for making a 2D DX 8 game. It uses a wrapper to the DirectDraw7 interface though, but still may be useful to see how they organize things. (I haven't read it yet.)
(2) Game Programming Genesis series (parts 1-10)
This looks like a good (thorough) discussion of game design. It may help with figuring out how to organize a graphics manager. Some of the details (like DirectDraw) we can probably just skim over, but I'm pretty sure the general discussions are still applicable. (I haven't read it yet.)
(1) Striving For Graphics API Independence (parts 1-4)
This looks like it might be a good option for how to do a GM. He mentions using the COM interface as another option (which some of the DX overview articles above talk about (and I know MSDN does to). So this and COM stuff are probably what we need to read for figuring out how to organize the GM. Although, there may be other options out there too. (I haven't read it yet.)
(6) Magmai Kai Holmlor's Krude ATL COM tutorial
Not sure, but it's an alterative to the "Striving For Graphics API Independence" method. (I haven't read it yet.)
(6) XEngine - The Platform- and API-Independent 3D Engine
An Open-source engine. There are docs and code which might be a good example for us, but it is 3D.
Some links to people asking questions we're interested in:
Not all of these are great (but some are!). They generally have good, related discussions I think, though.
Edit: fixed links
[edited by - reana1 on February 24, 2004 8:33:39 PM]