Archived

This topic is now archived and is closed to further replies.

Haeberle

Bitmap appears just for 1/1000 second

Recommended Posts

Haeberle    122
Hey out there, i`m trying to load and show a bitmap as background for user input (displaying buttons) I do... 1) loading bmp from file 2) copying bmp to a surface 3) blitting from surface to primary surface All works fine, but the bmp appears only for a 1/1000 of a sec. I tested it with adding "Sleep(2000)", so i could see the bmp for 2 seconds. So the loading and blitting code should be fine. The code for loading and displaying bmp is within my main loop !!! Standard loop: While (true) { Peek message... Main_Loop() } I could copy every frame my bitmap to primary surface (or flipping surfaces) but that would be stupid. Bitmap has to be loaded and blt''d only once . If user input is ok => starting next part of proggy Main_Loop - if (status==init_menue) here is my code for loading and displaying bmp set status to running _ else if (status==running_menue) do something with user input - else if (other states like game is running...) I have tried to copy bmp to back and primarybuffer but doesnt work ? I''m using DX7 ddraw under DX8 SDK and DX8 runtime.. Anyone got an idea what could be wrong ? Haeberle First try, then read the f... manual

Share this post


Link to post
Share on other sites
FallingFrog    122
If you keep flipping the back buffer to the front buffer every frame, but don''t blit the bitmap every frame, then of course the bitmap will appear for one frame then vanish. Either refresh the whole screen every time you flip the back buffer to the front buffer, or stop flipping the buffers until there is user input.
Hope that helps...

Falling Frog

Share this post


Link to post
Share on other sites
Haeberle    122
Hmmmmm, thats my prob..

I dont do any flippings after blt''d the bitmap one time.

Next flip or blt should be only after users input.

But there is one, but I dunno why and where (Hehe, I know it''s a damned little thing like always

Haeberle

Share this post


Link to post
Share on other sites