Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » LIB SDL and ClanLIB

This thread is locked; no one can reply to it. rss feed Print
LIB SDL and ClanLIB
Carrus85
Member #2,633
August 2002
avatar

Quote:

::some_global;

Hmm... I don't think I have personally ever seen that syntax before, I'm dumb!. I'm just saying, we need to have a common programming scheme.

Personally, in my functions I pass them with an a_something or a p_something so I know that the value I am using is the one that was originally passed to the function, not a copy of it. Either that or start them with an underscore, capital letter, something to signify that this variable will be effected outside of this scope (I usually only use these when a pointer is being passed).

Hmm... Hungarian notation is evil, eh? I actually liked it to a certain extent. (At least at the function level, anyway).

Evert
Member #794
November 2000
avatar

Quote:

Basically, Allegro 5 needs to be a complete rework instead of an addition on top of allegro 4.

That was the idea. Note that both Bob and Peter Wang started on that, and that neither has any time to spare to continue and there are no other developpers who jumped in and took over. That's why development on Allegro 5 has come to a halt.

Quote:

Dump Datafile support-- who needs it?

I use it regularly, thank you. That said, it could easily be an addon (which could then come with the grabber and dat utilities).

Quote:

We might as well have a command-line utility for that

We already have: the dat utility. Beats the Grabber if you want to include a large chunk of bitmaps at a time.

Quote:

Just something so we can make our code as readable as possible

I personally really hate pedantic coding conventions that insist on obscuring the variable name with information about its scope, type and whatnot. No offence, just my contribution to the discussion.

Quote:

although I'm an ardent supporter of DOS, there's no reason to advance it beyond the already superb support present in Allegro 4.

I agree with both of these statements.

Quote:

So, anyone have any ideas on who the supreme dictator of this project is going to be?

I'd still say Eric, or at least someone with a good understanding of Allegro's internals and some experience in Allegro development (ie, someone with write access to the CVS repository). There's about twelve people that fit that description, which limits the choice. I do not consider myself the right person for that job though.

X-G
Member #856
December 2000
avatar

Quote:

We already have: the dat utility.

Right. Which is why I propose that if we are going to have a datafile system of our own, dat will be included and the grabber be a separate package; something separate from the core Allegro routines, but officially sanctioned by the same people.

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Carrus85
Member #2,633
August 2002
avatar

But still... datafiles are great and all, but what exactly is the point of them? They do, quite literally, the exact same thing that zip files do, except that we are modifying them to do what we need. Which brings up my saying of the week... WHY REINVENT THE WHEEL. Just use Zipfile support instead for crying out loud. Not only do you get a plethora of editors you can modify your datafile.zip with, you have the wonderful feeling of knowing that your not the one maintaining that piece of the code! Heck, with Zip file support, we could do all sorts of interesting things like virtual file systems and stuff.

No more multiple datafiles! Just one zip file for everything! Yippee!

And I have to agree with X-G on this one. If keeping the Datafiles is an asolute must, by all means, just give us the command line utility.

Also, one other note. Has anyone found it annoying that the datafile routines are slightly less than well documented (aka. not documented at all). Just try writing your own datafile output routines without using the grabber's/dat utilties source. It is a pain in the butinsky. Yet another reason to use zip files for datafiles. Heck, we could even just rename the *.zip file to a *.dat file and WOW! It looks the same and does the same thing, for much less! Amazing!

Sorry, I'm in a very sarcastic mood right now ::)

EDIT: Added some stuff

X-G
Member #856
December 2000
avatar

Quote:

virtual file systems

I for one would definitely like to see a good VFS; I'm not sure it should be a core allegro component, but I am definitely in favor of seeing an addon for this. It integrates especially nicely with .zip files as datafiles.

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Carrus85
Member #2,633
August 2002
avatar

Exactly... not only that, if you were to use zip files, you have the option of loading parts of the datafile where AND when you want it to be loaded as well, instead of having to load the entire datafile to ram.

Once again, why reinvent the wheel when it is already invented for you?

X-G
Member #856
December 2000
avatar

Indeed - that's the whole point in using Allegro to begin with - so we don't have to reinvent any wheels. :)

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

gnolam
Member #2,030
March 2002
avatar

cough*load_datafile_object()*cough ;)

--
Move to the Democratic People's Republic of Vivendi Universal (formerly known as Sweden) - officially democracy- and privacy-free since 2008-06-18!

Carrus85
Member #2,633
August 2002
avatar

the allegro documentation said:

