How common is rotation hardware

Started by
9 comments, last by spejic 19 years, 3 months ago
I working 2d in directdraw 7, I'm reading in "Tricks of the windows game programming gurus, 2nd ed.", that in order to do ratition in directdraw one has to have rotation hardware on their video cards. How common is rotation hardware nowadays? Should I even bother implementing this on my engine?
Advertisement
Quote:Original post by kubicon
How common is rotation hardware nowadays?


Any modern graphics card supports 3D transformations. I mean, really, we're in the era of programmable pipelines - this would be considered a basic operation [smile].

However, 2D graphics (as I believe DirectDraw 7 deals in) support has fallen by the wayside. The best way to rotate an image is to put it on a textured quad and rotate the quad.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Definately Fruny.

DirectDraw support is sporadic at best, and I would argue nearly non-existant in most new 3D cards. However, if you're working with DirectDraw rotation should be emulated on the CPU if hardware support is not found.

You should check for the capabilities of the video card during initialization as it would effect where you want your frame-buffer to be. If you have limited support in hardware you probably want your buffer in system memory rather than the video card as it will be faster since the CPU will be emulating all the work anyhow. Touching system memory is much faster than over the AGP (or god forbid, PCI) bus. Performance shouldn't be too limited unless you have large rotating graphics all over.

This reminds me that I should impliment a rotozoomer function in my software graphics library.

Also, to back up Fruny again; these days Direct3D or OpenGL is THE WAY to go for a 2D game. "Focus on 2D in Direct3D" is an excelent resourse for this information and eveything can be easily applied to openGL if that were your 3D api of choice.

throw table_exception("(? ???)? ? ???");

Damn, this makes me feel like I'm wasting my time learning the stuff that I'm being taught in the book. The book deals with DirecDraw. Am I wasting my time? Should I focus on making 2D graphics using Direct3D?
I do believe you are, there arent really any applications for direct draw that i can think of off the top of my head that wouldnt be just as good if not better being hardware accelerated with opengl and d3d (it can be a bit more work, but its 100000x faster, and then your ready to transition into 3d if you want as well :-D)

now, learning is never a waste of time though, and it cant hurt to learn all the things from that book, but there are better/more applicable things you could be learning instead.

theres one other reason you MIGHT keep up with that book, (i dont know it) but if its teaching GAME PROGRAMMING CONCEPTS, thats great, learn those, heck, you could even make your own renderer so that your still following the book but your renderer is independant (sp, im tired) of the books renderer

hope that helps
-Dan
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
If you're being introduced to game programming, then this is not a waste of your time. Lamothe's book is an excellent introduction for beginners.

When you get a hang of this stuff, you can adapt his DirectDraw code to Direct3D's ID3DXSprite interface and functions very easily for 2D graphics, anyway.
There are a million things that aren't a waste of time if your goal is learning, but in terms of real world games, yes DirectDraw is basically a waste of time.

I disagree somewhat with the comment about learning Direct3D's ID3DXSprite as you advance. DDraw/D3D are fundamentally very different ways of doing graphics and not much of your DirectDraw knowledge will apply to D3D -- unless you are still mastering basic x and y coordinates, etc.

2D graphics with Direct3D (DX8/DirectGraphics/DX9/etc) are so much more powerful it's not even funny, and even the most basic PCs shipped in the last several years will have some hardware support for scaling/rotation/alphablending.

-Jay
Do you guys know some books or other resources that talk about writing 2d games using Direct3D.
Quote:Original post by kubicon
Do you guys know some books or other resources that talk about writing 2d games using Direct3D.


There are some articles on this web site. I bet there is some book as well, though I'll let others fill in on that.
Quote:Original post by kubicon
Damn, this makes me feel like I'm wasting my time learning the stuff that I'm being taught in the book. The book deals with DirecDraw. Am I wasting my time? Should I focus on making 2D graphics using Direct3D?


Yeah you are. If it makes you feel any better I wasted my time learning DirectDraw (thanks to Windows Game Programming for Dummies), when a higher level 2D API would've sufficed (SDL), or even a game programming library (Clanlib, Allegro).

I feel as though by reading Windows Game Programming for Dummies (which I believe shares content with TOFTWGPP) set me back so far in terms of learning what I need to know to program a game, leading me to get stuck on problems like the OP has. The sample code is also terrible programming style, all those globals and whatnot. He also encouraged cheap optimizations like loop unrolling, which obfuscate code while probably doing nothing to increase performance.

I was organizing my room, and putting away / giving away old books and that one I specifically threw away, because I KNOW I would be doing someone harm by giving them that book.

This topic is closed to new replies.

Advertisement