Giter VIP home page Giter VIP logo

Comments (4)

icculus avatar icculus commented on June 27, 2024

Yeah, but we probably need an environment variable to force it off if someone wants less pixels for more performance.

from sdl12-compat.

flibitijibibo avatar flibitijibibo commented on June 27, 2024

FWIW I ran into this in implementing high-DPI support in FNA - the end result was that we defaulted to having it off and using the environment variable to turn it on:

https://github.com/FNA-XNA/FNA/wiki/7:-FNA-Environment-Variables#fna_graphics_enable_highdpi

There were two reasons for this:

  • The XNA API did not anticipate high-DPI drawables, similar to SDL 1.2. Also vaguely similar to SDL 1.2 is that the window size is based on the backbuffer size, the latter being what the programmer sets - XNA has PreferredBackbufferWidth/Height, SDL has SetVideoMode. Both have sets and neither have gets (necessarily, you can dig in and get the info but it digs into uncharted territory), and conveniently it doesn't strictly say the video mode is the window size. We ultimately decided that the backbuffer size should get priority over the window size; when FNA HighDPI is on we actually shrink the window so that the video mode technically matches what the program requested, at the expense of the window being small. This sounds weird until you consider that A: Many games are picky about the viewport size and would actually break if we made the backbuffer bigger than what they expected, and B: Consider the fullscreen scenario, where the game will request full 4K but the desktop's simulated size will be 1920x1080, so while the game thinks it's running a huge window it's actually just conforming to exactly how high-DPI works, with no weird application hacks required!
  • For low-res games, defaulting to high-DPI is actually a problem! A good test case for this is VVVVVV; right now it defaults to always trying high-DPI, but the problem is that the default backbuffer size is 320x240, and since we prioritize backbuffer size over window size...

image

It's a default setting for ants, but also a very likely default for old games using SDL 1.2! I've sort of looked the other way on this in VVV because I want to make fullscreen the default, which will make this unnoticeable 99% of the time, but it's still really funny when you first load it and a postage stamp suddenly pops up on your monitor.

This is probably way more text than was necessary, but I've worked on supporting this a lot so this is probably the exact one thing that I can actually contribute to 12-compat beyond just throwing old games at it. For a live example, load up the FEZ Steam beta for macOS or Wayland and enable the high-DPI mode in the video options menu.

from sdl12-compat.

icculus avatar icculus commented on June 27, 2024

I stuck a thing in there (defaulting to OFF). Good enough, everyone?

from sdl12-compat.

flibitijibibo avatar flibitijibibo commented on June 27, 2024

lgtm!

from sdl12-compat.

Related Issues (20)

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.