Code Monkey home page Code Monkey logo

libstrangle-dlsym-fix's Introduction

libstrangle

Frame rate limiter for Linux.

Building

Typically you'll use these commands to build the program

make
sudo make install

Debian, Ubuntu and derivates may need some or all of these packages:

gcc-multilib
g++-multilib
libx11-dev
mesa-common-dev

OpenSUSE needs these packages:

glibc-devel-32bit
gcc
gcc-32bit
gcc-c++
gcc-c++-32bit

Usage

Cap the FPS (frames per second) of a chosen game by using the included script strangle Example:

strangle 60 /path/to/game

Run strangle --help for full usage info

Steam

You can use this with Steam by right-clicking on a game in your library and selecting Properties and then SET LAUNCH OPTIONS... under the General tab. In the input box type: strangle <somenumber> %command%

Laptops

On laptops you can specify an alternative framerate cap when running on battery power with the STRANGLE_FPS_BATTERY env var or by using the <fps>:<battery_fps> syntax with the strangle script. Example:

strangle 60:30 /path/to/game

Vsync

Vertical sync can be controlled by setting the STRANGLE_VSYNC environment variable or with the -v or --vsync command line options. Beware that OpenGL and Vulkan work differently on the same values:

OpenGL

  • -1 - Adaptive sync (unconfirmed if this actually works)
  • 0 - Force off
  • 1 - Force on
  • n - Sync to refresh rate / n.

Vulkan

  • 0 - Force off
  • 1 - Mailbox mode. Vsync with uncapped framerate.
  • 2 - Traditional vsync with framerate capped to refresh rate.
  • 3 - Adaptive vsync with tearing at low framerates.

Examples:

strangle -v 1 /path/to/game
STRANGLE_VSYNC=2 strangle /path/to/game
STRANGLE_VSYNC=1 strangle 40 /path/to/game

Options

Run strangle --help to see command line options.
Strangle can also be controlled with the following environment variables:

ENV VAR Value Explanation
STRANGLE_FPS <decimal> Maximum framerate. 0 to disable. Any positive value to enable
STRANGLE_FPS_BATTERY <decimal> Maximum framerate when running on battery power
STRANGLE_VSYNC <int> See the above section on v-sync
STRANGLE_GLFINISH 0 or 1 Forces glFinish() to run after every frame (OpenGL only)
STRANGLE_PICMIP -16 to 16 Mip-map LoD bias. Negative values will increase texture sharpness (and aliasing). Positive values will increase texture blurriness
STRANGLE_AF 1 to 16 Anisotropic filtering level. Improves sharpness of textures viewed at an angle (Vulkan only)
STRANGLE_BICUBIC 0 or 1 Force bicubic filtering (Vulkan only)
STRANGLE_TRILINEAR 0 or 1 Force trilinear filtering (Vulkan only)
STRANGLE_RETRO 0 or 1 Disables linear texture filtering. Makes textures look blocky. (Vulkan only)
STRANGLE_NODLSYM 0 or 1 Disables the hooking of dlsym
STRANGLE_VKONLY 0 or 1 Stops strangle's OpenGL libs from loading
ENABLE_VK_LAYER_TORKEL104_libstrangle 0 or 1 Enables the implicit Vulkan layer
DISABLE_VK_LAYER_TORKEL104_libstrangle 0 or 1 Disables the implicit Vulkan layer

Experimental stuff

Mip map lod bias examplevkQuake with STRANGLE_PICMIP=1337

You can adjust the mipmap lod bias in both opengl and vulkan with the environment variable STRANGLE_PICMIP. A higher value means blurrier textures. A negative value could make textures crisper.

Notice

Might crash if used together with other libs that hijack dlsym, such as Steam Overlay. It seems to work with Steam Overlay when placed at the end of LD_PRELOAD for some reason.

libstrangle-dlsym-fix's People

Contributors

torkel104 avatar smcv avatar v1993 avatar hkva avatar linagkar avatar pyamsoft avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.