Sign in to follow this  

How common is rotation hardware

This topic is 4730 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Actually, I think most cards never had 2d rotation built into hardware (except for 90 degree rotations). There are methods of doing 2D rotation that are pretty quick (like the 3-shift method - you can find this through Google), but I would use 3D methods for this as others recommended.

The usefulness of the book depends on what you are trying to do. I'm working on a 3D game, but it involves lots of 2D maths, so I find I am still pulling the book off the shelf all the time.

Share this post


Link to post
Share on other sites

This topic is 4730 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this