Library name changes

I’m thinking about renaming some of the libraries to reduce namespace
clashes:

IMGlib --> SDLimg
GUIlib --> SDLsimplegui
mixer --> SDLmixer

Comments?
Merry Day After Christmas! :slight_smile:

-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:

I’m thinking about renaming some of the libraries to reduce namespace
clashes:

    IMGlib --> SDLimg
    GUIlib --> SDLsimplegui
    mixer --> SDLmixer

Comments?
Merry Day After Christmas! :slight_smile:

Either use SDLimg/SDLmxr or SDLimage/SDLmixer.

Don’t abbreviate one and not the other. In fact, you’re only saving 2
characters each, so consider not abbreviating at all.–
Marc Lepage
http://www.antimeta.com/
Minion open source game, RTS game programming, etc.

Sam Lantinga wrote:

I’m thinking about renaming some of the libraries to reduce namespace
clashes:

    IMGlib --> SDLimg
    GUIlib --> SDLsimplegui
    mixer --> SDLmixer

Comments?

I’m all for the change – the misleading genericness of the name
“IMGlib” has been bugging me for a while now.

Thanks,

Nathan

I’m thinking about renaming some of the libraries to reduce namespace
clashes:

IMGlib → SDLimg
GUIlib → SDLsimplegui
mixer → SDLmixer

Being a big mixer user, and having to explain to people who use my software
that they need it, naming it something more SDL-related would help… yes. :slight_smile:

You could do it Hungarian Notation style, even! :slight_smile:

Like:

aapilcSDLmixerlib

(audio api library in c for SDL called mixer library)

(I’m KIDDING)

-bill!

Either use SDLimg/SDLmxr or SDLimage/SDLmixer.

Don’t abbreviate one and not the other. In fact, you’re only saving 2
characters each, so consider not abbreviating at all.

Heheh… this reminds me of Atari BASIC. :slight_smile: Pretty much every BASIC keyword
could be abbreviated with a dot (“.”).

For example:

PRINT PR.
LOCATE LOC.
POSITION POS.

But then there was this one which always made me wonder:

REM RE.

I see no savings… :wink:

-bill!
(Just reminiscing again)

I’m thinking about renaming some of the libraries to reduce namespace
clashes:

[snip]

Sure, go for it. I have no objections one way or the other. The one worry
that I have is that it’ll mean changing all the damned makefiles for
applications which are used to the old names, but… well, they can just
swivel on it :stuck_out_tongue:

Nicholas

----- Original Message -----
From: slouken@devolution.com (Sam Lantinga)
To: sdl at lokigames.com
Date: Sunday, December 26, 1999 10:24 AM
Subject: [SDL] Library name changes

I’m thinking about renaming some of the libraries to reduce namespace
clashes:

IMGlib → SDLimg
GUIlib → SDLsimplegui
mixer → SDLmixer

Comments?

Does it make sense to name things:

/usr/include/mixer.h --> /usr/include/SDL/SDL_mixer.h
/usr/lib/libmixer.la --> /usr/lib/libSDLmixer.la

?
-Sam Lantinga (slouken at devolution.com)

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

All this sounds reasonable to me.
Now if you are going to put it into that format (e.g. /usr/include/SDL)
it follows that it could be included within SDL 1.1, rather than being a
seperate demo/library as well… :slight_smile:

I know the library name changing was a good idea. While talking about
IMGlib with others, there was a common confusion between that and the
other one with a similar name.–
Brian Hayward

I’m thinking about renaming some of the libraries to reduce namespace
clashes:

IMGlib → SDLimg
GUIlib → SDLsimplegui
mixer → SDLmixer

Comments?

Does it make sense to name things:

/usr/include/mixer.h → /usr/include/SDL/SDL_mixer.h
/usr/lib/libmixer.la → /usr/lib/libSDLmixer.la

?
-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software

“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

Sam sed:

Does it make sense to name things:

/usr/include/mixer.h → /usr/include/SDL/SDL_mixer.h

I definitely like “mixer.h” (or “SDL_mixer.h” if you wanna call it that)
being in the “SDL/” subdir. It really doesn’t make sense outside of it…

-bill!

All this sounds reasonable to me.
Now if you are going to put it into that format (e.g. /usr/include/SDL)
it follows that it could be included within SDL 1.1, rather than being a
seperate demo/library as well… :slight_smile:

I’m glad I’m not the only one who loves mixer so much that I want it part of
the SDL API. :wink:

I don’t care about it quite as much, now that it’s its own separate download.
(Asking people to download the ENTIRE demos archive just to get the mixer
to be able to use one of my games was kinda asking too much of some ;)…
I have no idea what they’re problem is! >I< get 140Kbps downloads! Doesn’t
everyone!? :slight_smile: )

