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
Using input event without initialising Video
LC0
Guest

Hi,

I'm trying to make a game framework using Ogre + SDL (Ogre covers the
rendering part and SDL thread handling, input, audio and such things).

The problem is that looks like SDL needs to init video stuff in order
to be able to handle input events. That's what the reference says:

-----"Event handling allows your application to receive input from the
user. Event handling is initalised (along with video) with a call to:
SDL_Init(SDL_INIT_VIDEO);"-----

There is a way to "cheat" SDL described in the Ogre Wiki, telling it
that the initialised window is the one generated by Ogre. But there is
need a lot of platform-dependent stuff in order to do that, and i want
the application to be multiplatform.

So, there is a way to use events without initialising all the video
stuff? I've thought on initialising video and destroy the generated
window nextl but then, maybe the event system is stop due to this.

Thanks in advance.
Using input event without initialising Video
Andre Krause
Guest

LC0 wrote:
Quote:
Hi,

I'm trying to make a game framework using Ogre + SDL (Ogre covers the
rendering part and SDL thread handling, input, audio and such things).

The problem is that looks like SDL needs to init video stuff in order
to be able to handle input events. That's what the reference says:

-----"Event handling allows your application to receive input from the
user. Event handling is initalised (along with video) with a call to:
SDL_Init(SDL_INIT_VIDEO);"-----

There is a way to "cheat" SDL described in the Ogre Wiki, telling it
that the initialised window is the one generated by Ogre. But there is
need a lot of platform-dependent stuff in order to do that, and i want
the application to be multiplatform.

So, there is a way to use events without initialising all the video
stuff? I've thought on initialising video and destroy the generated
window nextl but then, maybe the event system is stop due to this.

Thanks in advance.

_______________________________________________
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


good question. but i doubt it would be possible to do that - events are
bound to a window - so you need at least to tell sdl wich window you are
processing events from. and if that window moves, sdl needs to know in
order to calculate correct relative mouse coordinates. so there is (i
think) no other way than to use that sdl window_id hack described in the
OGRE - wiki. sadly.
a good thing would be an api modification to give a platform
independent, reliable way to tell sdl the window id. not via setting
environment vars and doing other stuff to get it to work.
i - personally - dropped the idea to integrate sdl into an fltk
application. i found the window-id hack way to strange and with too many
platform dependent things.

look here, its quite a mess:
http://www.ogre3d.org/wiki/index.php/Using_SDL_Input

so i will stick to sdl purely - and try to polish my ugly selfwritten
gui :-/
by the way, is there any tutorial on how to design and software engineer
a GUI? i've already wasted so much time doing it by hard.. reinventing
once again the rectangle.