-
Notifications
You must be signed in to change notification settings - Fork 463
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
multiple windows? #2
Comments
I'm going to say I've probably ballsed up somewhere. I'll create a Demo case to try and reproduce/solve it, once I'm back home. |
Quick guess - could it be because you're calling SDLInit multiple times? I'm pretty sure that blew up some of my tests in SDL_gfx where I was initing multiple times, one for each demo window, accidentally. Switching to one sdl2::init in the Main thread might solve it all. |
If it is that, it might be an idea for us to move SDL_Init into a closure-thingy, although as you can SDL_Init different components at different times I'm not quite sure how to tackle this elegantly. Or sanely. |
moving
into main() solved the segfaulting, but attempts to create a new window with sdl2::video::OpenGL always fail with "OpenGL context already created." Dropping that flag lets N windows be created without too much fuss, but I don't know what it costs us in terms of acceleration / if there's a better way to keep opengl contexts from stepping on eachother. Thanks! |
You're welcome! Certainly wasn't expecting people to try using this so early in development. The docs are unclear, but it simply says 'Usable with OpenGL context', so it's possible that it's used to do behind-the-scene prepping for using SDL with OpenGL, as I'm not sure that can support multiple renderers. So, yeah, try just leaving it out, I guess. As long as you use Renderer rather than Surface it should be pushing the work to the video card. Should. edit: ah yes, here we go: Renderer picks whether you're using the graphics card. http://wiki.libsdl.org/SDL_RendererFlags |
I need multiple windows and GPU accelerated 2D canvases enough to put up with short-term instabilities and brokenness. Don't mind helping with development work, either. SDL2 is fairly exciting! |
It certainly is! Are you happy to have this marked as fixed? |
Yeah, I'll remember to make a note about this as we approach a release, or better yet, bake it into a demo. Thanks! |
fix compile error: struct field default now private
Pass FPSmanager size as size_t to malloc instead of u64.
This adds back the ability to compile the debug version of SDL2 when the cargo build is a debug build. Previous attempt (PR Rust-SDL2#1081) broke dynamic linking bundled builds on Windows, forgetting to copy the resulting DLL correctly and misspecifying the name of the library in that case.
The SDL2 announcement claims
However, with this somewhat trimmed down version of my graphing code, I get a segfault with this traceback / memory profile instead of a pair of windows like this when I try spawn a pair of windows and renderers in tasks separated across OS threads.
I haven't had a chance to source dive, but figured I'd post the issue and start discussion.
The text was updated successfully, but these errors were encountered: