Saturday, March 18, 2006

Cocoa backend for Factor UI in progress

I replaced the SDL code with a layered approach, right now consisting of a Cocoa backend only. I've also been refactoring the UI to support multiple windows. Here is a screenshot. The Cocoa code still needs a lot of work before it is stable. Once it is done, I will move on to the X11 backend.

Here is a roundup of the changes to the guts of Factor's UI over time:
  • When I started working on the C library interface, the SDL library was the first library I wrote bindings for. I developed a few demos which rendered geometric shapes directly to the frame buffer.

  • The first implementation of the graphical listener used the SDL_gfx library to render text. Later on I developed a complete SDL_gfx binding and with it developed a number of small graphics demos.

  • I started work on the code which would become the UI, and implemented an SDL_ttf binding since I wanted decent-looking text rendering -- SDL_gfx only offered a single built-in 8x8 font.

  • The SDL/SDL_gfx/SDL_ttf combo served as the backend for the UI for a long time.

  • OpenGL bindings were contributed. Fed up with the low performance and limited features of SDL_gfx, I switched over to OpenGL rendering in Factor 0.79. I also rewrote the code calling SDL_ttf to use FreeType instead. SDL_ttf is a wrapper around FreeType.

  • Now in Factor 0.81, I'm replacing SDL with Cocoa, X11 and Windows backends.

No comments: