[AD] bitmaps and displays

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


I've been trying to sort out the bitmaps management problem in relation to displays.

First, a question: Does D3D display driver require that the bitmaps must be destroyed before the last display has been destroyed? WGL, GLX and MacOSX do AFAIK, and I've got the code for destroying bitmaps almost working. Basically each display keeps a vector of bitmaps which depend on it.

Bitmaps in GLX are not bound to the display which was current when al_create_bitmap() was called any more. GLXcontexts share resources from now on. (Hm, now I wonder If we can take that for granted. Not a big problem to fix anyway.)

I failed to do the same in WGL, because wglShareLists() requires an empty context and allegro API allows al_create_display() to be called any time... I tried and it didn't work. I suspect that was the problem. So the problem in WGL is that the bitmap cannot be used after the display which was current at the time al_create_bitmap() was called has been destroyed. The bitmap is bound to this display. Since this problem affects only WGL driver (I don't know about MacOSX), having bitmaps bound to a display in the API is not an option.

My idea is that in that case the bitmap is automatically converted to a memory bitmap. Can we silently change the bitmap type? I think we can. There must a way to get the current flags for the bitmap.


--
Milan Mimica
http://sparklet.sf.net




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