[SDL] Collecting input from an external window
mako_energy02 at yahoo.com
Wed Sep 28 15:52:44 PDT 2011
I hope not. =\ I've seen other posts (on this forum as well as others) that have hinted it can work without large amounts of extra code.
I've been tinkering with this a bit more and found out quite a bit regarding this issue. First it turned out that I wasn't actually properly initializing the SDL video subsystem due to some twisted logic in my code base, that has since been corrected. Next was getting crashes that seemed to be a result of a failed call to SetProp() (windows api) when constructing the window. I found out that was because of differences in how the window handle was passed around between SDL and Ogre. In short, I had to create an HWND myself, pass it in by reference when getting the handle from ogre, and then pass it in as is to SDL. So before it wasn't getting the valid HWND, hence the crash.
Now...I have another issue and I am not entirely sure how to fix it, although I'm sure it is something I did wrong. When I try to create a window with SDL_CreateWindowFrom() it goes down the chain of functions normally until it gets to line 169 of SDL_WindowsWindow.c. Looks like this:
When it calls that line of code the debugger jumps instead to "WIN_StartTextInput()", and promptly crashes when it attempts to dereference the driverdata pointer in that function. I immediately suspected some mismatch between the headers and the library, so I deleted all my headers of SDL, and SDL.dll. I updated my repo to the most recent version (wasn't many updates cause I did this yesterday as well) and removed all local changes when I applied the update, just in case. I then recompiled SDL, and copied the include folder in the repo to my project as well as the fresh SDL.dll. It is still crashing.
I'm still going to tinker with this since it's probably something dumb and simple, but if anyone has an idea in the mean time I'd appreciate the help.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SDL