if(fullScreenStretch) {
if((fullScreenStretch && (display != NULL && (display->getType() != DIRECT_3D))) || (display != NULL && display->getType() == OPENGL)) {
void updateWindowSize(int value){  regSetDwordValue("video", value);  if(value == VIDEO_OTHER) {    regSetDwordValue("fsWidth", fsWidth);    regSetDwordValue("fsHeight", fsHeight);    regSetDwordValue("fsColorDepth", fsColorDepth);  }    if(((value >= VIDEO_320x240) &&      (videoOption != value)) ||     (videoOption >= VIDEO_320x240 &&      value <= VIDEO_4X) ||     fsForceChange) {    fsForceChange = false;    changingVideoSize = TRUE;    shutdownDisplay();    shutdownDirectInput();    DragAcceptFiles(hWindow, FALSE);    DestroyWindow(hWindow);    hWindow = NULL;    videoOption = value;    if(!initDisplay()) {      if(videoOption == VIDEO_320x240 ||         videoOption == VIDEO_640x480 ||         videoOption == VIDEO_800x600 ||         videoOption == VIDEO_OTHER) {        regSetDwordValue("video", VIDEO_1X);        if(pVideoDriverGUID)          regSetDwordValue("defaultVideoDriver", TRUE);      }      changingVideoSize = FALSE;      fileExit();      return;    }    if(!initDirectInput()) {      changingVideoSize = FALSE;      fileExit();      return;    }    checkKeys();    updateMenuBar();    changingVideoSize = FALSE;    updateWindowSize(videoOption);    return;  }    sizeX = 240;  sizeY = 160;  videoOption = value;    if(cartridgeType == 1) {    if(gbBorderOn) {      sizeX = 256;      sizeY = 224;      gbBorderLineSkip = 256;      gbBorderColumnSkip = 48;      gbBorderRowSkip = 40;    } else {      sizeX = 160;      sizeY = 144;      gbBorderLineSkip = 160;      gbBorderColumnSkip = 0;      gbBorderRowSkip = 0;    }  }    surfaceSizeX = sizeX;  surfaceSizeY = sizeY;  switch(videoOption) {  case VIDEO_1X:    surfaceSizeX = sizeX;    surfaceSizeY = sizeY;    break;  case VIDEO_2X:    surfaceSizeX = sizeX * 2;    surfaceSizeY = sizeY * 2;    break;  case VIDEO_3X:    surfaceSizeX = sizeX * 3;    surfaceSizeY = sizeY * 3;    break;  case VIDEO_4X:    surfaceSizeX = sizeX * 4;    surfaceSizeY = sizeY * 4;    break;  case VIDEO_320x240:  case VIDEO_640x480:  case VIDEO_800x600:  case VIDEO_OTHER:    {      int scaleX = 1;      int scaleY = 1;      scaleX = (fsWidth / sizeX);      scaleY = (fsHeight / sizeY);      int min = scaleX < scaleY ? scaleX : scaleY;      surfaceSizeX = min * sizeX;      surfaceSizeY = min * sizeY;      if(fullScreenStretch) {        surfaceSizeX = fsWidth;        surfaceSizeY = fsHeight;      }    }    break;  }  rect.right = sizeX;  rect.bottom = sizeY;  int winSizeX = sizeX;  int winSizeY = sizeY;    if(videoOption <= VIDEO_4X) {    dest.left = 0;    dest.top = 0;    dest.right = surfaceSizeX;    dest.bottom = surfaceSizeY;            DWORD style = WS_POPUP | WS_VISIBLE;        style |= WS_OVERLAPPEDWINDOW;        menuToggle = TRUE;    AdjustWindowRectEx(&dest, style, TRUE, 0); //WS_EX_TOPMOST);        winSizeX = dest.right-dest.left;    winSizeY = dest.bottom-dest.top;    if(skin == NULL) {      SetWindowPos(hWindow,                   0, //HWND_TOPMOST,                   windowPositionX,                   windowPositionY,                   winSizeX,                   winSizeY,                   SWP_NOMOVE | SWP_SHOWWINDOW);      winCheckMenuBarInfo(winSizeX, winSizeY);    }  }  adjustDestRect();  updateIFB();    updateFilter();    RedrawWindow(hWindow,NULL,NULL,RDW_INVALIDATE|RDW_ERASE|RDW_ALLCHILDREN);  }