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

Expose gl.viewport #31

Closed
Maxoos opened this issue Nov 29, 2015 · 2 comments
Closed

Expose gl.viewport #31

Maxoos opened this issue Nov 29, 2015 · 2 comments

Comments

@Maxoos
Copy link

Maxoos commented Nov 29, 2015

This is a great project, saved me so much time and effort.

It would be nice to have a way to control the viewport, a good use case would be a canvas that fills the whole page. You can set the canvas to window width and height and then change the viewport to make sure the image will fill the frame and keep the ratio.

Thanks!

@gre
Copy link
Owner

gre commented Nov 29, 2015

why not using a GL.View with the viewport size you want that you put inside a <div> that takes the full window size?

Not sure how related it is to your need but eventually we should support custom vertex shader & custom data https://github.com/ProjectSeptemberInc/gl-react/issues/6

@gre
Copy link
Owner

gre commented Feb 17, 2016

I think it's up to user to solve the ratio problem, it can be solved by using a Surface inside View / div container.
A new feature recently land that allows to do things like this:

<Surface width={200} height={200}>
  <HelloGL width={20} height={20} />
</Surface>

in this code, the HelloGL node will be render on a 20x20 framebuffer and auto-scaled to the Surface's 200x200. It's up to the user to deal with the Surface width and height and making it fit to the size used in HelloGL for instance.

@gre gre closed this as completed Feb 17, 2016
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