Loads a specific object from a datafile. This won't work if you strip the object names from the file, and it will be very slow if you save the file with global compression. See grabber.txt for more information.

Call me a pessimist, but I believe that it could be quit a bit faster with a universal compression algorythm such as *.zip. Which would you prefer? A compression algorythm such as *.dat that is maintained by a few people, or *.zip which is accepted as an industry standard? At least with the industry standard library, it isn't yoru code to blame if the file isn't loading properly, it is theirs.

X-G
Member #856
December 2000
avatar

Despite load_datafile_object, there are so many more things to gain with using .zip instead of our own format, including, but not limited to:

  • Standardized file format

  • Lots of alternative editors with good support for it

  • More versatile

  • Inherent directory structures

  • Easy to integrate with a virtual file system

  • Good compression

  • Well supported in existing libraries

And so on.

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Marcello
Member #1,860
January 2002
avatar

Well, I think the original idea of packfile is that it uses a very fast compression format which can work both globally and on a per-file basis. I personally gutted zlib a while back to see why gzseek was so fucking slow on pocket pc (ARM processor), and it turns out when gzseek is called for anything before the current location, it goes back to the beginning of the file and uncompresses everything until it gets to the point you want.

Hence I wrote up my own compression format (raz: random access zip) using lzo or whatever it's called (same one that allegro uses).

Granted, it's not really a problem on today's systems with loads of ram and fast processors, but zlib isn't the fastest pickel in the bunch. I think a packfile system could easily be offloaded to plugins (and come on, plugins can be included with the standard download, they just don't have to be compiled into your app). Another argument is that all of the file-related functions call the packfile routines just for general file IO access, but I believe someone started up a new io stream api for allegro 5 that would render that argument pointless.

Another vote for in favor of zlib: I think PNG should be setup as standard with the library. There is no reason to not push for more usage of PNG out there. A lot of people are still using BMP's in their test projects and whatnot because they don't want to bother setting up PNG support.

Definitely drop DOS support.

And on the programming style conventions, I think a convention for the public API is definitely required, but under the hood, I think it could be more general stuff like "indent your code!" and whatnot.

As for dictators, I vote again for myself (woo, 2 votes!), because if I were dictator, I'd implement strict style conventions and make everything C++. Maybe throw in some java. ;) (j/k)

Marcello

Thomas Harte
Member #33
April 2000
avatar

Quote:

> I'll stick with programming tools that treat me like an adult,

Being an adult means knowing when to touch something and when something should be left alone. And if you don't know enough yet to know that improper use of the gamma ramp is silly, then you don't deserve to be treated as an adult.

Well, improper use of anything is axiomatically silly. But congratulations on having learnt the language.

But, just so as you know - the majority of Allegro.cc posters are Westerners living in predominantly Catholic democracies. One of the founding principles of such systems is the notion of 'universalism', which ties in with the mature recognition that a lot of people have a lot of different opinions and there is no such thing as universal truth.

Conversely, being childish is often associated with believing yourself to be right beyond question and stating that anyone who disagrees with you is necessarily wrong and deserves lesser treatment. It isn't only restricted to children though, its the sort of thinking that runs entire nations such as Zimbabwe.

Quote:

That's one of the primary reasons why we have hardware abstraction API's. Because programmers can't be trusted to go poking directly at the hardware. Poking the gamma ramp directly is clearly poking at the hardware. There's a simple abstraction to this that allows the gamma ramp to be used for exactly and only the purpose for which it was designed. Ergo, that is the abstraction that should be used.

