Skip to content

Commit

Permalink
Added 'bxt_disable_v_sync' to disable V-Sync in pre-Steampipe builds
Browse files Browse the repository at this point in the history
  • Loading branch information
SmileyAG committed Feb 17, 2023
1 parent d21dedd commit 9a03b77
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions BunnymodXT/modules/HwDLL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2399,6 +2399,22 @@ void HwDLL::StartTASPlayback()
}
}

struct HwDLL::Cmd_BXT_Disable_V_Sync
{
NO_USAGE();

static void handler()
{
#ifdef _WIN32
typedef BOOL(APIENTRY* PFNWGLSWAPINTERVALPROC)(int);
PFNWGLSWAPINTERVALPROC wglSwapIntervalEXT = 0;
wglSwapIntervalEXT = (PFNWGLSWAPINTERVALPROC)wglGetProcAddress("wglSwapIntervalEXT");
if (wglSwapIntervalEXT)
wglSwapIntervalEXT(0);
#endif
}
};

struct HwDLL::Cmd_BXT_TAS_LoadScript
{
USAGE("Usage: bxt_tas_loadscript <filename>\n");
Expand Down Expand Up @@ -4613,6 +4629,7 @@ void HwDLL::RegisterCVarsAndCommandsIfNeeded()
CmdFuncs::AddCommand("notarget", ORIG_Host_Notarget_f);
}

wrapper::Add<Cmd_BXT_Disable_V_Sync, Handler<>>("bxt_disable_v_sync");
wrapper::Add<Cmd_BXT_TAS_LoadScript, Handler<const char *>>("bxt_tas_loadscript");
wrapper::Add<Cmd_BXT_TAS_ExportScript, Handler<const char *>>("bxt_tas_exportscript");
wrapper::Add<Cmd_BXT_TAS_ExportLibTASInput, Handler<const char *>>("bxt_tas_export_libtas_input");
Expand Down
1 change: 1 addition & 0 deletions BunnymodXT/modules/HwDLL.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ class HwDLL : public IHookableNameFilterOrdered

void FindStuff();

struct Cmd_BXT_Disable_V_Sync;
struct Cmd_BXT_TAS_LoadScript;
struct Cmd_BXT_TAS_ExportScript;
struct Cmd_BXT_TAS_ExportLibTASInput;
Expand Down

0 comments on commit 9a03b77

Please # to comment.