Comments (4)
Yeah, but we probably need an environment variable to force it off if someone wants less pixels for more performance.
from sdl12-compat.
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...
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.
I stuck a thing in there (defaulting to OFF). Good enough, everyone?
from sdl12-compat.
lgtm!
from sdl12-compat.
Related Issues (20)
- Fuse ZX Spectrum emulator: mouse grab after returning from full screen
- Cogmind support HOT 3
- more icebreaker issues (crash on startup) HOT 3
- makes SDL_perl regress when it (incorrectly) frees a former video surface HOT 19
- Feat.req. Keep artifacts in Actions tab for longer time
- MSVC ARM32 builds fail linkage HOT 1
- add MSVC arm64 and mingw32/64 runs to CI HOT 1
- SDL_LoadWAV() crashes with invalid files
- How about opposite approach :) ? HOT 1
- Trine (old humble bundle version) has black screen when in-game HOT 4
- Mark of the Ninja - Failure to render anything but a black screen HOT 3
- Hyperspace Delivery Boy [LGP] colorkeys are broken on >16bpp displays HOT 2
- Alpha Centauri - Mouse jumps during movement instructions HOT 3
- 1.2.68 release? HOT 13
- issues affecting Loki port of Soldier of Fortune HOT 5
- pkgsrc: audio/din just has a black screen on Darwin 23.1.0/arm64 HOT 2
- Compilation failed on SDL2 < 2.0.10 HOT 1
- Statically linking SDL2 at compile time, rather than dynamically loading it at runtime
- xu4 (Ultima IV remastered, older SVN version) fails HOT 1
- Please add SDL12COMPAT_NO_QUIT_VIDEO to the README HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sdl12-compat.