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

[Question] Send for Texture #192

Open
woubuc opened this issue Oct 7, 2018 · 4 comments
Open

[Question] Send for Texture #192

woubuc opened this issue Oct 7, 2018 · 4 comments

Comments

@woubuc
Copy link

woubuc commented Oct 7, 2018

I'm running into an issue when loading textures from a thread, that Texture isn't Send. Is this on purpose or is it possible to make it Send?

@crumblingstatue
Copy link
Collaborator

crumblingstatue commented Oct 7, 2018

I'm not sure what can be Send and what cannot. See #179.

I personally think probably Texture cannot be Send, because it has to remain on the same thread as the OpenGL context, but maybe Image can be Send, where you could load an Image from a separate thread, and then create a Texture from it on the main thread.

@woubuc
Copy link
Author

woubuc commented Oct 13, 2018

Thanks for the answer. Is this something you're looking into or are you looking for others to take this on?

Also, I've tried manually making Texture Send and it seemed to move from my loader thread to my main thread just fine. I'm not sure it's safe that way though, I'm not very familiar with these things yet.

@crumblingstatue
Copy link
Collaborator

A sensible course of action would be to discuss this with the SFML maintainers. They should know more about the thread safety of various SFML types. If you'd like to, you could have a talk with them about the types you are interested in making Send, and report here.

@vaartis
Copy link

vaartis commented Dec 31, 2019

Not sure about whether this makes any difference, but there's AtomicPtr that can help enforcing atomicity on owned pointer (and they are owned, at least in case of SfBox)

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

3 participants