Speaking of SDL API and library stuff, has anyone worked on a generic datafile
library? (ie, something which, under Un*x’s would create “~/.FOOrc” files,
and under Win32 would create “FOO.ini” files, etc.)

My first suggestion was just something that would work like “fopen()” except
different based on the OS.

Someone else had a better suggestion which was an API for reading and
writing data to the data file in general.

Something like:

highscore = SDL_GetValue(“highscore”);

or something…

Anyone working on this?

-bill!

Here you go, merry christmas… (ok… I probably have the wrong define
belew, but you get the point).

#ifdef WIN32
char *config = “c:\windows\mygame.ini”;
#else
char *config = “$HOME/.mygamerc”;
#endif

FILE *cfg = fopen(config,“r”);

:)–
Brian Hayward

P.S. I haven’t done audio yet, but I referring to IMGlib, TTFlib,
and SDLnet being included in SDL.

On Mon, 27 Dec 1999, William Kendrick wrote:

All this sounds reasonable to me.
Now if you are going to put it into that format (e.g. /usr/include/SDL)
it follows that it could be included within SDL 1.1, rather than being a
seperate demo/library as well… :slight_smile:

I’m glad I’m not the only one who loves mixer so much that I want it part of
the SDL API. :wink:

I don’t care about it quite as much, now that it’s its own separate download.
(Asking people to download the ENTIRE demos archive just to get the mixer
to be able to use one of my games was kinda asking too much of some ;)…
I have no idea what they’re problem is! >I< get 140Kbps downloads! Doesn’t
everyone!? :slight_smile: )

Speaking of SDL API and library stuff, has anyone worked on a generic datafile
library? (ie, something which, under Un*x’s would create “~/.FOOrc” files,
and under Win32 would create “FOO.ini” files, etc.)

My first suggestion was just something that would work like “fopen()” except
different based on the OS.

Someone else had a better suggestion which was an API for reading and
writing data to the data file in general.

Something like:

highscore = SDL_GetValue(“highscore”);

or something…

Anyone working on this?

-bill!

Here you go, merry christmas… (ok… I probably have the wrong define
belew, but you get the point).

#ifdef WIN32
char *config = “c:\windows\mygame.ini”;
#else
char *config = “$HOME/.mygamerc”;
#endif

FILE *cfg = fopen(config,“r”);

Thanks. :slight_smile:

BUT… Does “BeOS” support the “$HOME” environment variable?
Does it use the “.FOOrc” filename standard for config. files?

What about other OSes that SDL will eventually be ported to?
(Mac? Amiga? Hehe)

Also, have you got some code for writing a ‘real’ INI file (since I
assume they have some kind of format… I dunno, I don’t have Windows).

Besides, I already did THIS code in MadBomber. :slight_smile: (More or less)

-bill!

BUT… Does “BeOS” support the “$HOME” environment variable?
Does it use the “.FOOrc” filename standard for config. files?

Yea, I’m sorry for the sarcasm…
You’re right, this would be a useful thing.

You would move the portability issue out of your game and into a library.
It would also be nice to use a “universal path converter” as well. I would
use “/” as the seperator… (not out of any BIAS or course).

Which would be just as easy to implement.
It would merely take something like a SDLopen() routine.

For that matter, I would use the same filename, I wouldn’t change it per
platform. (e.g. .somethingrc or something.ini).
Just use: datadir/something.conf, or something like that.

You will probably still need to do some sort of “base-data-dir” no matter
what. Because as you said, not all platforms support $HOME. Unless you
assume a directory on windows, or pull it out of the path to the executing
binary, you won’t know what to do under windows.

(you can’t really assume c:\windows, because that isn’t a requirement… i
guess there’s probably a reg. key setting somewhere though)–
Brian Hayward

Also, have you got some code for writing a ‘real’ INI file (since I
assume they have some kind of format… I dunno, I don’t have Windows).

AFAIK its customary on w*n to have them like this:

[section_name]
var1=foo
var2=bar
[section_name2]
var1=anotherfoo
.
.
.

But if it’s only for use by your own game you can write it however
you like, can’t you.

All the best,
rob

hi`

William Kendrick wrote:

Someone else had a better suggestion which was an API for reading and
writing data to the data file in general.

Something like:

highscore = SDL_GetValue(“highscore”);

or something…

there is a tool called ‘appconf’ that does this. I think it doesn’t get
maintained anymore, but maybe it would be a good starting point (Windows
and Linux). Don’t have a link at hand, sorry.–
Daniel Vogel

666 @ http://grafzahl.de

I think if you keep everything the same like that, then yeah it’s cool.
Then we know if we have a header file for SDL_mixer.h then the lib is
libSDLmixer.la and if we have one called SDL_samscool.h then we have
libSDLsamscool.h

:slight_smile:

I like this about the GTK how everything is standard on the way they name
the casts to the widget types, etc…On Mon, 27 Dec 1999, Sam Lantinga wrote:

I’m thinking about renaming some of the libraries to reduce namespace
clashes:

IMGlib --> SDLimg
GUIlib --> SDLsimplegui
mixer --> SDLmixer

Comments?

Does it make sense to name things:

/usr/include/mixer.h → /usr/include/SDL/SDL_mixer.h
/usr/lib/libmixer.la → /usr/lib/libSDLmixer.la

?
-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software

“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

William Kendrick schrieb:

I don’t care about it quite as much, now that it’s its own separate download.
(Asking people to download the ENTIRE demos archive just to get the mixer
to be able to use one of my games was kinda asking too much of some ;)…
I have no idea what they’re problem is! >I< get 140Kbps downloads! Doesn’t
everyone!? :slight_smile: )

Are you talking about 140 kilobits or bytes per second? I have at
average 30 Kilobytes per second (Cable) ggg

Speaking of SDL API and library stuff, has anyone worked on a generic datafile
library? (ie, something which, under Un*x’s would create “~/.FOOrc” files,
and under Win32 would create “FOO.ini” files, etc.)

Great Idea, see below

Someone else had a better suggestion which was an API for reading and
writing data to the data file in general.

Something like:

highscore = SDL_GetValue(“highscore”);

It could be done as follows:
Functions like these:

SDL_Settings set;
set=SDL_OpenSettings(“wurm”); /* Meaning the Game Name or another Unique
Identifier */
SDL_SetValue(&set,“highscore”,300);
SDL_GetValue(&set,“highscore”);

SDL_CloseSettings(&set);

And maybe something like SDL_EnumValues(&set,Callbackfunc,MySettings);

I personally would prefer C++ classes, but well… Not all seem to.

What do you think about this?
Under Windows, the registry could be used for this, under Linux you
could create a ~/.SDL or something like this, where the Settings are
stored in this format:

[wurm] # the identifier from above
highscore=300
numplayers=2

[lxdoom]
resolutionx=800
resolutiony=600

and so on…

You get the idea?–
Christian Biesinger
Get Paid To Surf:
http://www.AdOne.de/startup.php?werber=45130
Hi! I’m a signature virus! Copy me into your signature file to help me
spread!

AFAIK its customary on w*n to have them like this:

[section_name]
var1=foo
var2=bar
[section_name2]
var1=anotherfoo
.
.
.

But if it’s only for use by your own game you can write it however
you like, can’t you.

Well, I assumed there were some kinds of editors (or perhaps a Windows API
which SDL could just wrap around when compiling for Win32) which used a
standard format…

-bill!

William Kendrick schrieb:

I don’t care about it quite as much, now that it’s its own separate download.
(Asking people to download the ENTIRE demos archive just to get the mixer
to be able to use one of my games was kinda asking too much of some ;)…
I have no idea what they’re problem is! >I< get 140Kbps downloads! Doesn’t
everyone!? :slight_smile: )

Are you talking about 140 kilobits or bytes per second? I have at
average 30 Kilobytes per second (Cable) ggg

Sorry. :slight_smile: 140Kbytes/sec. :slight_smile: (DSL - whee!). Note that this isn’t common due
to lots of server’s having slower connections or something. :wink:

Under Windows, the registry could be used for this, under Linux you
could create a ~/.SDL or something like this, where the Settings are
stored in this format:

Not sure I like it being all in one file, honestly.
(Makes it hard to uninstall stuff :slight_smile: )

-bill!

William Kendrick schrieb:

Christian Biesinger wrote:

Under Windows, the registry could be used for this, under Linux you
could create a ~/.SDL or something like this, where the Settings are
stored in this format:

Not sure I like it being all in one file, honestly.
(Makes it hard to uninstall stuff :slight_smile: )

Okay, what about this:
In my Mail, i mentioned an Identifier.
So the files are (under Linux) in the Home-Dir.
The Filename is a dot + the identifier.

For Example: Identifier Worm; Filename ~/.Worm

Do you like this better?–
Christian Biesinger
Get Paid To Surf:
http://www.AdOne.de/startup.php?werber=45130
Hi! I’m a signature virus! Copy me into your signature file to help me
spread!