int renderer_dd::ddraw_test_cooperative() { HRESULT result; // check our current status; if we lost the device, punt to GDI result = IDirectDraw7_TestCooperativeLevel(ddraw); switch (result) { // punt to GDI if someone else has exclusive mode case DDERR_NOEXCLUSIVEMODE: case DDERR_EXCLUSIVEMODEALREADYSET: ddraw_delete_surfaces(); return 1; // if we're ok, but we don't have a primary surface, create one default: case DD_OK: if (primary == NULL) return ddraw_create_surfaces(); return 0; } }
static int ddraw_test_cooperative(win_window_info *window) { dd_info *dd = (dd_info *)window->drawdata; HRESULT result; // check our current status; if we lost the device, punt to GDI result = IDirectDraw7_TestCooperativeLevel(dd->ddraw); switch (result) { // punt to GDI if someone else has exclusive mode case DDERR_NOEXCLUSIVEMODE: case DDERR_EXCLUSIVEMODEALREADYSET: ddraw_delete_surfaces(window); return 1; // if we're ok, but we don't have a primary surface, create one default: case DD_OK: if (dd->primary == NULL) return ddraw_create_surfaces(window); return 0; } }
static HRESULT WINAPI IDirectDraw4Impl_TestCooperativeLevel(LPDIRECTDRAW4 This) { return IDirectDraw7_TestCooperativeLevel((IDirectDraw7 *)ddraw_from_ddraw4(This)); }