SDL

Jaco van der Merwe jaco.lists at telkomsa.net
Wed Oct 13 13:12:55 PDT 2004


Hi all,

I've been following the discussions regarding implementing some FFI
mechanism to a graphics API for Slate. The proposals that have been offered
so far range from the very low level API's, like SDL, to the higher level
API's, like OpenGL. I have refrained from commenting on these discussions
because I don't have the necessary context about what is being envisioned
for Slate graphics.

I can see two possible approaches:

1. Use a low level graphics and graphics primitives API and then implement
all the higher level abstractions on top of it in Slate. An advantage of
this approach is that the low level API is usually very portable and already
implemented on many platforms due to the fact that it is small and provides
only a few primitives, i.e. it takes the lowest common denominator approach.
The disadvantage of such an approach is that everything else has to be done
in Slate, including emulating other environments. As an example, the Java
AWT and Swing API's have taken this approach. Java Swing is built on top of
a small and portable graphics primitives API. Everything else is emulated in
Java, like the Windows 2000 look-and-feel, the MacOS look-and-feel, the
Windows XP look-and-feel, etc. It is an approach that requires large effort
and never really feels like the native platform. On a superficial level the
Windows look-and-feel implementation may look like the real thing, but the
moment you start using it, it is very obvious that it is not. The same
applies for all the other environments. In addition to that it also has a
slowness and sluggishness that is uncharacteristic to other native
applications. Also, when a new look-and-feel comes out there is a long lag
time before its emulation has been implemented in this environment and
becomes available.

2. Use a higher level API that captures most, if not all, of the
abstractions used in graphics applications.  These API's use the underlying
native primitives where they can, and emulate them where they can't. It
requires more effort to port these API's from one platform to another, but
they provide an experience and look-and-feel that is much closer to the
native applications on that platform. I believe this is the reason why the
Java SWT API used by Eclipse is gaining so much support. Eclipse looks and
feels like a native application on any platform that it runs on without the
associated Java Swing sluggishness and warts.  It's difficult to even tell
that it is a Java application, well, at least a traditional one using AWT
and Swing. The same applies for other cross-platform API's like OpenGL,
which even have lots of support in hardware from the graphics card vendors.
The unfortunate situation seems to be that graphics card vendors seems to be
supporting DirectX more and OpenGL less. Don't get me wrong, DirectX is a
good API, but currently it is not cross-platform, which may be a problem for
people developing cross-platform applications.

With the above two options in mind I'm not saying that either one is better
than the other. The answer to that question depends on what your vision may
be. If you want to do new and innovative user interfaces and graphics that
does not conform to anything current then approach 1 may be the better
solution. If you want to play nicely with existing platforms and their user
interfaces then approach 2 may be the better solution. However, note that
approach 2 does not preclude you from trying new and innovative user
interfaces.

Maybe Brian can tell us more about how he envisions graphics and UI's for
Slate.

Regards
Jaco


----- Original Message ----- 
From: "Glenn Alexander" <glenalec at shoalhaven.net.au>
To: "Slate project discussion" <slate at tunes.org>
Sent: Wednesday, October 13, 2004 1:02 AM
Subject: SDL


> I am not a low-level programmer, but would it be worth checking into
> using the OpenGL API for talking to graphics hardware? I'm not just
> thinking 3d here, IIRC, OpenGL has (potentially accelerated) 2d APIs
> or calls or whatever too.
>
> Glenn.
>
> -------------------------------------------------------- 
> Glenn Alexander
> (B.Teach, B.Ed Major IT Education, University of Wollongong Australia)
> Home site: http://www.shoalhaven.net.au/~glenalec
>
> I use GNU/Linux: http://www.gnu.org / http://www.linux.org
> from Debian: http://www.debian.org
> -------------------------------------------------------- 
> (Swishes cape and prepares to fly off) My work here is dumb.
> -------------------------------------------------------- 
>
>




More information about the Slate mailing list