The game SDK community

Nicholas Vining wrote:

Hmm, thinking about this, there is a FastGL library which seems to be a
windowing library over a framebuffer (fbcon or Svgalib I think)… If
GTK+ can be made to work on this, it would be trivial to then make
FastGL use SDL for the framebuffer…

Bad idea. You start getting into stacks of APIs heaped on top of each other,
and things get nasty. SDL, if it’s going to do this sort of thing, should do
the low down graphical work itself, and the window management. Besides
which, they’re the competition, and we don’t put features in the
competition’s source code! :slight_smile:

I think the windowing code wouldn’t be so trivial to do, so using the
already made code from FastGL would be a good start, and things should
go on from there, improving the integration and optimizing it. For
example, with SDL targets that have native windows (like X11 or
non-fullscreen DirectX), it could create real windows instead of having
a pseudo-desktop inside a single window.

Beside, I do not see them really as competition. For one, FastGL is much
smaller and has much less following than SDL. Also, this is open source.
We use their code to improve SDL and they get to use SDL code to improve
theirs. It’s all fair and good for the community (as long as credit is
given properly).

If FastGL suddenly becomes very popular and overcomes SDL, maybe by way
of using SDL code, then I think the projects could possibly unite and
work together (going as far as Loki using the SDLized “FastGL 2” for
their new games).

I already think ClanLib and SDL should work a bit more together, but
they have slightly differing goals and methods (C vs C++ for one), so
maybe it is okay to have separate libraries.

But working together doesn’t absolutely means merging. For example, if
at one point video subsystem feature sets start culminating to a common
point, we could sit down, lay down a C API for a "video driver/target"
and have SDL and ClanLib (and possibly others) dlopen/LoadLibrary them!
Then new targets and high performance video code could be done in a
common code base, profiting to both SDKs.

It would also make a good impression on would-be Linux game developers,
that would see that even if there isn’t a single DirectX-like API, they
can freely choose and not lose anything, as the same code will do the
work in both cases!–
Pierre Phaneuf
Ludus Design, http://ludusdesign.com/
“First they ignore you. Then they laugh at you.
Then they fight you. Then you win.” – Gandhi

Pierre Phaneuf wrote:

I already think ClanLib and SDL should work a bit more together, but
they have slightly differing goals and methods (C vs C++ for one), so
maybe it is okay to have separate libraries.

one possibility that would require much work would be to merge the SDL
blitters/ converters into Hermes. SDL currently uses some old MMX
converters from Hermes and does the other blitting/ conversion on its
own. So a nice task for a bored person would be to time all blitters/
converters and merge the fastest into Hermes. If SDL shouldn’t rely on
another library (Hermes should compile on almost any machine that has an
ANSI C compiler) it could still just include the source of the new
Hermes. This way we had one blitting library we could focus writing
optimized code for.–
Daniel Vogel

666 @ http://grafzahl.de

Daniel Vogel wrote:

I already think ClanLib and SDL should work a bit more together, but
they have slightly differing goals and methods (C vs C++ for one), so
maybe it is okay to have separate libraries.

one possibility that would require much work would be to merge the SDL
blitters/ converters into Hermes. SDL currently uses some old MMX
converters from Hermes and does the other blitting/ conversion on its
own. So a nice task for a bored person would be to time all blitters/
converters and merge the fastest into Hermes. If SDL shouldn’t rely on
another library (Hermes should compile on almost any machine that has an
ANSI C compiler) it could still just include the source of the new
Hermes. This way we had one blitting library we could focus writing
optimized code for.

Very good idea. I think that statically linking Hermes into an SDL
shared library should work correctly, as Hermes is a very self-contained
library. Including the sources of another project isn’t a very good idea
IMHO, but packaging being what it is…–
Pierre Phaneuf
Ludus Design, http://ludusdesign.com/
“First they ignore you. Then they laugh at you.
Then they fight you. Then you win.” – Gandhi

Very good idea. I think that statically linking Hermes into an SDL
shared library should work correctly, as Hermes is a very self-contained
library. Including the sources of another project isn’t a very good idea
IMHO, but packaging being what it is…

You run into licensing problems. Hermes is under LGPL which prevents
static linking for programs which do not come with source code.

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

hi`

Sam Lantinga wrote:

Very good idea. I think that statically linking Hermes into an SDL
shared library should work correctly, as Hermes is a very self-contained
library. Including the sources of another project isn’t a very good idea
IMHO, but packaging being what it is…

You run into licensing problems. Hermes is under LGPL which prevents
static linking for programs which do not come with source code.

D’oh, I didn’t knew that… Guess I have to read the license more
carefully again. Well, one solution would be a change to the license to
allow static linking. How is it done at the moment? Used with permission
(MMX converters)?–
Daniel Vogel

666 @ http://grafzahl.de

hi`

