By ell
Date 2010-03-20 14:48
Why does Gosu::Image require a window for Initialization and is there away to clone a Gosu::Image with a different window? I don't currently need this but I would just like to know the reason. Surely all the bitmap data could just be ported into a different instance of Gosu::Image or a hwnd (or whatever they are) could be passe down. Can somebody please explain the situation, I like to be in the know. Thanks in advance, ell.
By jlnr (dev)
Date 2010-03-20 15:04
Actually it's mostly an order-of-initialization issue. It's pretty trivial to get rid of the window arguments, and in fact they are undocumentedly optional for Gosu::Sample and Gosu::Song already. But there is a hidden law that you may only create those after creating a Gosu::Window instance—not very intuitive. Especially because it's only that way on Win32, where it silently fails, and Mac/Linux programmers might not even notice that there is such a rule.
In the short run I might just check the order myself and throw an explanatory exception when things are in the wrong order. *Really* making it all independent is not trivial, alas.
Loading...