Using the Blt() function in DX7

Started by
5 comments, last by greymaukin 22 years, 8 months ago
I am trying to blt a GUI for a map editor from an offscreen surface to my backbuffer. All I''m getting when I try to compile/run is black where my map should be. Can someone help me?!! (I''ve only been programming for about a week, so I''ve exhausted EVERYTHING that I could think of to try). Thanks!!! Even a broken clock is right twice a day. Grey
Even a broken clock is right twice a day.Grey
Advertisement
Have u set the flip?
i don''t really know what happened,but u should copy the source here,then perhaps i can find the problem.

jerry2
Programming,make a whole new world.
jerry2The God creates the world, the world creates the nature,the nature creates human. Human create...Everything.
quote:Original post by greymaukin
I am trying to blt a GUI for a map editor from an offscreen surface to my backbuffer. All I''m getting when I try to compile/run is black where my map should be.

Can someone help me?!! (I''ve only been programming for about a week, so I''ve exhausted EVERYTHING that I could think of to try).

Thanks!!!

Even a broken clock is right twice a day.
Grey


I am not sure but... do you flip the surfaces after blit??
yep, you should paste some of your main code.
#ifndef _YEA_H_#define _YEA_H_#endif
let me explain in more detail.. the code is rather long...
I''ve set up the flip. And as long as i use window''s GDI (BitBlt() function), the prog works fine. But i''m starting to get into LOTS of graphics, and it''s starting to drop below 30 fps. so i have to use a faster way. so what i did was i tried using the directX blt() function. i tried setting up color keys, and ddlbtfx''s but still all i get is black. i know the program still works, because i made it put an icon with bitblt to make sure. I''ve set up my display like this "SetDisplayMode(800,600,16,0,0);" my blit function is this lpddsBack->Blt(&rcDst,lpddsScreen,&rcSrc,DDBLT_WAIT | DDBLTKEYSRC, NULL, NULL);

any suggestions would be welcome, and if you need any more info let me know.. i''m on the web a lot, since i''m kinda at an impass now.. Thanks guys!
Even a broken clock is right twice a day.Grey
forgot my quote

Even a broken clock is right twice a day.
Grey

Edited by - greymaukin on August 8, 2001 1:55:52 AM
Even a broken clock is right twice a day.Grey
Not really a solution, but some suggestions that hopefully may help:

1) How do you use BitBlt on DirectDraw surfaces? Do you get a DC for each one every frame (slow!)? If no, maybe they aren''t DDraw surfaces in which case you can''t Blt them.

2) Do any of your graphics go offscreen? If so, you may need to attach a clipper to the surface that you are writing to.

3) Do you write directly to the Back Buffer? That is probably easiest in your case. Just write there and then call Flip (). If not, make sure to Blt your offscreen buffer to the back buffer and then call Flip.

4) You code should look kinda like this for the above example:
Clear Back Buffer
Draw Everything to Back Buffer using Blt ()
Call Flip

Hope that helps. If you can, post some sample code (a condensed version maybe).
i found out the problem.. i was "yatta->GetDC(&blah)" before i used "Blt(&blah)".. you can''t do that.. the surface already released it''s DC.. so there''s nothing to write to.. duh... i just pulled a stupid.. or, an i''m inexperienced... either way.. maybe my screwup will help somebody else in the future eh?
Thanks for the suggests guys... maybee one of these days i''ll help you huh?? LOL!
-grey

"the only way to relieve the stress of programing, is not to program" --somebody famous
Even a broken clock is right twice a day.Grey

This topic is closed to new replies.

Advertisement