Advertisement

Some DD questions

Started by January 16, 2000 04:37 PM
2 comments, last by ECKILLER 25 years, 1 month ago
Hi, Some questions i have as learning DD... I was wondering why you need to do this; buffer = (BYTE*) ddsd.lpSurface; in order to manipulate a surface, couldn''t you just go straight to ddsd.lpSurface = Draw_Something() to manipulate it??? Second could someone give me an examply of how to place a surface on top of a surface(like a character on top of a background)? In the BltFast function the first two parameters are DWORDS that are suppose to be the x and y. Why is it when i change these that my image gets all F''d up??? ECKILLER
ECKILLER
As to the first, the idea is that you have to change the memory that is given to you, not make the pointer point somewhere else (if you did what you are suggesting, you''d just make the lpSurface variable point to the memory DrawSomething creates, and wouldn''t change the actual surface memory.)

As to the second I guess you talking about sprites, but I don''t know much about them. Someone?

as for the third, I change them all the time and have no problems. remember, they have to be inside the destination surface, and the origin rect,positioned at these, has to be inside the destination surface too (you cant blit a 10X10 rect to a 20X20 surface if you make it start at 15X15, the end of the rect would be at 25X25)
Advertisement
Sprites are fairly easy to do with direct draw blitting.

Just simply blit the the background first, then the character next using the source color key.

lpddsback->Blt(NULL, lpdds1, NULL, DDBLT_WAIT, NULL);
lpddsback->Blt(&DestRect, lpdds2, &SrcRect, DDBLT_WAIT / DDBLT_SRC, NULL);

(where lpdds1 is an offscreen surface the size of the screen and lpdds2 is your the surface of your character)
Working on: DoP
Or you can use BltFast. If you''re unsure of the order to do things, load your bitmap images into memory, copy them to your surface, then Blt or BltFast to your buffer then Flip! Good Luck!



Still Learning...
Still Learning...

This topic is closed to new replies.

Advertisement