[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Adonthell-devel] I'm back !!!

From: Alexandre Courbot
Subject: Re: [Adonthell-devel] I'm back !!!
Date: 18 Feb 2002 13:25:29 +0100

> Yes, that would be a lot cleaner. So you would basically register a
> callback if you want to get notified of keypresses and all that.

Callbacks? Mmm, maybe that's a bit much. How about a queue of cathced
events (similar to SDL)?

> As we only care for a dozend buttons or so, you might even have individual
> callbacks for each key (or groups of keys). Like one callback for movement
> keys, another one for action keys, etc.
> Just a random idea; not sure if it's feasible or useful. 

Well, I'm rather for limiting callbacks at maximum (for the window
system and such, where they are nearly mandatory) - but I don't know
exactly what you have in mind.

> Completely right. In the main programm we should just use the keys we
> defined ourselves. And the input system would just map physical keys and
> buttons and whatnot to those logical keys.

Exact. This would also make the higher-level game layer totally
independant from SDL. That way, if we decide to make Adonthell runnable
on Clanlib, or anything else too, we could do it by only tweaking a bit
the image, audio and input classes.

> As for the callback mechanism, I guess you could do it similar to Java.
> I think input stuff is handled pretty good there, despite my feelings for
> Java as such ;).

Java? What's that? ;)
Maybe you can describe a bit how it works - but I feel like callbacks
aren't the best way to handle events. And the fact that Java uses them
only strenghten my opinion ;)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]