No BLT with DX8?

Started by
82 comments, last by Gazza 23 years, 5 months ago
I''ve been doing some thinking about how to write a 2D game without surfaces and Blt''s and I''m confused.

If you wanted to make, say, a 2D square menu button it would be 2 triangles together to form a rectangle and you''d place a texture on it, correct?

Well, how would you create a button that is a circle? You wouldn''t have to have tons of tiny triangles to make it, would you? Obviously in 2D you have a square surface and make the sections you don''t want to see transparent (ie, you wouldn''t blt a specific color onto your destination surface). But can you do something like that in 3D?

- Houdini
- Houdini
Advertisement
Yes, that''s exactly how it works. You can use colour keys on textures just like normal blits. In fact, you can blend several textures together for various effects (on newer cards).
Are you trying to tell me that all the f**king I''ve done writing wrappers that set up DX7 was in vain?

I''m working on a 3D engine. My higher level APIs (Object classes, scene graph, etc) are all using lower level APIs (Shaders). Does this mean I''m going to have to rewrite all the low level stuff? Meaning initialization, triangle drawing, texture selection, vertex buffers, etc.
Another quick question then. Wouldn''t you see the wireframe of the two triangles, or can you turn off the wireframe while still seeing the texture?

- Houdini
- Houdini
If the triangle has a texture then you just see the texture. You can turn wireframe mode on, in which case you just see the edges and not the texture.
Ah, I see. Doing 2D in DX8 might not be as bad as I thought. Thanks for the info!

- Houdini
- Houdini
Hmmm

Can i change the texture pixels using some fancy FX and the set the changed texture to the triangles again and again and again (i mean change texture at ech frame) ? eh.... i think this will slow down the rendering a little

Also its so stupid to cut my circular image int 2 triangles... why? when it can be only one bitmap?

Also why to do all 3D rendering when my view is allways on top of that? i mean:

make a 2D image, setup 3D render, 3D render ... just to get the original 2D image on screen....wow this is very efficient is it not?

Also i think API must give u freedom not take it away...
i mean DX is great because gives u the freedom to use a lots of Graphic boards through their drivers (and who knows best about a hardware if not the maker....eh...and the hacker of course )

but i also think that the moment DX decides to take freedom away from you...like u cant access video memory directly anymore...it becomes a BAD thing.....

Moving us to 3D forcefully is a bad thing and finally a destruction of our creativity...

IMHO if somebody wants to do 2D ok go ahead do it! if somebody wants to do 3D ok again do it!...just dont place limits to somebody...that is bad...

After all this was the reason for createing DX in the first place....because GDI was so easy to use, u did not have to know nothing about pixels (eh allmost) or video memory....but it was ok for bussines apps not for games not for anything fast, or efficient work... like in games

(dont get me wrong i know its easy for the programmer but think is not so easy for the poor user that is slowed away just for commercial reasons)

Bogdan
obysoft
Hey, people, this isn''t such a big deal.. it''s not like DirectDraw vanished (hey, where''d it go?) it is simply not being updated for DX 8. period. IDirectDraw7 still exists (as well as IDirectDraw4, etc.)
DX 7 didn''t have DirectSound, you had to use the original IDirectSound interface.
the release of a new DX SDK has no effect on what already existed, they''re all still there. Microsoft is simply updating certain parts (namely, D3DIM)

------------------------
IUnknown *pUnkOuter

"Try the best you can
try the best you can
the best you can is good enough"
--Radiohead
------------------------IUnknown *pUnkOuter"Try the best you cantry the best you canthe best you can is good enough" --Radiohead
It''s not necessarily the fault of DX that you can''t do 2D stuff as well as you used to - it''s mainly the video card manufacturers who don''t support it very well.

As for accessing the video memory directly, yes you can do that, that''s what the pointer returned from Lock is.

You''re not rendering in 3D, you''re just using the 3D cards polygon hardware rendering. You pass your coordinates in 2D space, not 3D space (which means no geometry transformations).

Anyway, you only have to do it once in a function of your choice that hides the fact that it is split into polygons - be aware though that writing to 3D cards is a different kettle of fish to 2D work. It''s not just a case of sequentially blitting bitmaps to the screen (if you want full optimisation that is).

Ok, After reading all the way through this thread, I am charged with this one question, does anyone have any good information about using 3D for 2D? It seems that some of you have mentioned things like triangle''s and textures, to get 2D like effects.

I have very little expierence in using Direct 3D, but I am looking into it. Also, I am kind of throwing around ideas for updating a 2D fighting game, and incorporating some of 3D effects into the game, while still keeping the sprites 2D sound really good. Any ideas folks? I could use a point in the right direction.

Kevin =)
-----------------------------kevin@mayday-anime.comhttp://www.mayday-anime.com

This topic is closed to new replies.

Advertisement