[haiku-development] Re: Breaking apart Accelerant.h (was A tale of two accelerant API's)

  • From: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 13 Feb 2013 16:40:23 +0100

Am 13/02/2013 06:20, schrieb Alexander von Gluck IV:
On 02/12/2013 6:47 pm, Alexander von Gluck IV wrote:
Ok, I'm plotting to do something that could have dire consequences if
I miss something :)

No time yet to look closer, but the only difference I saw so far is that there is some stuff missing from AccelerantAPI2.h :-)

Will be:
  - headers/os/add-ons/graphics/Accelerant.h
      http://pastebin.com/e2zWJNZr
  - headers/private/graphics/common/AccelerantAPI1.h
      http://pastebin.com/8P3KyE1R
  - headers/private/graphics/common/AccelerantAPI2.h
      **Not done yet ;)**

As you obviously already found out, it cannot work this way.
The Accelerant.h header must remain public as is.

I'm actually getting into the muck of all of this... and supporting two
accelerant api's is actually going to be a **PAIN**.

The Game kit calls several accelerant hooks directly. We would need to
duplicate a lot of code in the game kit and app server for every API
> revision we make. [...] We're looking at a complete redesign of the
game kit and app server with lots of duplicated code.

You make it sound like it would be a major pain, but it actually is quite easy: 1. The game kit will no longer be allowed to call and clone accelerants directly. 2. There is no need to make the new accelerant API compatible in any way, and it can remain private for now. 3. The game kit functions can easily be redirected to a compatibility layer that provides the former accelerant interface. It's probably quite simpler than you might anticipate, and I would not expect you'll find many applications/games that made use of this feature, once you can open a BWindowScreen, that is. Blitting stuff, and changing the palette should be sufficient, anyway.

For now, I would just ignore the issue until the new API is more or less mature; the Game Kit functions would just fail when they tried to work with a newer driver.

I guess it's the best way to implement this in a branch, anyway, so you wouldn't even break anything temporarily unless someone wants it :-)

Bye,
   Axel.


Other related posts: