Advertisement

Any way to access the pixles in ddraw?

Started by June 11, 2000 09:33 PM
4 comments, last by JwayneT 24 years, 6 months ago
What I wanted to do was sprite rotation,

But there doesn''t seem to be any way to do that on a ddraw surface. You can do it off screen, but wouldn''t that take more time? a.h{text-decoration:none;color:blue;};a.h:hover{text-decoration:underline;background:red;};

Ever notice how Evil spelled backward is Live?

-=CF=-
a.h{text-decoration:none;color:blue;};a.h:hover{text-decoration:underline;background:red;};

Why is it called a hot water heater? Isn't it cold when it goes in the tank?

[email=jtaylor@gtemail.net" class="h]-=CF=-[/email]
i believe you will have to lock the surface and get the pixels. i don''t know of any other way.
To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
Advertisement
use IDIRECTDRAWSURFACE4::Lock

then your LPDDSURFACEDESC2 will contain a pointer to the surface

in lpSurface;



DirectDraw can rotate "sprites" (which are just bitmaps) for you. Load your bitmap graphics onto an off-screen surface, then when you blit (using blt) them onto the backbuffer you can tell DD to rotate through any custom angle. It will almost definitly be faster than using a load of maths to do the same thing.

Edited by - simon_brown75 on June 12, 2000 8:30:02 AM
While this will work, I am fairly certain that bitmap rotation is one of the things that DirectDraw supports only in hardware. What this amounts to is that if your video card (or any computer you plan to run your program on) does NOT support hardware rotation, DirectDraw will NOT emulate it for you, it will fail. Just thought you should keep this in mind. It is of course always possible that I am completely wrong

-> Briar LoDeran <-
Thankx for the Info,

As far as ddraw doing it for me, I think it would be better for me to do it myself. I have allready written the rotation code, and it shouldn''t be CPU intensive. Just a 2X2 Matrix, using an expanded series of sin and cos. It would be probably best if I used my method, because I''m planing on using it for a number of things. Again thankx!

a.h{text-decoration:none;color:blue;};a.h:hover{text-decoration:underline;background:red;};

Snootchie Bootchies!

-=CF=-
a.h{text-decoration:none;color:blue;};a.h:hover{text-decoration:underline;background:red;};

Why is it called a hot water heater? Isn't it cold when it goes in the tank?

[email=jtaylor@gtemail.net" class="h]-=CF=-[/email]

This topic is closed to new replies.

Advertisement