GLES samples have wrong scale / coordinates / something on Windows #45
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
See videos. Both samples seem to run fine on Mac.
Fluid sample has wrong scale / coordinates / something on Windowsto GLES samples have wrong scale / coordinates / something on Windowsah yeah, the way we handle different dpi scalings is still shaky (and differs in windows and macos).
I will fix that soon, basically have to decide if we just expose it to the apps or if we try to "hide it" (I'm more inclined to favor the first solution at the moment).
Is the display you're using high dpi?
On Mac it is, on Windows it is not.
I think DPI should certainly be exposed to apps eventually, but I feel quite strongly that our canvas renderer needs to do automatic DPI and work with "fake pixels" like CSS does. If for some reason you ever want to render vector graphics at a lower resolution, you should in theory be able to do it by composing different graphics surfaces, right?
Would that allow the user to draw pixel perfect lines without reversing the DPI and rounding? (if that's something we care about)
The canvas should already work in "points" that convert to pixels according to dpi, but it only handles equal scaling values for x and y axes (I don't know if this is a real concern, but windows API gives you a dpi value for each axis)
I also think window dimensions reported to orca apps should be in points and not depend on dpi.
GLES glViewport though works directly with the real pixels, so you have to mulitply the dimensions received by
oc_on_resize()
with the dpi scaling factor when you call glViewport. (In the samples I just hardcoded the scaling to 2 because I don't yet have a way to query its actual value).I'm not sure we do care about that, but I think we could probably figure out a way to wedge that into the API later? Allowing fractional positions would at least be a decent stopgap, no different from CSS in any case.