Commit 16704da0 authored by Lionel Ulmer's avatar Lionel Ulmer Committed by Alexandre Julliard

Some corrections to the handling of off-screen buffers.

Correction to the EnumDisplayModes function. Added XShm support to Xlib driver. Open a DirectX window even when using the DGA driver.
parent 72b76d1a
......@@ -884,6 +884,12 @@ struct _common_directdrawdata {
DWORD depth;
DWORD height,width; /* SetDisplayMode */
HWND32 mainWindow; /* SetCooperativeLevel */
/* This is for Wine's fake mainWindow.
We need it also in DGA mode to make some games (for example Monkey Island III work) */
ATOM winclass;
HWND32 window;
PAINTSTRUCT32 ps;
};
struct _dga_directdrawdata {
......@@ -894,16 +900,15 @@ struct _dga_directdrawdata {
struct _xlib_directdrawdata {
Window drawable;
int use_xshm;
int paintable;
#ifdef HAVE_LIBXXSHM
int xshm_active;
#endif
/* are these needed for anything? (draw_surf is the active surface)
IDirectDrawSurface *surfs;
DWORD num_surfs, alloc_surfs, draw_surf; */
int paintable;
/* current window implementation */
ATOM winclass;
HWND32 window;
PAINTSTRUCT32 ps;
};
struct IDirectDraw {
......
......@@ -13,9 +13,13 @@
#include <X11/extensions/XShm.h>
extern Bool TSXShmQueryExtension(Display *);
extern Bool TSXShmQueryVersion(Display *, int *, int *, Bool *);
extern int TSXShmPixmapFormat(Display *);
extern Status TSXShmDetach(Display *, XShmSegmentInfo *);
extern Status TSXShmAttach(Display *, XShmSegmentInfo *);
extern Status TSXShmDetach(Display *, XShmSegmentInfo *);
extern Status TSXShmPutImage(Display *, Drawable, GC, XImage *, int, int, int, int, unsigned int, unsigned int, Bool);
extern Status TSXShmGetImage(Display *, Drawable, XImage *, int, int, unsigned long);
extern XImage * TSXShmCreateImage(Display *, Visual *, unsigned int, int, char *, XShmSegmentInfo *, unsigned int, unsigned int);
extern Pixmap TSXShmCreatePixmap(Display *, Drawable, char *, XShmSegmentInfo *, unsigned int, unsigned int, unsigned int);
#endif /* __WINE_TSXSHM_H */
......@@ -98,17 +98,32 @@ END
} elsif($name eq "XShm") {
output_fn("XShmQueryExtension", "Bool",
"Display *", "Display *a0", "a0");
output_fn("XShmQueryVersion", "Bool",
"Display *, int *, int *, Bool *",
"Display *a0, int *a1, int *a2, Bool *a3", "a0, a1, a2, a3");
output_fn("XShmPixmapFormat", "int",
"Display *", "Display *a0", "a0");
output_fn("XShmDetach", Status,
output_fn("XShmAttach", Status,
"Display *, XShmSegmentInfo *",
"Display *a0, XShmSegmentInfo *a1", "a0, a1");
output_fn("XShmAttach", Status,
output_fn("XShmDetach", Status,
"Display *, XShmSegmentInfo *",
"Display *a0, XShmSegmentInfo *a1", "a0, a1");
output_fn("XShmPutImage", Status,
"Display *, Drawable, GC, XImage *, int, int, int, int, unsigned int, unsigned int, Bool",
"Display *a0, Drawable a1, GC a2, XImage *a3, int a4, int a5, int a6, int a7, unsigned int a8, unsigned int a9, Bool a10", "a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10");
output_fn("XShmGetImage", Status,
"Display *, Drawable, XImage *, int, int, unsigned long",
"Display *a0, Drawable a1, XImage *a2, int a3, int a4, unsigned long a5",
"a0, a1, a2, a3, a4, a5");
output_fn("XShmCreateImage", "XImage *",
"Display *, Visual *, unsigned int, int, char *, XShmSegmentInfo *, unsigned int, unsigned int",
"Display *a0, Visual *a1, unsigned int a2, int a3, char *a4, XShmSegmentInfo *a5, unsigned int a6, unsigned int a7",
"a0, a1, a2, a3, a4, a5, a6, a7");
output_fn("XShmCreatePixmap", "Pixmap",
"Display *, Drawable, char *, XShmSegmentInfo *, unsigned int, unsigned int, unsigned int",
"Display *a0, Drawable a1, char *a2, XShmSegmentInfo *a3, unsigned int a4, unsigned int a5, unsigned int a6",
"a0, a1, a2, a3, a4, a5, a6");
} elsif($name eq "xf86dga") {
output_fn("XF86DGAQueryVersion",Bool,
"Display*,int*,int*",
......
......@@ -134,10 +134,14 @@ XSetWMProperties
XSetWMProtocols
XSetWMSizeHints
XShmAttach
XShmCreateImage
XShmCreatePixmap
XShmDetach
XShmGetImage
XShmPixmapFormat
XShmPutImage
XShmQueryExtension
XShmQueryVersion
XShrinkRegion
XStoreColor
XStoreName
......
......@@ -20,6 +20,17 @@ Bool TSXShmQueryExtension(Display *a0)
return r;
}
Bool TSXShmQueryVersion(Display *a0, int *a1, int *a2, Bool *a3)
{
Bool r;
TRACE(x11, "Call XShmQueryVersion\n");
EnterCriticalSection( &X11DRV_CritSection );
r = XShmQueryVersion(a0, a1, a2, a3);
LeaveCriticalSection( &X11DRV_CritSection );
TRACE(x11, "Ret XShmQueryVersion\n");
return r;
}
int TSXShmPixmapFormat(Display *a0)
{
int r;
......@@ -31,25 +42,25 @@ int TSXShmPixmapFormat(Display *a0)
return r;
}
Status TSXShmDetach(Display *a0, XShmSegmentInfo *a1)
Status TSXShmAttach(Display *a0, XShmSegmentInfo *a1)
{
Status r;
TRACE(x11, "Call XShmDetach\n");
TRACE(x11, "Call XShmAttach\n");
EnterCriticalSection( &X11DRV_CritSection );
r = XShmDetach(a0, a1);
r = XShmAttach(a0, a1);
LeaveCriticalSection( &X11DRV_CritSection );
TRACE(x11, "Ret XShmDetach\n");
TRACE(x11, "Ret XShmAttach\n");
return r;
}
Status TSXShmAttach(Display *a0, XShmSegmentInfo *a1)
Status TSXShmDetach(Display *a0, XShmSegmentInfo *a1)
{
Status r;
TRACE(x11, "Call XShmAttach\n");
TRACE(x11, "Call XShmDetach\n");
EnterCriticalSection( &X11DRV_CritSection );
r = XShmAttach(a0, a1);
r = XShmDetach(a0, a1);
LeaveCriticalSection( &X11DRV_CritSection );
TRACE(x11, "Ret XShmAttach\n");
TRACE(x11, "Ret XShmDetach\n");
return r;
}
......@@ -64,3 +75,36 @@ Status TSXShmPutImage(Display *a0, Drawable a1, GC a2, XImage *a3, int a4, int a
return r;
}
Status TSXShmGetImage(Display *a0, Drawable a1, XImage *a2, int a3, int a4, unsigned long a5)
{
Status r;
TRACE(x11, "Call XShmGetImage\n");
EnterCriticalSection( &X11DRV_CritSection );
r = XShmGetImage(a0, a1, a2, a3, a4, a5);
LeaveCriticalSection( &X11DRV_CritSection );
TRACE(x11, "Ret XShmGetImage\n");
return r;
}
XImage * TSXShmCreateImage(Display *a0, Visual *a1, unsigned int a2, int a3, char *a4, XShmSegmentInfo *a5, unsigned int a6, unsigned int a7)
{
XImage * r;
TRACE(x11, "Call XShmCreateImage\n");
EnterCriticalSection( &X11DRV_CritSection );
r = XShmCreateImage(a0, a1, a2, a3, a4, a5, a6, a7);
LeaveCriticalSection( &X11DRV_CritSection );
TRACE(x11, "Ret XShmCreateImage\n");
return r;
}
Pixmap TSXShmCreatePixmap(Display *a0, Drawable a1, char *a2, XShmSegmentInfo *a3, unsigned int a4, unsigned int a5, unsigned int a6)
{
Pixmap r;
TRACE(x11, "Call XShmCreatePixmap\n");
EnterCriticalSection( &X11DRV_CritSection );
r = XShmCreatePixmap(a0, a1, a2, a3, a4, a5, a6);
LeaveCriticalSection( &X11DRV_CritSection );
TRACE(x11, "Ret XShmCreatePixmap\n");
return r;
}
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