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

Add support for offscreen GL contexts #34

Closed
jonathanhogg opened this issue Feb 4, 2024 · 2 comments · Fixed by #37
Closed

Add support for offscreen GL contexts #34

jonathanhogg opened this issue Feb 4, 2024 · 2 comments · Fixed by #37
Assignees
Labels
🚀 enhancement New feature or request 🎨 render Anything to do with rendering (windows, physics, etc.) 🧪 tests Anything to do with the tests
Milestone

Comments

@jonathanhogg
Copy link
Owner

It'd be great to be able to create a non-window context in Flitter, for containing scene nodes that will be used only as references and to allow generating images and videos in a non-windowed environment – which would be great for doing functional tests.

@jonathanhogg jonathanhogg added this to the Version 1.0.0 milestone Feb 4, 2024
@jonathanhogg jonathanhogg added 🚀 enhancement New feature or request 🎨 render Anything to do with rendering (windows, physics, etc.) 🧪 tests Anything to do with the tests labels Feb 4, 2024
@jonathanhogg jonathanhogg self-assigned this Feb 4, 2024
@jonathanhogg
Copy link
Owner Author

Obvious syntax would be something equivalent to !window, like:

!offscreen id=:foo size=X;Y
    !image ...
    !video ...
    !canvas ...
    !canvas3d
    !shader ...

It almost certainly also makes sense to only create a framebuffer for an !offscreen if it has an id attribute that would see it placed in the references map. Otherwise, there's no way of accessing the output so it might as well not be rendered.

If it does have an id attribute, then it should support the sane range of fragment, vertex, colorbits, linear and composite, though not vsync, title, screen, resizable or fullscreen. !key or !pointer event nodes would not be valid inside one.

It would also be convenient to have an --offscreen command-line option that forces all !window nodes to be interpreted as !offscreen nodes instead.

@jonathanhogg jonathanhogg linked a pull request Feb 4, 2024 that will close this issue
@jonathanhogg
Copy link
Owner Author

So basic offscreen support turned out to be super easy. What will need a bit more thinking about, to avoid a nasty hack, is how to add an --offscreen command-line option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 enhancement New feature or request 🎨 render Anything to do with rendering (windows, physics, etc.) 🧪 tests Anything to do with the tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant