1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
memset (&surface_desc, 0, sizeof (surface_desc));
surface_desc.dwSize = sizeof (surface_desc);
surface_desc.dwFlags = DDSD_CAPS;
surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
/* Hack to cleanly remove a warning */
sd = &surface_desc;
if (FAILED(IDirectDraw7_CreateSurface(object,
(DDSURFACEDESC *)sd,
&surface_primary,
NULL)))
goto no_primary_surf;
if (FAILED(IDirectDrawSurface7_SetClipper(surface_primary,
clipper)))
goto no_primary_surf_set_clipper;
if (!GetClientRect(window, &rect))
goto no_get_client;
memset (&surface_desc, 0, sizeof (surface_desc));
surface_desc.dwSize = sizeof (surface_desc);
surface_desc.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
surface_desc.dwWidth = rect.right - rect.left;
surface_desc.dwHeight = rect.bottom - rect.top;
/* Hack to cleanly remove a warning */
sd = &surface_desc;
if (FAILED(IDirectDraw7_CreateSurface(object,
(DDSURFACEDESC *)sd,
&surface_back,
NULL)))
goto no_back_surf; |
Partager