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

how to do offscreen rendering in qt? #202

Closed
evehal opened this issue May 20, 2024 · 4 comments
Closed

how to do offscreen rendering in qt? #202

evehal opened this issue May 20, 2024 · 4 comments
Labels

Comments

@evehal
Copy link

evehal commented May 20, 2024

https://stackoverflow.com/questions/31323749/easiest-way-for-offscreen-rendering-with-qopenglwidget

in qt, i can do that with fbo, how to use blend2d with fbo?

@kobalicek
Copy link
Member

kobalicek commented May 20, 2024

Blend2D always renders to pixel buffers, thus it's always offscreen.

You either let Blend2D allocate that buffer by creating a BLImage or you have your own and use BLImage::createFromData() - see https://blend2d.com/doc for a reference documentation.

BTW you can also wrap QImage in a BLImage and render to it, etc... This is done by Blend2D demos that compare Blend2D and Qt rendering.

@evehal
Copy link
Author

evehal commented May 22, 2024

Thank you kobalicek
Im developing a real time mixing(A/B textures) application like vMix
I guess I can use blend2d instead of qt qpainter for drawing titles, 2d fx, images ...
So how to get fbo or offscreen texture id(opengl)

@kobalicek
Copy link
Member

kobalicek commented May 22, 2024

Blend2D is a software renderer only at the moment, so if you need software rendering then it's a good choice, however, if you already have data on GPU side I'm not sure it's a good idea as you would need a GPU renderer instead.

Blend2D doesn't talk to OpenGL or other 3D APIs - it renders only to a pixel buffer target. It's up to you whether you let Blend2D allocate them (via BLImage) or you supply your own data to render into.

@evehal
Copy link
Author

evehal commented May 23, 2024

Thank you kobalicek

@evehal evehal closed this as completed May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants