Re: [AD] loss of videoBitmap after set_gfx_mode()

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


No.  That's right.  At least for Windows.  Video bitmaps are stored in the 
video card/DirectX.  When you switch graphics modes, you are essentially 
restarting DirectX, so anything that you had going related to DirectX is 
lost.  Whether that's the desired behavior or not is a different matter, 
but the fact that he lost video bitmaps makes perfect sense from an 
implementation standpoint.

I mean, you already know that set_gfx_mode clears the screen buffer?  So at 
least in DOS when it clears the VRAM your video bitmaps will go with it.  
So that's at least 2 platforms I'd expect loss of video bitmaps.

I would think it is reasonable to expect a person to reload the images when 
they change graphics mode.  You have to reload them when someone tabs out 
in Windows already?  They could be changing color depth or resolution 
during that call (one would hope there's a change there), meaning the 
entire layout of the VRAM could change, and the entire nature of video 
acceleration can change (ie changing from a windowed mode the same color 
depth as the desktop to a mode where color depth != desktop, but that's 
required, so you can't even use hardware video bitmaps anymore).

Gillius

On 19 Nov 2002 at 19:39, Robert Ohannessian wrote:

> Jason Winnebeck wrote:
> 
> > You should not use any graphics functions before you call set_gfx_mode. 
> 
> 
> But he did call set_gfx_mode() before creating the video bitmaps. He's 
> reporting a bug about losing video bitmaps in between calls to 
> set_gfx_mode. Not only that, but Allegro apparently crashes when he 
> later tries to destroy the video bitmap.
> 
> 




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/