Graphics choppy when initially drawimg images.

BlitzMax Forums/BlitzMax Programming/Graphics choppy when initially drawimg images.

sswift(Posted 2006) [#1]
See this thread for more details:
http://www.blitzbasic.com/Community/posts.php?topic=60190


Basically, it seems that Max isn't buffering images in video ram when they are initially loaded, or when changing graphics contexts.

I fixed the initial loading issue myself by drawing every loaded image to an offscreen buffer, but I have found that when toggling between fullscreen and windowed, the buffered data is lost and the first time the spheres in my demo all start to roll, everyhting goes choppy for a second until it gets things back in order and the image data is rebuffered.

The first fix was realtively simple to implement since I had already wrapped the LoadImage funcitons to display errors when files were missing. But the second fix will require me to make a significant change in how I load and deal with the images in my game. I'll have to put them in an array and index them with constants rather than putting them in individual global variables of the TImage type. That's the only way I would be able to iterate through them all after loading to rebuffer them. (In an automated way anyway.)

So I'd like a word on whether or not this is a bug, and whether it might get fixed soon, as if I have to make this change, it would be far better to make it now than later, but I'd rather not make it at all.

Also, if there is a place where all the images are stored in a nice tidy list I can iterate through by defualt instead, then that could be helpful.


Grisu(Posted 2006) [#2]
"When posting bug reports, please:

1) Include some *runnable* source code in your post - not just the bit in your code that's failing, but something we can actually copy and paste into the IDE and run immediately."


sswift(Posted 2006) [#3]
I know, but I don't have time to produce a demo for it, as it's not something that's easy to demonstrate. Anyway the cause is fairly clear in this case.


skidracer(Posted 2006) [#4]
This is not a bug and will not be "fixed".

Go with the nice tidy list option. A simple function that draws every frame of every image in your cachelist is all that is required after resetting graphics no?