Release 20050930.
[wine/gsoc-2012-control.git] / dlls / ddraw / ddraw_user.c
blobe1e18a9911b35a828cc3f94de4bb4058810f0c47
1 /* DirectDraw driver for User-based primary surfaces
3 * Copyright 2000-2001 TransGaming Technologies Inc.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 #include "config.h"
22 #include <assert.h>
23 #include <stdarg.h>
24 #include <string.h>
26 #define NONAMELESSUNION
27 #define NONAMELESSSTRUCT
29 #include "windef.h"
30 #include "winbase.h"
31 #include "wingdi.h"
32 #include "winuser.h"
33 #include "ddraw.h"
34 #include "ddraw_private.h"
35 #include "wine/debug.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(ddraw);
39 static const IDirectDraw7Vtbl User_DirectDraw_VTable;
41 static const DDDEVICEIDENTIFIER2 user_device =
43 "display",
44 "User (and GDI)",
45 { { 0x00010001, 0x00010001 } },
46 0, 0, 0, 0,
47 /* fe38440c-8969-4283-bc73-749e7bc3c2eb */
48 {0xfe38440c,0x8969,0x428e, {0x73,0xbc,0x74,0x9e,0x7b,0xc3,0xc2,0xeb}},
52 static const DDPIXELFORMAT pixelformats[] =
54 /* 8bpp paletted */
55 { sizeof(DDPIXELFORMAT), DDPF_RGB|DDPF_PALETTEINDEXED8, 0, { 8 } },
56 /* 15bpp 5/5/5 */
57 { sizeof(DDPIXELFORMAT), DDPF_RGB, 0, { 16 }, { 0x7C00 }, { 0x3E0 },
58 { 0x1F } },
59 /* 16bpp 5/6/5 */
60 { sizeof(DDPIXELFORMAT), DDPF_RGB, 0, { 16 }, { 0xF800 }, { 0x7E0 },
61 { 0x1F } },
62 /* 24bpp 8/8/8 */
63 { sizeof(DDPIXELFORMAT), DDPF_RGB, 0, { 24 }, { 0xFF0000 },
64 { 0x00FF00 }, { 0x0000FF } },
65 /* 32bpp 8/8/8 */
66 { sizeof(DDPIXELFORMAT), DDPF_RGB, 0, { 32 }, { 0xFF0000 },
67 { 0x00FF00 }, { 0x0000FF } }
70 HRESULT User_DirectDraw_Create(const GUID* pGUID, LPDIRECTDRAW7* pIface,
71 IUnknown* pUnkOuter, BOOL ex);
72 HRESULT User_DirectDraw_Initialize(IDirectDrawImpl*, const GUID*);
74 static const ddraw_driver user_driver =
76 &user_device,
77 10,
78 User_DirectDraw_Create,
79 User_DirectDraw_Initialize
82 BOOL DDRAW_User_Init(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
84 if (fdwReason == DLL_PROCESS_ATTACH)
85 DDRAW_register_driver(&user_driver);
87 return TRUE;
90 static const DDPIXELFORMAT* pixelformat_for_depth(DWORD depth)
92 switch (depth)
94 case 8: return pixelformats + 0;
95 case 15: return pixelformats + 1;
96 case 16: return pixelformats + 2;
97 case 24: return pixelformats + 3;
98 case 32: return pixelformats + 4;
99 default: return NULL;
103 /* Not called from the vtable. */
104 HRESULT User_DirectDraw_Construct(IDirectDrawImpl *This, BOOL ex)
106 HRESULT hr;
107 DWORD depth;
108 HDC hDC;
110 TRACE("(%p,%d)\n",This,ex);
112 hr = Main_DirectDraw_Construct(This, ex);
113 if (FAILED(hr)) return hr;
115 This->final_release = User_DirectDraw_final_release;
117 This->create_primary = User_DirectDraw_create_primary;
118 This->create_backbuffer = User_DirectDraw_create_backbuffer;
120 hDC = CreateDCA("DISPLAY", NULL, NULL, NULL);
121 depth = GetDeviceCaps(hDC, BITSPIXEL) * GetDeviceCaps(hDC, PLANES);
122 DeleteDC(hDC);
124 This->width = GetSystemMetrics(SM_CXSCREEN);
125 This->height = GetSystemMetrics(SM_CYSCREEN);
126 This->pitch = DDRAW_width_bpp_to_pitch(This->width, depth);
127 This->pixelformat = *pixelformat_for_depth(depth);
129 This->orig_width = This->width;
130 This->orig_height = This->height;
131 This->orig_pitch = This->pitch;
132 This->orig_pixelformat = This->pixelformat;
134 ICOM_INIT_INTERFACE(This, IDirectDraw7, User_DirectDraw_VTable);
136 /* capabilities */
137 #define BLIT_CAPS (DDCAPS_BLT | DDCAPS_BLTCOLORFILL | DDCAPS_BLTDEPTHFILL \
138 | DDCAPS_BLTSTRETCH | DDCAPS_CANBLTSYSMEM | DDCAPS_CANCLIP \
139 | DDCAPS_CANCLIPSTRETCHED | DDCAPS_COLORKEY \
140 | DDCAPS_COLORKEYHWASSIST | DDCAPS_OVERLAY | DDCAPS_OVERLAYSTRETCH)
141 #define CKEY_CAPS (DDCKEYCAPS_DESTBLT | DDCKEYCAPS_SRCBLT)
142 #define FX_CAPS (DDFXCAPS_BLTALPHA | DDFXCAPS_BLTMIRRORLEFTRIGHT \
143 | DDFXCAPS_BLTMIRRORUPDOWN | DDFXCAPS_BLTROTATION90 \
144 | DDFXCAPS_BLTSHRINKX | DDFXCAPS_BLTSHRINKXN \
145 | DDFXCAPS_BLTSHRINKY | DDFXCAPS_BLTSHRINKXN \
146 | DDFXCAPS_BLTSTRETCHX | DDFXCAPS_BLTSTRETCHXN \
147 | DDFXCAPS_BLTSTRETCHY | DDFXCAPS_BLTSTRETCHYN)
148 This->caps.dwCaps |= DDCAPS_GDI | DDCAPS_PALETTE | BLIT_CAPS;
149 if( opengl_initialized )
151 /* Hack for D3D code */
152 This->caps.dwCaps |= DDCAPS_3D;
154 This->caps.dwCaps2 |= DDCAPS2_CERTIFIED | DDCAPS2_NOPAGELOCKREQUIRED |
155 DDCAPS2_PRIMARYGAMMA | DDCAPS2_WIDESURFACES;
156 This->caps.dwCKeyCaps |= CKEY_CAPS;
157 This->caps.dwFXCaps |= FX_CAPS;
158 This->caps.dwPalCaps |= DDPCAPS_8BIT | DDPCAPS_PRIMARYSURFACE;
159 This->caps.dwVidMemTotal = 16*1024*1024;
160 This->caps.dwVidMemFree = 16*1024*1024;
161 This->caps.dwSVBCaps |= BLIT_CAPS;
162 This->caps.dwSVBCKeyCaps |= CKEY_CAPS;
163 This->caps.dwSVBFXCaps |= FX_CAPS;
164 This->caps.dwVSBCaps |= BLIT_CAPS;
165 This->caps.dwVSBCKeyCaps |= CKEY_CAPS;
166 This->caps.dwVSBFXCaps |= FX_CAPS;
167 This->caps.dwSSBCaps |= BLIT_CAPS;
168 This->caps.dwSSBCKeyCaps |= CKEY_CAPS;
169 This->caps.dwSSBFXCaps |= FX_CAPS;
170 This->caps.ddsCaps.dwCaps |= DDSCAPS_ALPHA | DDSCAPS_BACKBUFFER |
171 DDSCAPS_FLIP | DDSCAPS_FRONTBUFFER |
172 DDSCAPS_OFFSCREENPLAIN | DDSCAPS_PALETTE |
173 DDSCAPS_PRIMARYSURFACE | DDSCAPS_SYSTEMMEMORY |
174 DDSCAPS_VIDEOMEMORY | DDSCAPS_VISIBLE;
175 if( opengl_initialized )
177 /* Hacks for D3D code */
178 This->caps.ddsCaps.dwCaps |= DDSCAPS_3DDEVICE | DDSCAPS_MIPMAP | DDSCAPS_TEXTURE | DDSCAPS_ZBUFFER;
181 This->caps.ddsOldCaps.dwCaps = This->caps.ddsCaps.dwCaps;
182 #undef BLIT_CAPS
183 #undef CKEY_CAPS
184 #undef FX_CAPS
186 return S_OK;
189 /* This function is called from DirectDrawCreate(Ex) on the most-derived
190 * class to start construction.
191 * Not called from the vtable. */
192 HRESULT User_DirectDraw_Create(const GUID* pGUID, LPDIRECTDRAW7* pIface,
193 IUnknown* pUnkOuter, BOOL ex)
195 HRESULT hr;
196 IDirectDrawImpl* This;
198 assert(pUnkOuter == NULL);
200 This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
201 sizeof(IDirectDrawImpl) + sizeof(User_DirectDrawImpl));
202 if (This == NULL) return E_OUTOFMEMORY;
204 /* Note that this relation does *not* hold true if the DD object was
205 * CoCreateInstanced then Initialized. */
206 This->private = (User_DirectDrawImpl *)(This+1);
208 /* Initialize the DDCAPS structure */
209 This->caps.dwSize = sizeof(This->caps);
211 hr = User_DirectDraw_Construct(This, ex);
212 if (FAILED(hr))
213 HeapFree(GetProcessHeap(), 0, This);
214 else
215 *pIface = ICOM_INTERFACE(This, IDirectDraw7);
217 return hr;
220 /* This function is called from Uninit_DirectDraw_Initialize on the
221 * most-derived-class to start initialization.
222 * Not called from the vtable. */
223 HRESULT User_DirectDraw_Initialize(IDirectDrawImpl *This, const GUID* guid)
225 HRESULT hr;
226 This->private = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
227 sizeof(User_DirectDrawImpl));
228 if (This->private == NULL) return E_OUTOFMEMORY;
230 /* Initialize the DDCAPS structure */
231 This->caps.dwSize = sizeof(This->caps);
233 hr = User_DirectDraw_Construct(This, TRUE); /* XXX ex? */
234 if (FAILED(hr))
236 HeapFree(GetProcessHeap(), 0, This->private);
237 return hr;
240 return DD_OK;
243 /* Called from an internal function pointer. */
244 void User_DirectDraw_final_release(IDirectDrawImpl *This)
246 Main_DirectDraw_final_release(This);
249 /* Compact: generic */
250 /* CreateClipper: generic */
251 /* CreatePalette: generic (with callback) */
252 /* CreateSurface: generic (with callbacks) */
254 HRESULT
255 User_DirectDraw_create_primary(IDirectDrawImpl* This,
256 const DDSURFACEDESC2* pDDSD,
257 LPDIRECTDRAWSURFACE7* ppSurf,
258 IUnknown* pUnkOuter)
260 return User_DirectDrawSurface_Create(This, pDDSD, ppSurf, pUnkOuter);
263 HRESULT
264 User_DirectDraw_create_backbuffer(IDirectDrawImpl* This,
265 const DDSURFACEDESC2* pDDSD,
266 LPDIRECTDRAWSURFACE7* ppSurf,
267 IUnknown* pUnkOuter,
268 IDirectDrawSurfaceImpl* primary)
270 return User_DirectDrawSurface_Create(This, pDDSD, ppSurf, pUnkOuter);
273 /* DuplicateSurface: generic */
275 /* Originally derived from Xlib_IDirectDraw2Impl_EnumDisplayModes.
277 * The depths are whatever DIBsections support on the client side.
278 * Should they be limited by screen depth?
280 HRESULT WINAPI
281 User_DirectDraw_EnumDisplayModes(LPDIRECTDRAW7 iface, DWORD dwFlags,
282 LPDDSURFACEDESC2 pDDSD, LPVOID context,
283 LPDDENUMMODESCALLBACK2 callback)
285 DDSURFACEDESC2 callback_sd;
286 DEVMODEW DevModeW;
287 const DDPIXELFORMAT* pixelformat;
289 int i;
291 TRACE("(%p)->(0x%08lx,%p,%p,%p)\n",iface,dwFlags,pDDSD,context,callback);
293 ZeroMemory(&callback_sd, sizeof(callback_sd));
294 callback_sd.dwSize = sizeof(callback_sd);
296 callback_sd.dwFlags = DDSD_HEIGHT|DDSD_WIDTH|DDSD_PIXELFORMAT|DDSD_CAPS
297 | DDSD_PITCH;
299 if (dwFlags & DDEDM_REFRESHRATES)
300 callback_sd.dwFlags |= DDSD_REFRESHRATE;
302 callback_sd.u2.dwRefreshRate = 60.0;
304 i = 0;
305 while (EnumDisplaySettingsExW(NULL, i, &DevModeW, 0))
307 callback_sd.dwHeight = DevModeW.dmPelsHeight;
308 callback_sd.dwWidth = DevModeW.dmPelsWidth;
309 if (DevModeW.dmFields&DM_DISPLAYFREQUENCY)
311 callback_sd.u2.dwRefreshRate = DevModeW.dmDisplayFrequency;
314 TRACE("- mode: %ldx%ld\n", callback_sd.dwWidth, callback_sd.dwHeight);
316 pixelformat = pixelformat_for_depth(DevModeW.dmBitsPerPel);
317 callback_sd.u1.lPitch
318 = DDRAW_width_bpp_to_pitch(DevModeW.dmPelsWidth,
319 pixelformat->u1.dwRGBBitCount);
321 callback_sd.u4.ddpfPixelFormat = *pixelformat;
323 callback_sd.ddsCaps.dwCaps = 0;
324 if (pixelformat->dwFlags & DDPF_PALETTEINDEXED8) /* ick */
325 callback_sd.ddsCaps.dwCaps |= DDSCAPS_PALETTE;
327 TRACE(" - %2ld bpp, R=%08lx G=%08lx B=%08lx\n",
328 callback_sd.u4.ddpfPixelFormat.u1.dwRGBBitCount,
329 callback_sd.u4.ddpfPixelFormat.u2.dwRBitMask,
330 callback_sd.u4.ddpfPixelFormat.u3.dwGBitMask,
331 callback_sd.u4.ddpfPixelFormat.u4.dwBBitMask);
332 if (callback(&callback_sd, context) == DDENUMRET_CANCEL)
333 return DD_OK;
334 i++;
337 return DD_OK;
340 /* EnumSurfaces: generic */
341 /* FlipToGDISurface: ??? */
343 #if 0
344 HRESULT WINAPI
345 User_DirectDraw_GetCaps(LPDIRECTDRAW7 iface, LPDDCAPS pDriverCaps,
346 LPDDCAPS pHELCaps)
348 /* Based on my guesses for what is appropriate with some clues from the
349 * NVidia driver. Not everything is actually implemented yet.
350 * NV has but we don't: Overlays, Video Ports, DDCAPS_READSCANLINE,
351 * DDCAPS2_CERTIFIED (heh), DDSCAPS2_NONLOCALVIDMEM, DDSCAPS2_COPYFOURCC.
352 * It actually has no FX alpha caps.
353 * Oddly, it doesn't list DDPCAPS_PRIMARYSURFACE.
354 * And the HEL caps make little sense.
356 #define BLIT_CAPS (DDCAPS_BLT | DDCAPS_BLTCOLORFILL | DDCAPS_BLTDEPTHFILL \
357 | DDCAPS_BLTSTRETCH | DDCAPS_CANBLTSYSMEM | DDCAPS_CANCLIP \
358 | DDCAPS_CANCLIPSTRETCHED | DDCAPS_COLORKEY \
359 | DDCAPS_COLORKEYHWASSIST | DDCAPS_OVERLAY | DDCAPS_OVERLAYSTRETCH)
361 #define CKEY_CAPS (DDCKEYCAPS_DESTBLT | DDCKEYCAPS_SRCBLT)
363 #define FX_CAPS (DDFXCAPS_BLTALPHA | DDFXCAPS_BLTMIRRORLEFTRIGHT \
364 | DDFXCAPS_BLTMIRRORUPDOWN | DDFXCAPS_BLTROTATION90 \
365 | DDFXCAPS_BLTSHRINKX | DDFXCAPS_BLTSHRINKXN \
366 | DDFXCAPS_BLTSHRINKY | DDFXCAPS_BLTSHRINKXN \
367 | DDFXCAPS_BLTSTRETCHX | DDFXCAPS_BLTSTRETCHXN \
368 | DDFXCAPS_BLTSTRETCHY | DDFXCAPS_BLTSTRETCHYN)
370 #if 0
371 #define ROPS { SRCCOPY, SRCPAINT, SRCAND, SRCINVERT, SRCERASE, NOTSRCCOPY, \
372 NOTSRCERASE, MERGEPAINT, BLACKNESS, WHITENESS, }
373 #else
374 #define ROPS { 0, }
375 #endif
377 static const DDCAPS caps =
378 { sizeof(DDCAPS),
379 DDCAPS_3D | DDCAPS_GDI | DDCAPS_PALETTE | BLIT_CAPS,
380 DDCAPS2_CANMANAGETEXTURE | DDCAPS2_CANRENDERWINDOWED | DDCAPS2_CERTIFIED
381 | DDCAPS2_NOPAGELOCKREQUIRED | DDCAPS2_PRIMARYGAMMA
382 | DDCAPS2_WIDESURFACES,
383 CKEY_CAPS,
384 FX_CAPS,
385 0, /* dwFXAlphaCaps */
386 DDPCAPS_8BIT | DDPCAPS_PRIMARYSURFACE,
387 0, /* dwSVCaps */
388 0, /* ? dwAlphaBitConstBitDepths */
389 0, /* ? dwAlphaBitPixelPitDepths */
390 0, /* ? dwAlphaBltSurfaceBitDepths */
391 0, /* ? dwAlphaOverlayConstBitDepths */
392 0, /* ? dwAlphaOverlayPixelBitDepths */
393 0, /* ? dwAlphaOverlaySurfaceBitDepths */
394 DDBD_16, /* ? dwZBufferBitDepths */
395 16*1024*1024, /* dwVidMemTotal */
396 16*1024*1024, /* dwVidMemFree */
397 0, /* dwMaxVisibleOverlays */
398 0, /* dwCurrVisibleOverlays */
399 0, /* dwNumFourCCCodes */
400 0, /* dwAlignBoundarySrc */
401 0, /* dwAlignSizeSrc */
402 0, /* dwAlignBoundaryDest */
403 0, /* dwAlignSizeDest */
404 0, /* dwAlignStrideAlign */
405 ROPS, /* XXX dwRops[DD_ROP_SPACE] */
406 { 0, }, /* XXX ddsOldCaps */
407 1000, /* dwMinOverlayStretch */
408 1000, /* dwMaxOverlayStretch */
409 1000, /* dwMinLiveVideoStretch */
410 1000, /* dwMaxLiveVideoStretch */
411 1000, /* dwMinHwCodecStretch */
412 1000, /* dwMaxHwCodecStretch */
413 0, 0, 0, /* dwReserved1, 2, 3 */
414 BLIT_CAPS, /* dwSVBCaps */
415 CKEY_CAPS, /* dwSVBCKeyCaps */
416 FX_CAPS, /* dwSVBFXCaps */
417 ROPS, /* dwSVBRops */
418 BLIT_CAPS, /* dwVSBCaps */
419 CKEY_CAPS, /* dwVSBCKeyCaps */
420 FX_CAPS, /* dwVSBFXCaps */
421 ROPS, /* dwVSBRops */
422 BLIT_CAPS, /* dwSSBCaps */
423 CKEY_CAPS, /* dwSSBCKeyCaps */
424 FX_CAPS, /* dwSSBFXCaps */
425 ROPS, /* dwSSBRops */
426 0, /* dwMaxVideoPorts */
427 0, /* dwCurrVideoPorts */
428 0, /* ? dwSVBCaps2 */
429 BLIT_CAPS, /* ? dwNLVBCaps */
430 0, /* ? dwNLVBCaps2 */
431 CKEY_CAPS, /* dwNLVBCKeyCaps */
432 FX_CAPS, /* dwNLVBFXCaps */
433 ROPS, /* dwNLVBRops */
434 { /* ddsCaps */
435 DDSCAPS_3DDEVICE | DDSCAPS_ALPHA | DDSCAPS_BACKBUFFER | DDSCAPS_FLIP
436 | DDSCAPS_FRONTBUFFER | DDSCAPS_MIPMAP | DDSCAPS_OFFSCREENPLAIN
437 | DDSCAPS_PALETTE | DDSCAPS_PRIMARYSURFACE | DDSCAPS_SYSTEMMEMORY
438 | DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY | DDSCAPS_VISIBLE
439 | DDSCAPS_ZBUFFER,
440 DDSCAPS2_CUBEMAP,
446 #undef BLIT_CAPS
447 #undef CKEY_CAPS
448 #undef FX_CAPS
449 #undef ROPS
451 IDirectDrawImpl *This = (IDirectDrawImpl *)iface;
453 TRACE("(%p)->(%p,%p)\n",This,pDriverCaps,pHELCaps);
455 if (pDriverCaps != NULL)
456 DD_STRUCT_COPY_BYSIZE(pDriverCaps,&caps);
458 if (pHELCaps != NULL)
459 DD_STRUCT_COPY_BYSIZE(pHELCaps,&caps);
461 return DD_OK;
463 #endif
465 HRESULT WINAPI
466 User_DirectDraw_GetDeviceIdentifier(LPDIRECTDRAW7 iface,
467 LPDDDEVICEIDENTIFIER2 pDDDI,
468 DWORD dwFlags)
470 TRACE("(%p)->(%p,%08lx)\n",iface,pDDDI,dwFlags);
471 *pDDDI = user_device;
472 return DD_OK;
475 /* GetDisplayMode: generic */
476 /* GetFourCCCodes: generic */
477 /* GetGDISurface: ??? */
478 /* GetMonitorFrequency: generic */
479 /* GetScanLine: generic */
480 /* GetSurfaceFromDC: generic */
481 /* GetVerticalBlankStatus: generic */
482 /* Initialize: generic */
483 /* RestoreAllSurfaces: generic */
484 /* RestoreDisplayMode: generic */
485 /* SetCooperativeLevel: ??? */
487 HRESULT WINAPI
488 User_DirectDraw_SetDisplayMode(LPDIRECTDRAW7 iface, DWORD dwWidth,
489 DWORD dwHeight, DWORD dwBPP,
490 DWORD dwRefreshRate, DWORD dwFlags)
492 IDirectDrawImpl *This = (IDirectDrawImpl *)iface;
494 const DDPIXELFORMAT* pixelformat;
495 DEVMODEW devmode;
496 LONG pitch;
498 TRACE("(%p)->(%ldx%ldx%ld,%ld Hz,%08lx)\n",This,dwWidth,dwHeight,dwBPP,dwRefreshRate,dwFlags);
499 devmode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
500 devmode.dmBitsPerPel = dwBPP;
501 devmode.dmPelsWidth = dwWidth;
502 devmode.dmPelsHeight = dwHeight;
503 /* '0' means default frequency */
504 if (dwRefreshRate != 0)
506 devmode.dmFields |= DM_DISPLAYFREQUENCY;
507 devmode.dmDisplayFrequency = dwRefreshRate;
509 if (ChangeDisplaySettingsExW(NULL, &devmode, NULL, CDS_FULLSCREEN, NULL) != DISP_CHANGE_SUCCESSFUL)
510 return DDERR_INVALIDMODE;
512 pixelformat = pixelformat_for_depth(dwBPP);
513 if (pixelformat == NULL)
515 assert(0);
516 return DDERR_GENERIC;
519 pitch = DDRAW_width_bpp_to_pitch(dwWidth, dwBPP);
520 return Main_DirectDraw_SetDisplayMode(iface, dwWidth, dwHeight, pitch,
521 dwRefreshRate, dwFlags, pixelformat);
524 /* StartModeTest: ??? */
525 /* TestCooperativeLevel: generic? */
526 /* WaitForVerticalBlank: ??? */
528 static const IDirectDraw7Vtbl User_DirectDraw_VTable =
530 Main_DirectDraw_QueryInterface,
531 Main_DirectDraw_AddRef,
532 Main_DirectDraw_Release,
533 Main_DirectDraw_Compact,
534 Main_DirectDraw_CreateClipper,
535 Main_DirectDraw_CreatePalette,
536 Main_DirectDraw_CreateSurface,
537 Main_DirectDraw_DuplicateSurface,
538 User_DirectDraw_EnumDisplayModes,
539 Main_DirectDraw_EnumSurfaces,
540 Main_DirectDraw_FlipToGDISurface,
541 Main_DirectDraw_GetCaps,
542 Main_DirectDraw_GetDisplayMode,
543 Main_DirectDraw_GetFourCCCodes,
544 Main_DirectDraw_GetGDISurface,
545 Main_DirectDraw_GetMonitorFrequency,
546 Main_DirectDraw_GetScanLine,
547 Main_DirectDraw_GetVerticalBlankStatus,
548 Main_DirectDraw_Initialize,
549 Main_DirectDraw_RestoreDisplayMode,
550 Main_DirectDraw_SetCooperativeLevel,
551 User_DirectDraw_SetDisplayMode,
552 Main_DirectDraw_WaitForVerticalBlank,
553 Main_DirectDraw_GetAvailableVidMem,
554 Main_DirectDraw_GetSurfaceFromDC,
555 Main_DirectDraw_RestoreAllSurfaces,
556 Main_DirectDraw_TestCooperativeLevel,
557 User_DirectDraw_GetDeviceIdentifier,
558 Main_DirectDraw_StartModeTest,
559 Main_DirectDraw_EvaluateMode