[WIP] SDL2 PROXY_TO_PTHREAD Fixes#77
[WIP] SDL2 PROXY_TO_PTHREAD Fixes#77jakogut wants to merge 25 commits intoemscripten-ports:masterfrom
Conversation
|
@juj I'm open to feedback about a better way to do this. |
|
I understood that this PR would enable the use of SDL with threads, is this correct? If so, I'm very interested into it. I'm not sure I have the skills to test it though. |
|
@conversy It enables SDL2 applications to be run with the option |
|
@conversy I don't know if this is what you're actually wanting, but I'm now working on SDL2 threads support through an unrelated turn of events. I've made an issue here: emscripten-core/emscripten#8300 |
|
My application says: "screen is not defined" when run in a browser. I understood that it was because I also use threads with SDL. Is this PR supposed to fix it? |
|
Curious to hear @Daft-Freak's thoughts here. My general feeling is that we can fix this another way, by replacing say |
|
A lot of this could be done with new emscripten API. That would leave the framebuffer and creating cursors, which uses a canvas to convert some pixel data into a data-url, maybe there's some way we could do this that would also work on a worker? |
|
Small comment on the PR itself: we usually just prefix commits with |
|
I just gave this PR a spin and it works well for my use case. What are the next steps? Implementing functions like |
|
@fallenoak yes, exactly, that's the right order. I don't think anyone's working on that yet, so if you or anyone else wants to, that would be great! |
|
Do we only want APIs for |
fe548de to
1c38e6b
Compare
|
@kripken @Daft-Freak I've updated this PR, and started a PR in Emscripten for some of these API changes. emscripten-core/emscripten#9336 |
5bdbd8a to
54b6e2c
Compare
54b6e2c to
cc792d8
Compare
This PR implements various C APIs for SDL2 to work with PROXY_TO_PTHREAD=1 as discussed here: emscripten-ports/SDL2#77 * create C API for setting window title * create C API for getting window title * tests: test_html5: test emscripten_{get,set}window_title * create C API for getting screen size * tests: test_html5: test emscripten_get_screen_size
This pull request fixes undefined references and proxying issues when using SDL2 with
PROXY_TO_PTHREAD=1.Requires emscripten-core/emscripten#8254
This was tested with
tests/sdl2_gl_frames_swap.candPROXY_TO_PTHREAD=1.This still requires creating a WebGL context and making it current as documented here:
emscripten-core/emscripten#7684 (comment)
Fixes: emscripten-core/emscripten#6009