scrambled images after alt/tab
Blitz3D Forums/Blitz3D Beginners Area/scrambled images after alt/tab
| ||
apologies if there is already a thread for this... I am running a game 800x600 in full screen. If I Alt/Tab to the desktop, and return to the game, all the images created with CreateImage are scrambled. I have tried setting the flags differently, but it does not help... ![]() before ![]() after and this is the code: Function MakeForts() For i% = 1 To 4 White.Fort = New Fort White\FortX = i%*147 White\FortY = 480 White\Pic = CreateImage(64,64,1) SetBuffer ImageBuffer(White\Pic) DrawBlock FortPic,0,0 Next End Function thanks if you can help |
| ||
Hi Folks,Function MakeForts() For i% = 1 To 4 White.Fort = New Fort White\FortX = i%*147 White\FortY = 480 White\Pic = CreateImage(64,64,1) SetBuffer ImageBuffer(White\Pic) DrawBlock FortPic,0,0 Next setbuffer backbuffer() End Function That 'might' do it. Later, Jes |
| ||
@SoggyP thanks, alas, no difference. I have the Setbuffer Backbuffer() in a different spot, but i tried it that way and its just the same. darn it. |
| ||
Which version of Blitz is it? |
| ||
That's 800x600? whoah! Hehe - nice retro look you got there :) |
| ||
Hi Folks, Is this the very start of the game? If not, I'd say take a look at the code where your bases are eroded, and then try setting the buffer as backbuffer after that. Later, Jes |
| ||
Blitz does not like to Alt-Tab. Weird things may happen. |
| ||
Which version of Blitz is it? sorry, should have said - Blitz+ That's 800x600? whoah! yup :) I'd say take a look at the code where your bases are eroded I used your example, and no luck, thanks Jes. the main loop starts after that function call, so the setbuffer backbuffer() must happen in the function or immediately after, it doesn't seem help... Blitz does not like to Alt-Tab. Weird things may happen. I guess people to not Alt/tab that much in a game, but if I'm doing something else at the same time, for instance Alt/tabbing to check a download, or something... I'm using this code now, it does not use Createimage, and does not corrupt after Alt/Tab: For i% = 1 To 4 White.Fort = New Fort White\FortX = i%*147 White\FortY = 480 White\Pic = LoadImage("data\gfx\fort.png") Next thanks for help everybody |
| ||
I don't know if this helps, but try:Image=CreateImage(64,64,1,1) |
| ||
Is there a way to trap the {alt}+{tab} keyhit so ir CAN'T happen??? |
| ||
I don't know if this helps, but try: Image=CreateImage(64,64,1,1) @Tiger: It works! Hey, thanks a lot :) My mistake was in thinking that in Image=CreateImage(64,64,1) that the "1" was referring to a flag, and not the number of frames, thanks for clearing that up. I looked at the command reference many times and was totally blind to that detail... |