Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cheaply scaling drawing #86

Closed
superlou opened this issue Apr 17, 2023 · 3 comments
Closed

Cheaply scaling drawing #86

superlou opened this issue Apr 17, 2023 · 3 comments

Comments

@superlou
Copy link

I understand that the intent of this library is to do all drawing in physical pixels, so the user can handle application-specific logic (e.g. snapping to integer pixel positions for crisp lines) if needed. I think that paradigm makes the most sense for making "applications," e.g., a text editor with GUI controls and menus. I'm trying to use Speedy2D for something more like a game application, where in order to run fast enough, I'm willing to render at lower resolutions and let OpenGL scale it up cheaply, accepting the loss of quality and control.

Is it possible to use something like the OpenGL projection matrix for this without managing the custom GL context? Is there another approach that could be used?

(Following up on a bit of conversation from #83)

@dennisorlando
Copy link
Contributor

maybe #75 might help? My clue is that you render to the context and then you manually upscale it to a window with some other libraries

@superlou
Copy link
Author

I think that would work for upscaling, but if I ever want to downscale (e.g. in my app: design a display for 1920x1080 but scale the window smaller so it's easy to test on a monitor). I'm a little convinced I can mess with the uniforms (https://github.com/QuantumBadger/Speedy2D/blob/master/src/renderer2d.rs#L178) that are setting scale_x and scale_y or the viewport, but I have to learn how OpenGL's works.

@superlou
Copy link
Author

I'm going to close this in favor of a new issue based on the discussion from #88.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants