GLES samples have wrong scale / coordinates / something on Windows #45

Closed
opened 2023-08-17 02:06:18 +00:00 by bvisness · 5 comments
Owner

See videos. Both samples seem to run fine on Mac.

See videos. Both samples seem to run fine on Mac.
bvisness changed title from Fluid sample has wrong scale / coordinates / something on Windows to GLES samples have wrong scale / coordinates / something on Windows 2023-08-17 02:09:23 +00:00
Collaborator

ah 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?

ah 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?
MartinFouilleul self-assigned this 2023-08-18 10:08:49 +00:00
Author
Owner

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?

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?
Collaborator

Would that allow the user to draw pixel perfect lines without reversing the DPI and rounding? (if that's something we care about)

Would that allow the user to draw pixel perfect lines without reversing the DPI and rounding? (if that's something we care about)
Collaborator

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).

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).
Author
Owner

Would that allow the user to draw pixel perfect lines without reversing the DPI and rounding? (if that's something we care about)

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.

> Would that allow the user to draw pixel perfect lines without reversing the DPI and rounding? (if that's something we care about) 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.
bvisness added this to the Jam MVP milestone 2023-08-23 02:49:18 +00:00
Sign in to join this conversation.
No Label
macOS
windows
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: hmn/orca#45
No description provided.