Re: [AD] Missing system vtable entries on OS X

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


On Mon, Feb 1, 2010 at 3:18 AM, Evert Glebbeek <eglebbk@xxxxxxxxxx> wrote:
On 31 Jan 2010, at 9:18 , Elias Pschernig wrote:
> Ok, they are all gone. Now I'll just have to make ex_display_options
> work properly again.

Ok, after mucking around with related things on OS X (to fill in osx_get_opengl_pixelformat_attributes and make things work in both full screen and windowed mode), I've found that the situation is actually  even more complicated than I had originally thought.
When you ask for the pixel format associated with the rendering context of a window, the values returned are those that were set for the rendering context on a given display (typically the one the window is on now). The values may change if the window is moved to a different display with different capabilities.
Where that leaves Allegro I'm not sure. How do other platforms handle a situation like this (the window being moved to a different display)?


Well, as far as I understand, OpenGL has no concept of a pixel format anyway. If we pass data to OpenGL we use something like glDrawPixels or glTexture2D. In both cases we have to specify the pixel format of the data we pass to it. Same if we read data back with glReadPixels and so on - we always have to tell OpenGL in what format we want it. There is no way to figure out the "native" format from OpenGL itself (as far as I can tell at least).

So what we do is in X11 we ask GLX. Which has the list of visuals. al_create_display selects one visual and it never can change right now. I don't know if a visual can change during the lifetime of an X11 window... I remember a lot of weird code from A4 dealing with "DirectColor" and "TrueColor" (and some other types of) visuals which might have handled just that... but I never understood what that was all about. Do you know how you would move an X11 window from one X11 display to another X11 display (say, running on a different VT with different color depth)? I think I actually tried to figure this out with google once but failed... so for now the answer is we don't handle it in X11 since it most likely can't even happen.


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