case D3DRENDERSTATE_CLIPPING: /* 136 */
/* Nothing to do here... Even if what we receive is already clipped by the application,
we cannot tell OpenGL to not re-clip it. */
case D3DRENDERSTATE_CLIPPLANEENABLE: /*152*/
{
GLint i;
DWORD mask, runner;
if (dwRenderStateType==D3DRENDERSTATE_CLIPPING) {
mask = ((dwRenderState)?(This->parent.state_block.render_state[D3DRENDERSTATE_CLIPPLANEENABLE-1]):(0x0000));
} else {
mask = dwRenderState;
}
for (i = 0, runner = 1; This->parent.max_clipping_planes; i++, runner = (runner<<1)) {
You forgot the 'i < ' before the 'This->parent.max_clipping_planes'.
if (mask & runner) {
glEnable(GL_CLIP_PLANE0 + i);
} else {
glDisable(GL_CLIP_PLANE0 + i);
}
}
} break;
(...)
-HRESULT WINAPI -Main_IDirect3DDeviceImpl_7_GetClipPlane(LPDIRECT3DDEVICE7 iface,
DWORD dwIndex,
D3DVALUE* pPlaneEquation)
+HRESULT WINAPI +Main_IDirect3DDeviceImpl_7_GetClipPlane(LPDIRECT3DDEVICE7 iface, DWORD Index, D3DVALUE* pPlaneEquation)
And here, you renamed the dwIndex (the official MSDN sanctionned variable name) to Index :-)
(...)
HRESULT WINAPI -Main_IDirect3DDeviceImpl_7_SetClipPlane(LPDIRECT3DDEVICE7 iface,
DWORD dwIndex,
D3DVALUE* pPlaneEquation);
Usually, we keep the Main declaration even if we never use it and replace it with a GL one. This is always to help an hypothetical new driver.
(...)
+HRESULT WINAPI +GL_IDirect3DDeviceImpl_7_SetClipPlane(LPDIRECT3DDEVICE7 iface, DWORD Index, CONST D3DVALUE* pPlaneEquation)
Same comment for Index here too.
Otherwise, looks good :-)
Lionel