SetVirtualResolution

BlitzMax Forums/BlitzMax Programming/SetVirtualResolution

Cocopino(Posted 2017) [#1]
Hi,

I would like to apply scaling using mousewheel up/down. At first I thought I needed to use SetScale and calculate everything from there myself, then I thought of rendering everything at scale 1 to a single large image and showing that image scaled, but now I've stumbled upon the SetVirtualResolution, VirtualMouseX(), VirtualMouseY() etc functions.

So now I am thinking of using these built in functions instead, always keeping the initial aspect ratio intact of course. Problems I can think of are things like
- hardware support of weird virtual resolutions
- can you use multiple virtual resolutions before a render (e.g. resolution for a gui overlay should not be affected)
- image appearance when scaling (best method to avoid jarring etc)

Has anybody used this, is this a viable way of scaling a game?

Thanks!


Derron(Posted 2017) [#2]
You want things like popping in gui windows etc? If so you cannot rely on what you suggested. While you can scale all items you run into trouble when fading out elements.

The alpha gets multiplied then. Background is semitransparent and a widget on it is additionally semitransparent ...leading to a bleed-through effect.
You might think of playing with render2texture.


Bye
Ron


Cocopino(Posted 2017) [#3]
That sounds like it really could bite me in the behind later down the road...
Very insightful, I'll do some testing using different methods first - thanks!