Graphics issue after switch mode

BlitzMax Forums/BlitzMax Programming/Graphics issue after switch mode

Eric Guo(Posted 2006) [#1]
Images should be reloaded after switching between full sreen and windowed according to some document.

However it seems ok even images aren't reloaded from my test except images become rough.

Then I try to reload images after the new Graphics function called. But the result is same.

Was anyone in the trouble of this issue?


Perturbatio(Posted 2006) [#2]
I'm not sure I understand the question.


tonyg(Posted 2006) [#3]
Yes, the images must be reloaded after a graphics mode switch.
A few people have noticed that there are no errors but images can become 'corrupt'.


Robert Cummings(Posted 2006) [#4]
I am not sure this is correct. I had thought blitzmax handled this with just another call to graphics() - you should not have to reload.


VP(Posted 2006) [#5]
I'm new to BMX but I did spot in the docs that images to be loaded after the Graphics() call and not before. Tonyg mentions images becoming corrupt. I can only imagine that this is due to the memory area where the images reside is marked as free after a Graphics() call.

The only reason the images may remain usable is because the image pointers still retain their value. It is just that the place they are pointing to is now invalid.


tonyg(Posted 2006) [#6]
Hmmm, a few people have mentioned that as well.
I remember a thread which covered it all (white rects rather tha images) but could only find these...
One
Two
three

<edit> Maybe it was loading *before* a graphics command was wrong rather than needing a reload after a graphics change. It seems to only partially load the image or display it in the wrong place. All very odd.


Eric Guo(Posted 2006) [#7]
@Perturbatio
Sorry for my poor English :) You may figure out my problem from the following shots:

The sreenshot before graphics mode switch:


After graphics mode switch


And then, I know the problem is not regarding images reload. I forgot setting blend mode again :0

So I didn't reload images after graphics mode switch.
All seems ok now.

Thanks guys.


Robert Cummings(Posted 2006) [#8]
I am pretty sure bmax actually 'reloads' them for you.


JazzieB(Posted 2006) [#9]
That's my experience too. No need to reload any images, just make sure you reset any special drawing modes you may have set, such as ALPHABLEND.


xlsior(Posted 2006) [#10]
I am pretty sure bmax actually 'reloads' them for you.


The current version do, but originally they didn't -- switching to windowed mode or back without manually reloading your images lead to corrupted graphics in the earlier versions, this is no longer the case now.