Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2003:
[Freeciv-Dev] Re: (PR#7124) [FS] Drawing abstraction layer
Home

[Freeciv-Dev] Re: (PR#7124) [FS] Drawing abstraction layer

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#7124) [FS] Drawing abstraction layer
From: "Raimar Falke" <i-freeciv-lists@xxxxxxxxxxxxx>
Date: Sun, 21 Dec 2003 02:06:54 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=7124 >

On Sat, Dec 20, 2003 at 03:53:58PM -0800, Per I. Mathisen wrote:
> 
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=7124 >
> 
> On Sat, 20 Dec 2003, Raimar Falke wrote:
> > I have finished an implementation of the backend for X11 consisting of
> > 1200 lines. This is all which is needed to port FS to other backends
> > like SDL, Win32 or Amiga's graphics.library. The 2000 lines for the
> > widget set aren't needed to be ported.
> 
> What about the font code? It would be really nice if we could do fonts the
> same way on every platform, using the same fonts, even if it meant adding
> a dependency to the freetype library.

Yes we have the choice here to use whatever support the underlying
drawing system gives us or using a generic library like libfreetype.

> > So why was not SDL used as an abstraction? IMHO SDL has serveral
> > shortcoming which make it not my first choice.
> 
> Yet you want SDL as a backend.

To be able to quickly port freeciv to other platforms.

> So all these shortcomings either have to be accepted as given
> limitations or worked around in any case.

The SDL backend will work around these.

> > Please read the archives for the details.
> 
> Sorry, I could not find anything that I think is obviously relevant.
> Actually, the only thing I would think obviously relevant is speed. Is
> this an issue?

From an older mail (11 Mar 2003) to the internal list:

---- begin ----
SDL has shortcomings. These show that either SDL was invented for
another goal or these people are clueless. I assume the first. Lets
see:
 - limit number of events to 128
 - doesn't speak about this limitation in the documentation
 - wait_for_event is implemented as:
    while(1) {
      fetch_events_from_backend();
      if(events_available()) return;
      else wait_10_ms();
    }
    This is polling. This is not necessary. This is ugly. This is the
    reason for the next problem:
 - no network support. Because SDL doesn't use select as the main
 waiting function it has no socket support. Also SDL_net doesn't have
 this.
 - it uses itimer and signals. You get the same problems as with MT.
 - no scrolling support. This isn't needed for freeciv but was the
 reason another project (http://eom.sourceforge.net/) switch from SDL
 to OpenGL.
 - the unicode problem in SDL_ttf which clearly showed a lack of
 understanding.
---- end ----

We have seen that GTK is immature on Windows. I think that SDL also
has this problem to a lesser degree. I don't want to build gui-fs
based on such shaky grounds. And yes it is possible to fix it. I have
posted some outlines of the problems to the SDL development list but I
won't create a patch.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  "The primary purpose of the DATA statement is to give names to
   constants; instead of referring to pi as 3.141592653589793 at every
   appearance, the variable PI can be given that value with a DATA
   statement and used instead of the longer form of the constant. This
   also simplifies modifying the program, should the value of pi
   change."
    -- FORTRAN manual for Xerox Computers




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