[SDL] Cocoa & SDL
matt
mattmatteh at earthlink.net
Sun Nov 19 11:09:40 PST 2006
i am not an expert, but would suggest leaving platform specific code out
of some thing portable. i was at one point messing with qt, it worked
well on osx and linux. i didnt try my sdl app in the qt gui yet as my
game core is not done yet. also, the core is all in C, and the UI which
was qt was in c++. just an idea.....
matt
Thomas Harte wrote:
> I want my SDL application to have a full Cocoa UI. I've read various old threads
> on Cocoa & SDL and so far am using setenv to set a non-zero value for
> SDL_ENABLEAPPEVENTS and have added a sendEvent handler to my implementation of
> SDLApplication that checks if incoming events are keyboard related, and if so
> throws them away if command is not pressed. With a bit of nib magic from
> Interface Builder that gives me a fully interactive Cocoa UI with the one
> obvious defect — it isn't responding to keypresses that don't have command
> pressed. As a result things like "File->Save" are almost impossible to use. Of
> course if I don't filter keyboard input like this then every time the user
> presses a key I get an error beep as Cocoa thinks the user has pressed a key
> that doesn't do anything.
>
> My slightly hacky solution so far is to keep an internal flag of any time I
> launch a dialogue that would want proper keyboard input and not to filter it
> out until that dialogue has finished. I'm wondering if there is a better
> solution that can be implemented while still separating my Cocoa code from the
> main body of my ordinary cross-platform code. Perhaps some sort of invisible
> window that accepts ordinary keypresses while my app is active but does
> nothing with them?
>
> I'd be curious to hear what others have done to get around this problem.
>
> P.s. this is the only forum I've ever posted to that has made me hand-edit my
> post so that it has no lines longer than 80 characters. Can that really not
> be done automatically?
>
>
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl
>
More information about the SDL
mailing list