Sorry for the double post... This is too big for an edit, lol.
Warning:_______________________________
The things you need knowledge of for this method are:
Shell Programs
Shared Memory
Mutexes
_________________________________________
I've found a solution in the form of a shell program. If you load all the image data into a shell, execute your main program with it, and then hide it so that it is always running, you can pipe the data to your main program which will do all of the math, input, and screen stuff. Even if the main program loses focus, the shell will always maintain the image data's position in the graphics card's memory. Since the main program only grabs the info each frame when needed, the graphics are never lost!
It's a complex little process, and since I'll be using it in my copyrighted game, I don't feel that I want to post the actual code. So, here is a basic idea just to get you started:
In the shell program, you load the data, and then dump the image info into a shared memory location(mutexes are highly recommended here), execute the main exe, and then hide the shell.
load all image data as you normally would
store image data into shared memory
run the main exe
hide this window
In the main program, you pull the info from the shared memory and load this info as the image each frame that it is needed.
load all regular data
do
cls
load only necessary image data from shared memory
display images
sync
loop
I've tried everything I could think of to trip my code, but since the image data is safely stored, you can't lose the graphics, and since the data is loaded each loop, there is no serious skip or delay in frames(As long as you have enough power in your comp. I'm running on a 4 year old laptop, and it ran fine!).
Here are the only limitations I could think of:
You need a faster computer to accomplish this smoothly, although most modern comps nowadays have enough power to do this.
You have to cut down on the frames displayed, because you have to load the data each loop. Shouldn't be a problem as long as you clock your frames to a reasonable rate like 30-60fps. Clock your frames people!!! 100-200+fps is not needed! Lol.
If the shell crashes you're SOL! All your data will be lost, and the main game will crash because it cannot find the appropriate data. Although, this is expected of crashes, right?
That's it, unless you don't use mutexes, because another program could dump data into your shared memory, causing graphics to be glitched.
Also, I forgot to mention... I am using Advanced Sprites and Matrix 1.
Highly recommended plug-ins.
Anyway, hope this helps as there are some high level concepts here. Lol.
-Amo