Re: [AD] more modularity (was Re: multithreaded callbacks) |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Thu, Aug 02, 2001 at 04:09:42PM +1000, Peter Wang wrote:
> On 01 Aug 2001, George Foot <gfoot@xxxxxxxxxx> wrote:
> > This is going off the topic of the thread (and I don't want to
> > distract from the threading issues, I think we should implement
> > the mutexing API as soon as possible), but do people think these
> > things need addressing?
>
> Yes, but I'm not sure how far we can take it. The Windows port can
> attach Allegro to a HWND, so we could add functions to attach Linux
> Allegro to some fd. That should fix up quite a few things by
> itself. If necessary, maybe also add another system driver for
> Unix/Linux, which does more than SYSTEM_NONE, but less than the
> current drivers (i.e. doesn't grab a console).
Getting the console is actually the main problem. The keyboard
driver just reads from fd 0, the mouse driver just opens
/dev/mouse (or whatever is configured), similarly for the
joystick driver... they don't actually need the console at all.
That's just for graphics. So attaching to an fd isn't required.
I've considered moving the console code so that it gets done
when a graphics mode is set, rather than on initialisation. It
could be annoying if the game kept jumping from console to
console, but if we ensure it only happens the first time a mode
is set I think this could be OK.
Something else which has been lingering in my mind is the
possibility of mering SYSTEM_LINUX with SYSTEM_UNIX. This is
only possible if all the X code is inside X drivers and all the
Linux code is inside Linux drivers (i.e. no intrusive startup
code for either). Part of the motivation is so that generic
Unixes can run Allegro (and still get things like timers)
without being Linux or having X running. At least on the Linux
front, I think all the Linux-only code could be moved into
drivers which don't autodetect if the OS is not Linux.
The only problem is that some things (X keyboard, X mouse, and X
graphics) depend upon the central initialisation for any of them
to work (AFAIK these things don't work unless a window has been
created). Again, like the Linux console initialisation, this
could be moved into a once-only initialisation which these
drivers call automatically.
George