Sam Lantinga wrote:

Very good idea. I think that statically linking Hermes into an SDL
shared library should work correctly, as Hermes is a very self-contained
library. Including the sources of another project isn’t a very good idea
IMHO, but packaging being what it is…

You run into licensing problems. Hermes is under LGPL which prevents
static linking for programs which do not come with source code.

D’oh, I didn’t knew that… Guess I have to read the license more
carefully again. Well, one solution would be a change to the license to
allow static linking. How is it done at the moment? Used with permission
(MMX converters)?

The MMX converters are not compiled in. Actually I’ve had some reports
that the MMX converters are slower than the C ones. I haven’t verified
this.

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

Sam Lantinga wrote:

Very good idea. I think that statically linking Hermes into an SDL
shared library should work correctly, as Hermes is a very self-contained
library. Including the sources of another project isn’t a very good idea
IMHO, but packaging being what it is…

You run into licensing problems. Hermes is under LGPL which prevents
static linking for programs which do not come with source code.

Which is the same for SDL. Statically linking LGPLed Hermes into a
LGPLed SDL shared library is okay, as the SDL shared library has to come
with sources. To statically link a proprietary program against both
Hermes and SDL is another thing completely, which can also be done in
the way you did with the various Loki ports.

No licensing problem here.–
Pierre Phaneuf
Ludus Design, http://ludusdesign.com/

Pierre Phaneuf wrote:

If FastGL suddenly becomes very popular and overcomes SDL, maybe by way
of using SDL code, then I think the projects could possibly unite and
work together (going as far as Loki using the SDLized “FastGL 2” for
their new games).

FastGL is more application framework for easy writing of simple, windowed
graphics application (not only windowed!). It contains, by example, config
file stuff. But power of this lib is pretty good windowing with some
powerful widgets like EditBox’es, ProgressBar, some sorts of buttons,
ListBox’es etc. Cutting this code (cca. 250-300KB of source code) and total
rewriting one for using SDL routines seem as very good idea for me. With
FastGL code compatibility lossing. Writing code for FastGL API seems funny
for many peoples!

PS: Be care, my point of view must not be very objective, because I
interested on develop of this library.

Marian Krivos

Pierre Phaneuf wrote:

Which is the same for SDL. Statically linking LGPLed Hermes into a
LGPLed SDL shared library is okay, as the SDL shared library has to come
with sources. To statically link a proprietary program against both
Hermes and SDL is another thing completely, which can also be done in
the way you did with the various Loki ports.

So one could staticly link Hermes (and the other libs SDL requires) into
an
SDL binary, then distribute that one library in a commercial product?
This
is something I have been wondering because so many libraries depend on
other
little libraries like libjpeg, etc. I’ve always wandered how companies
like
Loki managed to not depend on those. And nowadays a lib like SDL can be
built
with or without support for some things so just having SDL doesn’t mean
you
can run an SDL app. How do the commercial companies out there make sure
that the
libs they include don’t replace newer libs, but that the newer lib as
all the
features needed. Quake 3 I think it is has a lib (mesa?) in it’s
directory.
Do they just dynamically load their own shipped version of a full
featured lib
that has had it’s dependants statically linked? If so will ld
automatically
load the lib from the directory instead of from /usr/lib?
Sorry for all these newbie-esque questions. I’ve just always dealt with
dynamic
libs and never really worried much about dependancies until now. I hope
to offer
binaries of my PowerPak lib sometime soon (escpecially with BeOS
becoming free
sometime in this Quarter) and would like to statically link the required
libs
so PowerPak users don’t need to download lots of stuff. (with dynamic
linked
versions available as well of course for those that have the libs and
want to
save space) PowerPak being LPGL’d though brings issues though if someone
were
to release a non-free project that links with only the statically built
PowerPak
library. I just want to be sure to know all the aspects of the license I
am
releasing my work under.

John Garrison wrote:

Note: I’ll use the term “non-free” to designate “proprietary”.

Which is the same for SDL. Statically linking LGPLed Hermes into a
LGPLed SDL shared library is okay, as the SDL shared library has to come
with sources. To statically link a proprietary program against both
Hermes and SDL is another thing completely, which can also be done in
the way you did with the various Loki ports.

So one could staticly link Hermes (and the other libs SDL requires)
into an SDL binary, then distribute that one library in a commercial
product?

Yes. The LGPL says that you can link non-free source code with the LGPL
code provided that there is a way for the user to modify the LGPL and
make the non-free source code use the modified LGPLed code.

You got that? Thus, LGPL code in a shared library is always safe to
link non-free code against (of course, modifications to the LGPL code
itself must be made public). There are a few ways to statically link
non-free code against LGPL code:

  • Make the .o for the non-free code available, enabling the user
    to relink the application himself. The advantage is that it gives the
    choice to the user of shared or static linking. The disadvantage is
    that is makes reverse-engineering easier.

  • Make an alternative non-static binary of the non-free code. This is
    what
    Loki does to avoid the whole “requires this and that libraries”. The
    problem would be when you have to be static to work (what cases?).

Note that the second way is nice, because it allows for making a package
that works right off the bat (thats why we want static-linking in the
first place for things like games), but also allows people who knows
enough about libraries to reduce the memory usage of the game (by using
the common shared libraries).

This is something I have been wondering because so many libraries depend
on other little libraries like libjpeg, etc. I’ve always wandered how
companies like Loki managed to not depend on those.

You can easily depend on LGPL libraries and even static link, as long as
you provide a way for the user to modify or replace the LGPL code.

Linking with GPL code is a whole other story.

And nowadays a lib like SDL can be built with or without support for some
things so just having SDL doesn’t mean you can run an SDL app. How do the
commercial companies out there make sure that the libs they include don’t
replace newer libs, but that the newer lib as all the features needed.

By statically linking, you’re avoiding a bunch of headaches to the
packager and the user, because the binary is self-contained (exception
could be made of things like configuration files, like Svgalib’s
libvga.config). You know that your game works with the exact library you
linked with, so statically linking brings that very same library to the
user.

Providing a dynamically linked binary allows the user to use updated
version of libraries and/or modify those libraries, to counter bugs in
them for example.

Quake 3 I think it is has a lib (mesa?) in it’s directory. Do they just
dynamically load their own shipped version of a full featured lib that has
had it’s dependants statically linked? If so will ld automatically load
the lib from the directory instead of from /usr/lib?

The Mesa library that comes with Quake 3 is dynamically linked itself,
but the library is dynamically loaded (with dlopen instead of at link
time) with quake3.bin, but this is to provide a feature, not to satisfy
licensing.

I think dlopen uses /etc/ld.so.conf (hence /usr/lib) to find its
libraries, but specifying a path will make it look there instead, which
is what the quake3 script does.

Sorry for all these newbie-esque questions. I’ve just always dealt with
dynamic libs and never really worried much about dependancies until now.
I hope to offer binaries of my PowerPak lib sometime soon (escpecially
with BeOS becoming free sometime in this Quarter) and would like to
statically link the required libs so PowerPak users don’t need to
download lots of stuff. (with dynamic linked versions available as well
of course for those that have the libs and want to save space) PowerPak
being LPGL’d though brings issues though if someone were to release a
non-free project that links with only the statically built PowerPak
library. I just want to be sure to know all the aspects of the license
I am releasing my work under.

That’s okay (for the newbie-esque questions)! :slight_smile:

If PowerPak is LGPL and doesn’t use GPL libraries, you can safely
statically link dependent libraries into the shared library. Being a
LGPL code, the user already has a way to make PowerPak use modified
versions of the dependent libraries, by downloading the source and
recompiling!

The only time the licensing comes into play is when you introduce
proprietary code into the equation, and that’s the problem of the owner
of that proprietary code.

Also, the GPL is allergic to anything proprietary, period. Did you know
that you cannot distribute a binary of a GPL game that is linked against
proprietary OpenGL libraries (for example, the SGI or Windows OpenGL)?
I’m not completely sure, but the license is so obtuse that it is
possible that this could even stop you from releasing source code that
has to deal with WGL!!!

You can only distribute GPL source code in complete, working order, and
it can only depend on either libraries with licenses compatible with the
GPL (http://www.gnu.org/philosophy/license-list.html, very short list!).

Conclusion:

LGPL -> practical
GPL -> ethical–
Pierre Phaneuf
Ludus Design, http://ludusdesign.com/

From the LGPL: (go find the whole thing and read it if you plan on using
SDL in a non-GPL way)

  1. As an exception to the Sections above, you may also compile or link a
    "work that uses the Library" with the Library to
    produce a work containing portions of the Library, and distribute that
    work under terms of your choice, provided that the
    terms permit modification of the work for the customer’s own use and
    reverse engineering for debugging such modifications.

Keep in mind that if your “work that uses the LGPL” is statically linked
with a LGPL library, your license for distributing the final work cannot
exclude people from reverse-engineering and modifying not only the LGPL
stuff, but also your code.

Ok, people do this whether you give them permission or not, but I figured
it was important to point out. :slight_smile:

If your license conflicts with the LGPL, it’s up to the courts to decide
which one wins, so wording is important.–
Brian