Re: [AD] mouse_api branch

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Fri, 2006-09-01 at 12:58 +0100, Peter Hull wrote:

> 
> event_queue = al_install_events(AL_KEYBOARD|AL_MOUSE|AL_DISPLAY);
> 

I like it. And al_install_events could be something like:

AL_EVENT_QUEUE *al_install_events(int flags)
{
   system = _al_current_system_driver();
   if (flags & AL_MOUSE) {
      system->vt->install_mouse(system);
   }
}

Inside the system->install_mouse, the config system could be used to
select the driver (in case we will have system drivers who support
multiple drivers at all). Something like:

al_set_config_string("allegro/windows/mouse_driver", "direct x")
event_queue = al_install_events(AL_KEYBOARD|AL_MOUSE|AL_DISPLAY);

al_set_config_string("allegro/windows/mouse_driver", "win32")
event_queue = al_install_events(AL_KEYBOARD|AL_MOUSE|AL_DISPLAY);

If we assume the "windows" system driver supports two different mouse
drivers, then the first one would use the "direct x" mouse driver, the
second the "win32" mouse driver.

-- 
Elias Pschernig





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/