On Tue, 16 Jan 2001, Gavriel State wrote:
> Well, the SetMode callback could be used for XVidMode/DGA support,
> if we can retrieve the cooperative window from the DDraw object
> it gets passed.
The cooperative window is in the DDRAWI_DIRECTDRAW_LCL structure, at least
from version 5.A on. (May take work to migrate dlls/ddraw internals to
work with these structures... but if it makes things cleaner, why not)
> We might also be able to do DXGrab this way as well, but that raises
> the issue that in Windows, the DD driver HAL interface above is
> intended for video use only, not input use.
Raises? It's not a new issue, dlls/ddraw isn't supposed to do input
either, so DXGrab doesn't belong there any more than elsewhere. Inside the
x11drv makes the most sense to me.
> I'm not quite sure where it's appropriate for us to make
> a connection between video and input related stuff. We certainly
> *could* have the x11driver ddraw HAL make the call to grab the
> mouse, but I don't know if this is the cleanest way to do things.
Well, I think it is. What better place to put XGrabPointer than in x11drv?
> None of the DDK interfaces that I've seen seem to lend themselves
> to the task of managing our glX context needs. They have
> 'context' APIs, but they're on a per D3D Object level, which I don't
> think meshes well with glX. Also, they don't seem expose an API to
> set the context.
Oh, if you look closely, they do. Here's what we need:
To create/destroy GLX contexts:
typedef struct _D3DHAL_CALLBACKS
{
DWORD dwSize;
// Device context
LPD3DHAL_CONTEXTCREATECB ContextCreate;
LPD3DHAL_CONTEXTDESTROYCB ContextDestroy;
LPD3DHAL_CONTEXTDESTROYALLCB ContextDestroyAll;
...
} D3DHAL_CALLBACKS;
And we can use this to set the context (both context and render target
goes to glXMakeCurrent, as do they in the arguments of this HAL callback):
typedef struct _D3DHAL_CALLBACKS2
{
DWORD dwSize; // size of struct
DWORD dwFlags; // flags for callbacks
LPD3DHAL_SETRENDERTARGETCB SetRenderTarget;
...
} D3DHAL_CALLBACKS2;
As long as ddraw and x11drv goes along with the idea, we should be fine.