Commit b47c14ae authored by Christian Costa's avatar Christian Costa Committed by Alexandre Julliard

Implement OpenGL overriding of surface's flip method.

Remove broken code.
parent be8189bd
...@@ -86,6 +86,17 @@ inline static Drawable get_drawable( HDC hdc ) ...@@ -86,6 +86,17 @@ inline static Drawable get_drawable( HDC hdc )
return drawable; return drawable;
} }
static BOOL opengl_flip( LPVOID display, LPVOID drawable)
{
TRACE("(%p, %ld)\n",(Display*)display,(Drawable)drawable);
ENTER_GL();
glXSwapBuffers((Display*)display,(Drawable)drawable);
LEAVE_GL();
return TRUE;
}
/******************************************************************************* /*******************************************************************************
* OpenGL static functions * OpenGL static functions
*/ */
...@@ -207,6 +218,7 @@ is_OpenGL( ...@@ -207,6 +218,7 @@ is_OpenGL(
XVisualInfo *vis; XVisualInfo *vis;
int num; int num;
XVisualInfo template; XVisualInfo template;
IDirectDrawSurfaceImpl* surf;
TRACE("rguid = %s, surface = %p, &device = %p, d3d = %p\n",debugstr_guid(rguid),surface,device,d3d); TRACE("rguid = %s, surface = %p, &device = %p, d3d = %p\n",debugstr_guid(rguid),surface,device,d3d);
if (/* Default device */ if (/* Default device */
...@@ -254,17 +266,16 @@ is_OpenGL( ...@@ -254,17 +266,16 @@ is_OpenGL(
else else
TRACE("Context created (%p)\n", odev->ctx); TRACE("Context created (%p)\n", odev->ctx);
#if COMPILABLE /* Look for the front buffer and override its surface's Flip method (if in double buffering) */
/* Now override the surface's Flip method (if in double buffering) */ for (surf = surface; surf != NULL; surf = surf->surface_owner)
((x11_ds_private *) surface->private)->opengl_flip = TRUE; if ((surf->surface_desc.ddsCaps.dwCaps&(DDSCAPS_FLIP|DDSCAPS_FRONTBUFFER))
{ == (DDSCAPS_FLIP|DDSCAPS_FRONTBUFFER))
int i; {
struct _surface_chain *chain = surface->s.chain; surface->surface_owner->aux_ctx = (LPVOID)odev->gdi_display;
for (i=0;i<chain->nrofsurfaces;i++) surface->surface_owner->aux_data = (LPVOID)odev->drawable;
if (chain->surfaces[i]->s.surface_desc.ddsCaps.dwCaps & DDSCAPS_FLIP) surface->surface_owner->aux_flip = opengl_flip;
((x11_ds_private *) chain->surfaces[i]->private)->opengl_flip = TRUE; break;
} }
#endif
odev->rs.src = GL_ONE; odev->rs.src = GL_ONE;
odev->rs.dst = GL_ZERO; odev->rs.dst = GL_ZERO;
...@@ -881,6 +892,7 @@ int is_OpenGL_dx3(REFCLSID rguid, IDirectDrawSurfaceImpl* surface, IDirect3DDevi ...@@ -881,6 +892,7 @@ int is_OpenGL_dx3(REFCLSID rguid, IDirectDrawSurfaceImpl* surface, IDirect3DDevi
HDC device_context; HDC device_context;
int attributeList[]={ GLX_RGBA, GLX_DEPTH_SIZE, 16, GLX_DOUBLEBUFFER, None }; int attributeList[]={ GLX_RGBA, GLX_DEPTH_SIZE, 16, GLX_DOUBLEBUFFER, None };
XVisualInfo *xvis; XVisualInfo *xvis;
IDirectDrawSurfaceImpl* surf;
*device = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DDeviceImpl)); *device = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DDeviceImpl));
(*device)->private = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(mesa_d3dd_private)); (*device)->private = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(mesa_d3dd_private));
...@@ -921,17 +933,18 @@ int is_OpenGL_dx3(REFCLSID rguid, IDirectDrawSurfaceImpl* surface, IDirect3DDevi ...@@ -921,17 +933,18 @@ int is_OpenGL_dx3(REFCLSID rguid, IDirectDrawSurfaceImpl* surface, IDirect3DDevi
NULL, NULL,
GL_TRUE); GL_TRUE);
TRACE("Context created\n"); TRACE("Context created\n");
#if 0
/* Now override the surface's Flip method (if in double buffering) */ /* Look for the front buffer and override its surface's Flip method (if in double buffering) */
surface->s.d3d_device = (void *) odev; for (surf = surface; surf != NULL; surf = surf->surface_owner)
{ if ((surf->surface_desc.ddsCaps.dwCaps&(DDSCAPS_FLIP|DDSCAPS_FRONTBUFFER))
int i; == (DDSCAPS_FLIP|DDSCAPS_FRONTBUFFER))
struct _surface_chain *chain = surface->s.chain; {
for (i=0;i<chain->nrofsurfaces;i++) surface->surface_owner->aux_ctx = (LPVOID)odev->gdi_display;
if (chain->surfaces[i]->s.surface_desc.ddsCaps.dwCaps & DDSCAPS_FLIP) surface->surface_owner->aux_data = (LPVOID)odev->drawable;
chain->surfaces[i]->s.d3d_device = (void *) odev; surface->surface_owner->aux_flip = opengl_flip;
} break;
#endif }
odev->rs.src = GL_ONE; odev->rs.src = GL_ONE;
odev->rs.dst = GL_ZERO; odev->rs.dst = GL_ZERO;
odev->rs.mag = GL_NEAREST; odev->rs.mag = GL_NEAREST;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment