[AD] Behavior of OpenGL on Mac OS X |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: Coordination of admins/developers of the game programming library Allegro <alleg-developers@xxxxxxxxxx>
- Subject: [AD] Behavior of OpenGL on Mac OS X
- From: Evert Glebbeek <eglebbk@xxxxxxxxxx>
- Date: Sun, 1 Mar 2009 09:31:02 -0800
After following some of the discussion here and looking at the OpenGL
implementation on OS X, I realised that it seems to be a bit different
from the other platorms.
Leaving aside for the moment that
osx_get_opengl_pixelformat_attributes() doesn't return the attributes
for the actual mode that was set (I know how to do that, but haven't
got round to it yet), there seem to be the following differences:
1. When picking a colour format, Cocoa doesn't allow you o specify the
size of the individual colour components: just the overall colour
depth and the depth of the alpha channel. What should the display's
"format" field be set to after the mode set? At the moment, it's set
to ALLEGRO_PIXEL_FORMAT_RGBA_8888, which is probably wrong.
There is no obvious way to set the size of individual colour
components using Cocoa, so those settings are ignored. I'm not sure if
this is ideal.
2. Using the Carbon/AGL (Apple Graphics Library) interface to OpenGL,
it *is* possible to set a particular combination of RGB sizes.
However, there is no obvious way that I can find to create an OpenGL
context using AGL and use that instead of an NSOpenGLContext object.
3. No "display scoring" is used by Allegro itself - the NSOpenGL class
does this on its own. In a way, I like this, but it does introduce a
potential difference in how Allegro behaves on OS X compared to other
platforms.
So I guess my main questions are:
1. How should I set the "format" field in the display struct? Anything
that matches the requested colour depth+alpha size?
2. Do we care sufficiently strongly about being able to set the red/
green/blue bit sizes that we should consider using AGL instead of
NSOpenGL? If the answer is yes, I'm not the one who is going to do
it. ;) Personally I don't think this is all that important.
Aternatively, maybe someone can suggest a way to combine an AGL-
created context with an NSOpenGLView?
3. Is it a potential problem that OS X OpenGL uses its own display
scoring independent of Allegro? Again, personally I don't think so.
Evert