The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Collecting Input using SDL_CreateWindowFrom
Mako_energy


Joined: 10 Feb 2011
Posts: 46
I posted about this issue not long ago in another thread, here. Got no response, so here goes with a new thread.

In short I'm trying to change the way Ogre and SDL are bound to each other in my project by using the SDL_CreateWindowFrom() function. When I try this, I get zero input events. As if nothing is happening. I've verified my main loop and event manager are working fine, just not getting any events from SDL. I thought maybe since SDL doesn't "own" the window made by this function it turns off input grab for the window by default, so it doesn't try to step on the toes of something else that may be doing the same(got the idea from a post on these forums). So I tried to enable input grab for the window and there is still no input events being generated.

I'm pretty sure others have attempted this and succeeded, and I'm sure I'm missing something simple. If anyone can help me out I'd greatly appreciate it.
Collecting Input using SDL_CreateWindowFrom
pulkomandy
Guest

Quote:
I'm pretty sure others have attempted this and succeeded, and I'm sure I'm
missing something simple. If anyone can help me out I'd greatly appreciate
it.

Last time I did embed SDL in something else, I had to use SDL_PushEvent with
event I created myself from an event handler in wxWidgets. Likely you're not
trying to embed SDL into a wxWidgets window, and that was with SDL1.2 ; but
it may be worth trying something similar. Not sure if there are other
solutions, I remember SDL as being quite invasive when you try to mix it with
other stuff.

--
Adrien.
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Collecting Input using SDL_CreateWindowFrom
Ryan C. Gordon
Guest

Quote:
In short I'm trying to change the way Ogre and SDL are bound to each
other in my project by using the SDL_CreateWindowFrom() function. When I
try this, I get zero input events. As if nothing is happening. I've
verified my main loop and event manager are working fine, just not
getting any events from SDL. I thought maybe since SDL doesn't "own" the
window made by this function it turns off input grab for the window by
default, so it doesn't try to step on the toes of something else that
may be doing the same(got the idea from a post on these forums). So I
tried to enable input grab for the window and there is still no input
events being generated.

We override the window's original event handler (and then call it after
we've run our own).

Can you set a breakpoint on WIN_WindowProc(), in
SDL/src/video/windows/SDL_windowsevents.c ? If this function isn't being
called, then we never got control of the window's event handler.

ALSO: if it _is_ getting called, but that GetProp() call near the start
fails, that would cause the behaviour you're seeing. Since the matching
SetProp() seemed to be failing for you in the other thread, I imagine
this will be the actual culprit.

--ryan.

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Mako_energy


Joined: 10 Feb 2011
Posts: 46
Pulkomandy:
We aren't really generating our own events, nor is Ogre. If we told SDL what events it needs to generate, that would defeat the purpose of us using SDL. We are relying on it generating window and input events on it's own.

Ryan C. Gordon:
At the risk of sounding like an idiot, I'm not sure how to do that. SDL is dynamically linked against our engine, which is in turn dynamically linked against our game. We've also designed our entire engine API to be a wrapper, so the game doesn't have to be aware of any of the internals. Simply put, the game is oblivious to SDL. Opening the file in Code::Blocks and setting the breakpoint where you specified causes it to simply ignore the breakpoint.
Collecting Input using SDL_CreateWindowFrom
Ryan C. Gordon
Guest

Quote:
Ryan C. Gordon:
At the risk of sounding like an idiot, I'm not sure how to do that. SDL
is dynamically linked against our engine, which is in turn dynamically
linked against our game. We've also designed our entire engine API to be
a wrapper, so the game doesn't have to be aware of any of the internals.
Simply put, the game is oblivious to SDL. Opening the file in
Code::Blocks and setting the breakpoint where you specified causes it to
simply ignore the breakpoint.

Are you at a point where you can send me the binaries (your .exe, .dll
files, data, etc), so I can run it here?

--ryan.


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Re: Collecting Input using SDL_CreateWindowFrom
Mako_energy


Joined: 10 Feb 2011
Posts: 46
Ryan C. Gordon wrote:
Are you at a point where you can send me the binaries (your .exe, .dll
files, data, etc), so I can run it here?

--ryan.


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


We currently have two apps made, our game requires some art assets that I can't release at this point unfortunately. However we have a test bed application as well that we use to test features and that I can share/send. The behavior is identical in both applications(in relation to this issue).

I can either email you all the relevant files(just give me an email to send it to), or if you want complete overkill you can grab a copy of our repo and you can compile it yourself.

Edit: I had to revert the code in the repo cause others needed it working for their tests and updates.