Jump to content

  • Log In with Google      Sign In   
  • Create Account

Blt() Problems


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 Lutrosis   Members   -  Reputation: 122

Like
Likes
Like

Posted 16 February 2000 - 02:17 PM

I''m new to DirectX, and I''m writing a few simple programs to get myself aquianted. I wrote a little particle system(since it only required being able to put pixels) and it worked fine. Now I''m messing with animation, and I''ve hit a snag. It seems I can''t blit to the primary surface. The blit command doesn''t fail, it just doesn''t to anything. Actually, all I''m trying to do is a fill. Here''s some code fragments: DDBLTFX ddbltfx; RECT FillArea; memset(&ddbltfx,0,sizeof(DDBLTFX)); ddbltfx.dwSize=sizeof(DDBLTFX); ddbltfx.dwFillColor=Color; FillArea.bottom=479; FillArea.top=0; FillArea.left=0; FillArea.right=639; PrimarySurface->Blt(&FillArea,NULL,NULL,DDBLT_COLORFILL/DDBLT_WAIT,&ddbltfx) The screen mode is 640x480x16 bit. I''m quite sure of the _RGB16BIT() macro, so it''s not a screw-up there. The annoying part is that it''s only for a specific area of video memory(from what I can gather). I tried creating a Secondary flippable surface and blitting to that, then flipping the page, and it worked fine. But then I couldn''t blit to the secondary surface, which should still be the same video memory as the original Primary surface, if I understand page flipping properly. If anyone has any ideas as to why that section of video memory can''t be blit to, I''d really appreciate hearing them. I''m working on a simple wrapper, and blitting to the primary surface would basically complete the functionality of it. -Lutrosis Drowning in the aggrivation of not knowing what''s wrong <=]

Sponsor:

#2 LaughingD   Members   -  Reputation: 151

Like
Likes
Like

Posted 16 February 2000 - 05:27 PM

If this is an exact copy of the code, I''m curious as to why you are dividing DDBLT_COLORFILL by DDBLT_WAIT in the following line

PrimarySurface->Blt(&FillArea,NULL,NULL,DDBLT_COLORFILL/DDBLT_WAIT,&ddbltfx)

That should be DDBLT_COLORFILL / DDBLT_WAIT

Mark Fassett
Laughing Dragon Entertainment
http:\\www.laughing-dragon.com

#3 LaughingD   Members   -  Reputation: 151

Like
Likes
Like

Posted 16 February 2000 - 05:29 PM

OK, I see... ignore my last post. I didn't know the board changed pipes into /

Try checking your return code from your blit call and see what it says.


Mark Fassett
Laughing Dragon Entertainment
http:\\www.laughing-dragon.com

Edited by - LaughingD on 2/16/00 11:33:26 PM

#4 frizb   Members   -  Reputation: 122

Like
Likes
Like

Posted 16 February 2000 - 07:02 PM

Try changing your RECT structure so your bottom reads 480 and your right side reads 640. Those are exclusive so it includes 0-479 & 0-639.

Still Learning...

#5 Lutrosis   Members   -  Reputation: 122

Like
Likes
Like

Posted 16 February 2000 - 11:44 PM

That''s the strange thing. Blt() is returning DD_OK. I didn''t make this clear, but my code is actually set up to check for errors and dump them to a file if they occur. Blt() returns DD_OK, and yet still nothing happens. I''m quite confused. Any DirectX Gurus out there?

-Lutrosis

#6 Kavos   Members   -  Reputation: 122

Like
Likes
Like

Posted 17 February 2000 - 12:13 AM


Hm... Well make DDBLTFX lower case in:

memset(&ddbltfx,0,sizeof(DDBLTFX));

and

ddbltfx.dwSize=sizeof(DDBLTFX);


#7 cliffski   Members   -  Reputation: 122

Like
Likes
Like

Posted 17 February 2000 - 01:30 AM

strange. It really sounds like the value of color isnt right. I take it the screen is black and you are trying to fill it with a color?
with your particle system have you tried writing them to the primary using the same color value.
have you tried blitting a bitmap instead of a colorfill
worth trying bltfast to make sure that works.
You arent making the mistake of blitting to the primary, then calling flip just after it i presume?
Hope these random mumblings provoke an eventual fix :-)

http://www.positech.co.uk

#8 null_pointer   Members   -  Reputation: 289

Like
Likes
Like

Posted 17 February 2000 - 09:12 AM

I just copied this code from my project, and it works correctly. It''s almost identical to your''s, except that it fills the whole surface instead of using the rect (is this what you''re trying to do?)


DDBLTFX ddbltfx;
memset((void*) &ddbltfx, 0, sizeof(ddbltfx) );

ddbltfx.dwSize = sizeof( ddbltfx );
ddbltfx.dwFillColor = RGB(0, 0, 0); // black

lpDD_Surface->Blt(NULL, NULL, NULL, DDBLT_WAIT / DDBLT_COLORFILL, &ddbltfx);



- null_pointer





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS