Matt Pekar wrote:
In windows, video memory can disappear at any time. Check this page for
more info:
http://www.libsdl.org/docs/video/functions.html
Perhaps the SDL version of windows could have a hack to work around
this? Like when alt-tab is pressed, it could write all the surfaces to
file, and when the application is brought to the foreground again it can
retrieve them. I think it’s unfair for programmers to have to make
accomodations for this direcX “feature”.
Agreed. I’d personally just tell everyone to be smart and switch to BeOS or
Linux (Note: I’ve never used BeOS, but it’s multimedia and thus game
capabilities and seriously impressed, although I 100% plan to stick to
Linux)… In any case, yes, the unfortunate Windows developers shouldn’t
have to put up with that. The only thing is, is it possible to detect that
Windows is about to throw away the memory before it does so, so that it
CAN be backed up? If not, is it possible to store the ‘source’ of a surface,
so if it is lost, it can be restored? The problem there lies in dynamically
generated images (like light maps), and altered images…
Perhaps a surface could have two extra data members: a ‘reload’ callback, and
a void pointer to arbitrary data. Thus, if SDL detects that Windows, it
could call the callback, with a pointer to the surface and the void pointer
as data. The programmer could put the data needed for loading and
manipulating the image into the void pointer (a structure obviously), and
reload the data. If the programmer was smart, they’d make the normal load
function work just like this, so that they’d just need one function, and it
would work pretty well. They’d just have to be careful about speed (because
if Windows throws the memory away in mid-game operation, the performance hit
would be REALLY big instead of just big…). BTW, does Windows 9x use true
pre-emptive multi-tasking? Back when I first started programming graphical
games (well, after I got sick of writing SVGA drivers in DOS), I had tried
writing DX3 apps in Windows, and I remember something about the Windows app
had to ‘give control back to Windows’ to process events or some-such. In any
case, the description didn’t sound like a normal event collection loop (such
as what I’m familiar with in GTK/X/SDL/etc., they made it sound like Windows
depended on it. I may be way wrong… but anyways… I’m hyper!! How are
you?
There’s my .35 1/3 cents (not that my opinion is worth more, I just think
that I gave a lot more of it than most… IOW, I BS’ed a lot. ~,^ )
Ya.
Sean Etc.