justin = {
main feed
,
music
,
code
= {
cockos
,
reaper
,
wdl
,
ninjam
,
jsfx
,
more
}
,
askjf
,
pubkey
};
Ask Justin Frankel
No reasonable question unanswered since 2009!
Suggested topics: programming, music, sleep, coffee, etc.
Note: please do not ask questions about REAPER features, bugs or scheduling, use the
forums
instead.
Name:
Ask:
Human (enter yes):
[
back to index
] | [
unreplied
] | [
replied
] | [
recent comments
] | [
all
]
Question:
Hey Justin, for my gui-library I need to prevent Retina-upscaling since I have my own scaling-engine. How do I turn off Retina on Retina computers? gfx.ext_retina=0?
Asked by Mespotine (176.6.145.x) on January 6 2025, 9:42pm
Reply on January 7 2025, 3:46am:
gfx.ext_retina=1 on initialization. then, from that point on, you'd want to render with your own scaling, using gfx.ext_retina as the scalefactor. e.g. if it is 2.0, you should use fonts that are double the size, etc. does that make sense? and additionally, on Windows/linux, it will get set with the effective scaling.
Comments:
Posted by Mespotine (176.6.144.x) on January 7 2025, 7:45pm:
So, if I understand correctly, it's not possible to turn Retina-support off? I basically just want to have on all systems the same behavior as on non-Retina systems.
Posted by
Justin
on January 7 2025, 9:24pm:
If you set gfx.ext_retina=1 and then subsequently ignore it, on macOS retina displays everything will be tiny and high resolution. is that what you mean?
Posted by Mespotine (176.6.144.x) on January 7 2025, 9:39pm:
Probably yes, will check this out. Thanks :)
Posted by Mespotine (176.6.142.x) on January 14 2025, 8:19pm:
I have tested the approach and setting gfx.ext_retina=1 scales now properly. However, gfx.init() still blows up the window size by 2, so I need now a way to make the window half the size so it's scaled properly with my gui. And here's a problem: I can't find out, if Retina is active in the initial, non-deferred script-run, only in the first defer-cycle.
Posted by Mespotine (176.6.142.x) on January 14 2025, 8:20pm:
My current approach is the following: In the initial run of the script, I set gfx.ext_retina=1. Then I open the window, which will be twice the size and therefore too big for my 1x-scaling, so I need to make it half the size. But only in the first defer-cycle, gfx.ext_retina is set to 2 which gives me a hint that Retina is active. However, I would have needed to know in the initial run as well, so I can make the window half the size right away, but I can do it only in the first defer-cycle, not in the initi
Posted by Mespotine (176.6.142.x) on January 14 2025, 8:21pm:
...not in the initial run of the script? If it's not possible, would it be possible to add some kind of hint? Or even better, setting gfx.ext_retina=-1 overrides all scaling of the window including gfx.init() as well?
Posted by Mespotine (176.6.142.x) on January 14 2025, 10:09pm:
I found a way around the problem: I check after gfx.init() if gfx.w and gfx.h are bigger than expected and resize the window accordingly with another gfx.init().This probably does the trick.
Posted by
Justin
on January 23 2025, 11:01pm:
that's probably what is needed -- thing is, on a multimonitor display, you won't know the retina/dpi until the window is displayed and positioned.
Comment:
Your Name:
-- Site Owner's Name:
(for human-verification) Comment:
[
back to index
] | [
unreplied
] | [
replied
] | [
recent comments
] | [
all
]
Copyright 2025 Justin Frankel
.
|
RSS