Funny, most people seem to think that hardware abstraction APIs are to cover differences in hardware. Another strikingly funny thing is the way that hardware platforms with stable definitions never saw any significant abstraction APIs (I'm thinking Amiga, Archimedes, etc). A third funny thing: every other 'hardware abstraction API' gives you control over the gamma ramps.

Quote:

Something to put the DOS thing into perspective: Why are we no longer supporting the Atari?

We're still restricting people to its GUI practices...

Quote:

So, anyone have any ideas on who the supreme dictator of this project is going to be?

I vote Grzegorz Adam Hankiewicz. He started at pretty much the same time as me, but has apparently become quite closely integrated. And always seemed reasonable.

Quote:

But still... datafiles are great and all, but what exactly is the point of them?

When we discussed this before, whichever developer it was said that datafiles were originally implemented because zlib was too slow on 386s. Datafiles do not compress as well as zlib, skipping one stage or another entirely.

More recently this has been justified because the Allegro developers don't like the GPL. Even though zlib isn't GPL software...

EDIT:

Quote:

Well, I think the original idea of packfile is that it uses a very fast compression format which can work both globally and on a per-file basis. I personally gutted zlib a while back to see why gzseek was so yuckying slow on pocket pc (ARM processor), and it turns out when gzseek is called for anything before the current location, it goes back to the beginning of the file and uncompresses everything until it gets to the point you want.

To be fair, the docs do say w.r.t. gzseek "<i>f the file is opened for reading, this function is emulated but can be extremely slow."

Carrus85
Member #2,633
August 2002
avatar

I'm dumb! Marcello...

First of all, the internals should be C. No way around it. C is a bit easier to debug, not to mention a measure more easily ported than C++. Although I would have to say with the usage of C++ that is going on, it would be most definately nice to have a C++ wrapper class that you can use natively in C++ that COMES WITH THE LIBRARY. Such as a bitmap class, datafile (if they are kept) class, etc.

I would vote myself for dictator, but I'm a bit on the unexperienced end. I'm more than willing to help program the internals, but as for the fact that my formal programming education is near nonexistant.

One other thing that I had an idea for. Wouldn't it be nice to allow both high-level (current allegro) and low-level (sdl-like) actions? That way the newbs could use the high-level stuff, and those who prefer to optimize stuff could use the lower level APIs.

EDIT: Mr. Harte, since we are dumping support for dos, isn't that essentially dumping support for the 386 as well? I would be amazed to see a 386 run win98 semi-reasonably. If allegro is to survive, we need to make it look as attractive as possible to programmers. If programmers have to learn a completely new syntax for everything, such as our custom datafile syntax, restricting them to our custom 3d routines, etc. THey are going to be turned away because they don't want to waste time learning stuff. Productivity is the key to programming. Besides, by integrating Zlib, opengl, FMOD (maybe), etc., we give common functionality to new programmers; language experience that could be easily transfered from one library to another.

X-G
Member #856
December 2000
avatar

Quote:

since we are dumping support for dos, isn't that essentially dumping support for the 386 as well?

There are *nix systems that run swell on 386 systems, so no.

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Marcello
Member #1,860
January 2002
avatar

Dunno what you're going on about 386... what does that matter other than for optimizations that detect the cpu anyway?

As for C++, even bob has suggested this on the mailing list for the internals (instead of basically recreating vtables in c, to use c++'s for drivers), unless I'm incredibly mistaken.

It makes a lot of sense to me, I mean, name me a platform that doesn't have a c++ compiler that you actively are interested in having allegro compile on?

Marcello

Bob
Free Market Evangelist
September 2000
avatar

FMOD doesn't have a compatible license to Allegro, unfortunately. It also doesn't come with source code. However, feel free to write an Allegro driver for FMOD.

As for computer support, I'd say supporting the top-end of 10 years ago as the minimum is a good target. That would be something like the Pentium 166MHz with 32MB of RAM.

zlib doesn't provide a VFS, only the compression routines. There's an example app, however, that does this (minizip?).

Quote:

One other thing that I had an idea for. Wouldn't it be nice to allow both high-level (current allegro) and low-level (sdl-like) actions?

This is how Allegro is currently done.

Quote:

Another vote for in favor of zlib: I think PNG should be setup as standard with the library.

I'd vote for dumping all image loaders from the core and putting them all into one or more add-ons.

--
- Bob
[ -- All my signature links are 404 -- ]

Carrus85
Member #2,633
August 2002
avatar

Either that or supply a common API for the image loaders to follow, so it wouldn't be difficult to add them to the library.

We need to have some already supported with the download, for the newb-types. I would suggest these be the more commonly used, easier to edit file types (such as png, bmp). The rest could be implemented using add-on libs.

And, if we are going to implement addon libraries, which we have to in order to have a good library, it would also help if these libs followed a standardized setup plan. Aka... they all follow the fix.bat whatever, make, make install scheme.

Either that, or make a plugin directory under allegro that you can put all of your addins/plugins, and have some sort of orchastrating program to keep everything up to date..

Sorry, I'm kinda busy doing homework for other things right now, I'll hav eto put more thought into this later. :-/

spellcaster
Member #1,493
September 2001
avatar

I'd say allegro should have some bare minimum file support - say BMPs and WAV files.
A good ZLib and libPNG integration would be great as well.

--
There are no stupid questions, but there are a lot of inquisitive idiots.

Marcello
Member #1,860
January 2002
avatar

There is the question of how to handle the dll if we switch to a plugins based system. Should there be some type of multi-tier system:
1 - allegro raw dll, say allegro-raw50.dll
2 - allegro core "standard" plugins, allegro-core50.dll
Core standard plugins could be, for example, be the set of plugins most similar to the features allegro 4.0 has now that would be removed, such as packfile, png loader, DUMB, gui.
Then plugins could either be in dlls that work with both raw or core versions of the main DLL (for example, allegro-raw50.dll and allegro-dumb.dll; or allegro-core50.dll and allegro-software3d.dll), or compiled straight into your program (for example, allegro-raw50.dll with dumb compiled into application exe).

I can see the problem people have with tons of dlls in their system directory, but I see no problem if there is a standardized system. You can always include the dlls in the game directory instead of system. It is not uncommon to see applications/games with tons of dlls in their program directory. Likewise I think the plugin system should have a standard way to link statically and dynamically, so if you do not want any dll dependence (on any OS), you can compile it out.

If such a system is adopted, it would also be nice to have some kind of plugin repository with official DLL builds (done in upx, msvc++ or whatever gives you the smallest/most optimized dll) so conflict are minimized.

Any takes on that?

Marcello

X-G
Member #856
December 2000
avatar

I think that should be PNG and WAV rather than BMP and WAV.

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Chris Katko
Member #1,881
January 2002
avatar

If PNG is going to be included, PNG should be on top of BMP support. Not everyone needs, wants, or can, use PNGs. As open as it is.

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

Marcello
Member #1,860
January 2002
avatar

Why can't you use PNG's? It can do everything bmp can do and more... pretty widely supported by drawing programs as well.

Marcello

Bob
Free Market Evangelist
September 2000
avatar

Loading PNGs requires libpng, and that requires zlib. Allegro should build and run all by itself (without additional dependencies). We don't want people to have to download 4 or 5 packages just to get Allegro up an running.

--
- Bob
[ -- All my signature links are 404 -- ]

Chris Katko
Member #1,881
January 2002
avatar

Quote:

Why can't you use PNG's? It can do everything bmp can do and more... pretty widely supported by drawing programs as well.

But maybe you don't want or need compression. Or should we dump waves and all use monkey audio, which is lossless?

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

Carrus85
Member #2,633
August 2002
avatar

Well, wether or not you use PNG or BMP, it is quite trivial. We could simply do some sort of program design like this...

1Allegro Root-
2 Source-
3 Core-
4 Image-
5 +pnghandler
6 +bmphandler
7 +gifhandler
8 +jpghandler
9 +whateveryouwanthandler
10 Sound-
11 +wavhandler
12 +mp3handler
13 +xmhandler
14 +whateveryouwanthandler
15 Input-
16 +keyboard
17 +joystick
18 +mouse
19 +anything-else(network maybe)
20 Graphics-
21 +opengl
22 Threading-
23 etc.-

It would be a pain to get anything like that to compile though... Most of the common stuff should be integrated into the library, and the plugins should be able to seamlessly integrate themselves with the existing functions.

For example, if you have the *.png loader and the *.bmp loader, you should be able to do a call like this:

load_bitmap("whatever.png")
load_bitmap("whatever.bmp")

and the library should be able to handle the various file types. The only problem with this would be that you would need to implement some rather, how should I put it, interesting(?) coding styles.

EDIT: Bob, welcome to the world of scripting. Just write a python script or something that downloads those additional libs for you so you don't have to find them yourself. (I'm dumb!... great idea, but we don't want to force people to install python. Maybe the makefile could make a c/c++ getfile tool or something, then use that to retrieve the needed libs from the net?)

EDIT:

As for dll naming conventions, I would prefer something like this...

1alleg50_core.dll <- core lib
2alleg50_addonname.dll <- addon lib
3 
4Some examples:
5alleg50_mp3.dll
6alleg50_wav.dll
7alleg50_png.dll
8alleg50_zlib.dll
9alleg50_net.dll
10etc.
11 
12or maybe
13all50.dll <core
14all50addname <addon
15all50mp3.dll
16all50wav.dll
17all50png.dll
18all50zlib.dll
19all50net.dll

As for DLL clutter, can you load DLL's from a subdirectory? So, for example, you could do something like this

PROGRAM_ROOT:
      -Executable
      +all5plugin folder (or something.  Heck, it might even be possible to use a zip file for this)
            -all50wav.dll
            -all50png.dll
            -etc.dll

EDITED Again for clarity



Go to: