DX-DD-why won't this work!?
Ok i have two bitmaps that are the size of the screen-640x480. I am trying to display half of one and half of another as my first step to figuring out how to scroll. I can''t figure out why the hell this code fragement isnt doing what i need it to do: Please help ::::
RECT bkRect;
static int x_screen_pos = 100;
bkRect.top = 0;
bkRect.left = 0;
bkRect.bottom = 480;
bkRect.right = 640 - x_screen_pos;
lpDDSBack->BltFast(0,0,dojo, &bkRect, DDBLTFAST_WAIT);
bkRect.top = 640 - x_screen_pos;
bkRect.left = 0;
bkRect.bottom = 480;
bkRect.right = 640;
lpDDSBack->BltFast(640-x_screen_pos,0,dojo2,&bkRect, DDBLTFAST_WAIT);
Frank
ECKILLER
ECKILLER
The problem might be that you have a clipper attached to your back buffer. I had a similar problem but I figured out that BltFast only works when you don''t have a clipper attached to the surface your blitting on. You could use Blt instead or you could get rid of the DirectDraw clipper and write a software one. That''s just an idea. I''d try using Blt first just to see if that''s really the problem.
Alex
Alex
Alexbigshot@austin.rr.comFoolish man give wife grand piano. Wise man give wife upright organ.
I may be wrong but the second time you set the rect up, haven't you got the top and left parts the wrong way round - surely the top should stay at 0 while the left is set to 640-x_screen_pos?
bkRect.top = 0;
bkRect.left = 640 - x_screen_pos;
bkRect.bottom = 480;
bkRect.right = 640;
also, the bottom and right may need to be set to 479 and 639 respectively...the size is 640x480 ie (0->639)x(0->479)
Edited by - Gav on 1/25/00 6:42:07 PM
bkRect.top = 0;
bkRect.left = 640 - x_screen_pos;
bkRect.bottom = 480;
bkRect.right = 640;
also, the bottom and right may need to be set to 479 and 639 respectively...the size is 640x480 ie (0->639)x(0->479)
Edited by - Gav on 1/25/00 6:42:07 PM
===========================There are 10 types of people in the world. Those that understand binary and those that don't.( My views in no way reflect the views of my employer. )
Seem you did switch the left and top variables, but the bottom coordinates are correct. I don''t understand, though, how you want to do the scrolling; Are you thinking of having several screen-size tiles side by side? If so, you''d have to shift them in order for the first to end on the separation point, and the other to begin there (the first rect would have it''s left on 640-x , and the second would have it''s right on 640-x, remember the rects are the part of the surfaces you''re blitting from, no into.)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement