Skip to content

Commit

Permalink
Rip out special casing on Windows that defaults to the SDL directx
Browse files Browse the repository at this point in the history
driver over the Windows GDI one. This causes far too many problems.

Subversion-branch: /branches/v2-branch
Subversion-revision: 2710
  • Loading branch information
fragglet committed Oct 15, 2013
1 parent 5e8e817 commit 710e6b1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 109 deletions.
30 changes: 0 additions & 30 deletions src/i_video.c
Expand Up @@ -1851,36 +1851,6 @@ static void SetSDLVideoDriver(void)
putenv(env_string);
free(env_string);
}

#if defined(_WIN32) && !defined(_WIN32_WCE)

// Allow -gdi as a shortcut for using the windib driver.

//!
// @category video
// @platform windows
//
// Use the Windows GDI driver instead of DirectX.
//

if (M_CheckParm("-gdi") > 0)
{
putenv("SDL_VIDEODRIVER=windib");
}

// From the SDL 1.2.10 release notes:
//
// > The "windib" video driver is the default now, to prevent
// > problems with certain laptops, 64-bit Windows, and Windows
// > Vista.
//
// The hell with that.

if (getenv("SDL_VIDEODRIVER") == NULL)
{
putenv("SDL_VIDEODRIVER=directx");
}
#endif
}

static void SetWindowPositionVars(void)
Expand Down
79 changes: 0 additions & 79 deletions src/setup/display.c
Expand Up @@ -155,14 +155,6 @@ void SetDisplayDriver(void)
putenv(env_string);
free(env_string);
}
else
{
#if defined(_WIN32) && !defined(_WIN32_WCE)
// On Windows, use DirectX over windib by default.

putenv("SDL_VIDEODRIVER=directx");
#endif
}
}

// Query SDL as to whether any fullscreen modes are available for the
Expand Down Expand Up @@ -540,54 +532,6 @@ static void UpdateModeSeparator(TXT_UNCAST_ARG(widget),
}
}

#if defined(_WIN32) && !defined(_WIN32_WCE)

static int use_directx = 1;

static void SetWin32VideoDriver(void)
{
if (!strcmp(video_driver, "windib"))
{
use_directx = 0;
}
else
{
use_directx = 1;
}
}

static void UpdateVideoDriver(TXT_UNCAST_ARG(widget),
TXT_UNCAST_ARG(modes_table))
{
TXT_CAST_ARG(txt_table_t, modes_table);

if (use_directx)
{
video_driver = "";
}
else
{
video_driver = "windib";
}

// When the video driver is changed, we need to restart the textscreen
// library.

RestartTextscreen();

// Rebuild the list of supported pixel depths.

IdentifyPixelDepths();
SetSelectedBPP();

// Rebuild the video modes list

BuildFullscreenModesList();
GenerateModesTable(NULL, modes_table);
}

#endif

static void AdvancedDisplayConfig(TXT_UNCAST_ARG(widget),
TXT_UNCAST_ARG(modes_table))
{
Expand Down Expand Up @@ -618,29 +562,6 @@ static void AdvancedDisplayConfig(TXT_UNCAST_ARG(widget),
}

TXT_SignalConnect(ar_checkbox, "changed", GenerateModesTable, modes_table);

// On Windows, there is an extra control to change between
// the Windows GDI and DirectX video drivers.

#if defined(_WIN32) && !defined(_WIN32_WCE)
{
txt_radiobutton_t *dx_button, *gdi_button;

TXT_AddWidgets(window,
TXT_NewSeparator("Windows video driver"),
dx_button = TXT_NewRadioButton("DirectX",
&use_directx, 1),
gdi_button = TXT_NewRadioButton("Windows GDI",
&use_directx, 0),
NULL);

TXT_SignalConnect(dx_button, "selected",
UpdateVideoDriver, modes_table);
TXT_SignalConnect(gdi_button, "selected",
UpdateVideoDriver, modes_table);
SetWin32VideoDriver();
}
#endif
}

void ConfigDisplay(void)
Expand Down

0 comments on commit 710e6b1

Please sign in to comment.