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

Rendering to GLArea on non-ui thread #93

Open
BaronKiko opened this issue Jun 10, 2019 · 7 comments
Open

Rendering to GLArea on non-ui thread #93

BaronKiko opened this issue Jun 10, 2019 · 7 comments
Labels

Comments

@BaronKiko
Copy link

Hi,
We have been trying to use gtk# to host a GLArea for openTK to render into.
This has been achieved on the UI thread however we have a lot of rendering to do so we would like to do the rendering on a different thread.
Unfortunately I have been unable to do so as I can't make the context current on the new thread. Doing so simply throws an access violation exception.
devenv_2019-06-10_03-28-48

I presume this is because I haven't unbound the context on the main thread however I am unable to find a way to do so with the API's available.

So am I missing something, or is this just not possible with the current API?
We would like to avoid using shared contexts for this.

Thank you for your time reading this

@Xpl0itR
Copy link

Xpl0itR commented Jun 17, 2019

@cra0zy could you help out with this issue please

@harry-cpp
Copy link
Member

I have no answer to this, I never managed to get this working even with a C program.

@na2axl
Copy link

na2axl commented Jul 24, 2020

@BaronKiko have you found a solution about this issue ?

@knuxbbs
Copy link

knuxbbs commented Jul 24, 2020

@BaronKiko
Copy link
Author

I never did however I think another dev on the ryujinx team did. It's possible he got around it some other way but he used a custom widget to get rendering in the main window.
Best place I can point you is PR 922 on the ryujinx repo. I'm on my phone so sorry can't get a link.

@knuxbbs
Copy link

knuxbbs commented Jul 24, 2020

Ryujinx/Ryujinx#922

@na2axl
Copy link

na2axl commented Jul 25, 2020

Thank you @BaronKiko and @knuxbbs for your answers. Using the provided link I've managed to create a custom multithreaded graphics control based on DrawingArea instead of GLArea. The only issue I've faced with that it's I've not found a way to use this widget in a non (or custom) decorated Window. As soon as the Window doesn't have default decoration provided by the OS, the widget draws nothing at screen (but it continue drawing into framebuffers). I've not found how to solve this.

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

5 participants