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
Thomas Harte
Member #33
April 2000
avatar

Quote:

Where is Thomas Harte when you need him?

All but gone from the Allegro community. It just doesn't do what I need. But, some random replies to things I've read here:

Quote:

Is there like some sort of built-in Anti-aliasing and Alpha blending engine? [in SDL]

SDL contains full alpha channel support, and even has the highly useful function:

SDL_Surface *SDL_DisplayFormatAlpha(SDL_Surface *)

Which takes the specified surface, of any RGB colour format paletted or not and converts it to one, with an alpha channel, best suited to fast blitting to the current output mode, meaning that it uses any hardware acceleration available. The surface is moved to video memory if that makes most sense.

Perhaps it is because SDL offers more help in using the hardware effectively than Allegro that the SDL newsgroup almost never sees that Allegro.cc stalwart - the discussion of some 'technology' everybody else thought was ten years dead. Such as dirty rectangles. Or writing your own sprite blitter because the Allegro one is too slow.

This is pretty much like one of my API suggestions for Allegro 5, that the user should give hints as to what they intend to use a surface for, allowing the library to pick where to put it, etc, rather than having the user pick video/memory/AGP memory. Just the sort of thing I thought would make sense for the Allegro target community.

Quote:

Edit: What palette thing? Do you take offense to the two spellings?

As I said, I barely use Allegro, but certainly until recently wasn't it stuck with VGA standard 18bit colour palettes?

Quote:

Does SDL have hardware rotation and scaling? Last time I looked it was very minimal

No, it doesn't have either, unless you count its overlay surface support. Obviously those can be scaled.

Quote:

Well, if allegro is dying, how hard would it be just to write a "ghost layer" that provides the same functionality as allegro, but uses SDL as the graphics/input api instead of directx?

Several years ago I wrote my own 'mini-Allegro' which replicated somewhere less than the SDL functionality (although SDL was version 0.1 at the time, and I hadn't tried it) in DirectX. That was very neat, but has alas disappeared into the ether of time. And in any case, SDL is so much easier.

Quote:

SDL Lacks some windows compability tho..

The only issue I can think of is that the num and caps lock keys are programmed not to provide normal keydown/keyup messages, but instead effetively provides down/up messages with respect to the LEDs. This is to maintain compatibility with some esoteric UNIX systems.

That said, considering that the Allegro developers rejected threads because they couldn't be done on a DOS port, this imperfection appears minor.

I remember doing a little survey of Allegro programs available with source at one stage. Especially with respect to timers, almost none of them were DOS valid anyway.

Quote:

Allegro is collapsing in complete disarray

I'm sure Allegro, its quaint syntax, its desperate support for ancient and useless technology (FLIs, LBMs, the provided GUI) and its complete lack of orthogonality will be remembered fondly.

As I've said before, I consider the 3d camera matrix generating function to be the quintesential demonstration of the Allegro approach. The docs state that the three supplied vectors must be orthogonal for the function to work. The code then expends several dot products and at least one square root assuming the programmer has been unable either to read the docs or conform to them.

My version five plan for Allegro would largely include:

  • dump DOS

  • dump timers

  • dump GUI, all packfile stuff, all software 3d

  • implement threads

  • implement proper alpha channels

  • orthogonalise

  • access to more hardware - gamma ramps, overlay surfaces, etc

I'd probably try to go a '2d OpenGL' route (including in syntax - no more underscores!), with stacks all over the place and broad equivalents to display lists. But most of my ideas have been explicitly rejected at one time or another.

Billybob
Member #3,136
January 2003

Why drop the timers? I like those ;). If you dump DOS support I'm sure the timers will work a lot cleaner.

Chris Katko
Member #1,881
January 2002
avatar

Quote:

no more underscores!),

Ooph! thenthisbecomesmuchhardertoreadthanforinstance, this_which_is_much_easier_to_read_because_the_brain_processes_the_underscore_as_whitespace.

:)

I agree fully with dumping everything else you mentioned, though. DOS doesn't add anything useful anymore. You wouldn't even have to "lock" variables/functions. Which is only needed on DOS, isn't it? (to prevent disk swaps during an interrupt. i.e., read: BOOM) Though, it would need some mutexes (but it needs them anyway to begin with).

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

23yrold3yrold
Member #1,134
March 2001
avatar

   bool UnderscoresPlainlySuckAss()
   {
      return true;
   }

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

Steve Terry
Member #1,989
March 2002
avatar

I'm sure syntax conventions are the least of the worries for A5....

___________________________________
[ Facebook ]
Microsoft is not the Borg collective. The Borg collective has got proper networking. - planetspace.de
Bill Gates is in fact Shawn Hargreaves' ßî+çh. - Gideon Weems

Billybob
Member #3,136
January 2003

Quote:

Ooph! thenthisbecomesmuchhardertoreadthanforinstance,

Yeah, ummm, before you go off on a style, learn it first. What 23yrold3yrold did is the correct way of not using underscore. It is clearly just as readable as underscores and requires less space ;)

Richard Phipps
Member #1,632
November 2001
avatar

With a nice set of defines this UpperCase / under_score issue is not important.

I'm afraid that I value Thomas Harte's experience and opinion and I think he is right that Allegro is getting badly dated and left behind.

:(

I would say a priority would be to give it more 3D hardware power built in (merging with AllegroGL and extra blitting functions, etc..) to enable us to compete with SDL and to attract new programmers with the fancy effects and games we would then be able to do.

Bob
Free Market Evangelist
September 2000
avatar

- dump DOS

Well, I'm not writing any DOS code. If anyone wants DOS support, they'll just have to code it.

- dump timers

Timers are somewhat useful, but they're a pain to support. Better to provide high-resolution timers. We've already agreed on that.

- dump GUI, all packfile stuff, all software 3d
GUI is not likely to go, since many of the Allegro tools use it. It would be nice to have it replaced by some leaner framework.

- implement threads

I'm not too keen on the idea. Perhaps someone should start an add-on first, and we can go from there?

- implement proper alpha channels

Alpha is already here.

- orthogonalise

See API proposals.

- access to more hardware - gamma ramps, overlay surfaces, etc

Overlays, yes. Gamma ramps, I'm a little reticent. I don't like it when a windowed app hijacks the global gamma settings, and then crashes, leaving the messed-up gamma.

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

Marcello
Member #1,860
January 2002
avatar

You could lock gamma to fullscreen, couldn't you? Or something...

Marcello

Chris Katko
Member #1,881
January 2002
avatar

Quote:

Yeah, ummm, before you go off on a style, learn it first.

I'm well aware of hungarian notation.

ThePointStillStandsThatThisIsn'tAsEasyOnTheEyes
as this_is_when_done_correctly_but_I_guess_should_make_this_one_a_bit_longer_as_to_not_seem_like_I'm_cheating.

And I was also thinking about the typedef idea. But that could add more problems. What if someone codes with the hungarian, and starts working on an already underscore-based one?

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

23yrold3yrold
Member #1,134
March 2001
avatar

That wasn't Hungarian Notation. pstrThis uiIs hbmpHungarian m_pulNotation.

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

Richard Phipps
Member #1,632
November 2001
avatar

Evert
Member #794
November 2000
avatar

What Steve and Bob said.
Allegro currently needs less people volunteering their ideas and preferences and more people actually contributing code.

Chris Katko
Member #1,881
January 2002
avatar

Quote:

That wasn't Hungarian Notation. pstrThis uiIs hbmpHungarian m_pulNotation.

Very true. So why did I write Hungarian...

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

Well, I like the dictatorship idea. As bob said, it's opensource, there's branching, and it's perfectly alright to make mistakes. I think people interested in directing A5 should just start working on it themselves, and then let people decide who they want to work with/help.

How would one start, just writing up which API's are needed, then go into each one and write out the function headers? Seems reasonable to me... There is already a bit of that available, but I haven't looked at the latest stuff myself.

Marcello

Rash
Member #2,374
May 2002
avatar

Obviously, Allego 5 would now have to jump into a niche that was overlooked by SDL in order to actually become used.
TH, any significant shortcomings of SDL?

Thomas Fjellstrom
Member #476
June 2000
avatar

I could be easier to use :) Include most of what it does now, as SDL requires addons for just about everything.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Billybob
Member #3,136
January 2003

d00ds. Get to work >:( Start groking the allegro source, read the todo list and get cracking. Me? Oh...I'm busy finding a web host, maybe I'll start the Allegro 5 forums ;)

Kitty Cat
Member #2,815
October 2002
avatar

Quote:

d00ds. Get to work >:( Start groking the allegro source, read the todo list and get cracking. Me? Oh...I'm busy finding a web host, maybe I'll start the Allegro 5 forums ;)

I'm going as fast as I can with the mixer. >:(:P I just hope when I'm done with it, it's accepted.

PS. What I'd like to see go the most is the DX mixer driver. That thing completely skips out on Allegro's mixer, thus introducing inconsistancies in mixing, and ignores a few of the config options. It's not the audio driver's responsibility to provide virtual voices, and you don't want a game to take up all hardware voices (of which there can be, and usually is, as few as 1).

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

Oscar Giner
Member #2,207
April 2002
avatar

But getting ride of DX mixer will prevent the usage of hardware mixing, won't it? And I think one of the things allegro 5 should do is more hardware acceleration support. I have an old SB128 and it has 32 hardware voices.

Kitty Cat
Member #2,815
October 2002
avatar

Only if you're getting hardware mixing in the first place, which I doubt most people are. It might be possible to make the mixer be instantiated more than once, with some tweaking, so you could take up as many or as few hardware voices as you want. Then you could make each mixer instance have 1 to however many virtual voices.

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

Thomas Harte
Member #33
April 2000
avatar

Quote:

Why drop the timers? I like those

Because I'd have implemented threads, so a special case for timers would be unnecessary. Besides anything else, do you realise just how many magnitudes easier it is to write the equivalent of audiostream code in SDL because it is threaded?

Quote:

Well, I'm not writing any DOS code. If anyone wants DOS support, they'll just have to code it.

But suggested elements of the API have been sucessfully argued against on the grounds that they wouldn't be DOS portable.

Quote:

GUI is not likely to go, since many of the Allegro tools use it.

From which we can also impliedly conclude that modularity is out? Or else, if the GUI is an option then obviously this isn't really worth arguing.

Quote:

Gamma ramps, I'm a little reticent. I don't like it when a windowed app hijacks the global gamma settings

I don't like it when the API designers decide I'm not to be trusted. That's the sort of thing that makes me find an API unafraid to treat me like an adult.

Similarly, I don't like it when I read that other hoary classic 'how do I get fast true colour fades' and watch people replying 'you can't get the hardware to help with that, so it will always be slow'.

Quote:

Well, I like the dictatorship idea.

ahem surprising that a member of allegro.cc would like the idea of a dictatorship.

Quote:

TH, any significant shortcomings of SDL?

Apart from the missing hardware functionality already mentioned (i.e. when not in GL mode, hardware scaling and rotation of ordinary bitmaps), I've always been a little annoyed that the overlay surfaces are dealt with as a separate entity to normal surfaces, with separate functions and so on. I know that some varieties of overlay surface are planar, but I still don't see why that couldn't be part of the normal surface definition.

Also, the out of the box sound support isn't brilliant. It's more or less OSS equivalent - i.e. one 'audiostream' and some mixing functions you can call if you want help - but abstracted into its own thread. This brings us to TF's point about addons though, things like FMOD are not uncommon to link with SDL, and it took me half an hour to hook it up to DUMB. Which is because I hadn't used DUMB before.

Conversely, I've become a big fan of the event based input method, and one of the main reasons I abandoned Allegro was that threads make things so much easier for the type of application I was writing: an emulator. That's why my CPU core can be paused at any cycle where most people's can only be interrupted inbetween any particular instruction, yet does not run significantly slower.

I think the overlay surface topic is one of the things being addressed for SDL 2.0, but don't quote me on that. SDL is pretty much run under the 'dictatorship' model through Sam Latinga if that helps the discussion at all. It helps significantly that SDL is included with most Linux distributions.

Quote:

I'm afraid that I value Thomas Harte's experience and opinion and I think he is right that Allegro is getting badly dated and left behind.

If it helps any, I gave up on GGI and SVGALib (the latter being particularly abhorent - look up the joystick calibration functions if you want a lesson in how not to do it) long before Allegro.

Quote:

I could be easier to use (sic) Include most of what it does now, as SDL requires addons for just about everything.

This is the modularity that people like me advocate. My current project uses the following:

  • SDL

  • SDL_ttf (truetype library for SDL)

  • zlib

And I'm considering libpng. The only complexity that using addon libraries has added to my code is on the commandline sent to the linker, which pulls us back to an earlier subject of this thread - that being easy to use is not the same thing as teaching people how to use their build tools.

By the way: libpng could be significantly nicer also.

nonnus29
Member #2,606
August 2002
avatar

My .02 :

The call to 'modularize allegro' seems to defeat the purpose of an 'all in one game programming library'.

Drop timers. The way threading is used in sdl makes them transparent to user so this is a 'good thing'. A high res timer is definitly the way to go.

I think the goal for any further developement on allegro should be towards making it, Allegro, the new standard. Forget backwards compatibility. If Allegro really is in danger of dieing, why not?

Do something dramatic. Switch rendering to the AllegroGL style 2d in opengl. When you have 5000 rotating, alpha blended sprites on the screen at 500+ fps people will no doubt take notice. The core is already there in the allegrogl driver.

You guys (the dictator?) should figure out exactly what features you want to support and go from there.

Another thing that's needed is a high quality demo or game to show off the new performance. Maybe some of you guys who don't have the low level knowledge to work on the internals could work on that?

But I haven't used allegro in a while so maybe my .02 should actually only count for .005 ;D

Thomas Harte
Member #33
April 2000
avatar

Quote:

The call to 'modularize allegro' seems to defeat the purpose of an 'all in one game programming library'

Two ways of responding - one could argue that the extent to which Allegro is out of fashion due to its design as an 'all in one game programming library' is not to be underestimated, or alternately a challenge: find me one game that uses LBMs. A hint: its a graphic format. It seems to me that the ethos of an 'all in one game programming library' should not be used to justify things that simply aren't needed for games. How many people do you think actually find helpful the entirely control wrestling GUI of the present Allegro for their games?

Quote:

You guys (the dictator?)

A late thought on dictatorship - I remember around version 2.2 of Allegro, Shawn declared that he had perfectly working MOD code, but declined to incorporate it into Allegro because "it would make the code messy". To this day Allegro cannot MOD.

Quote:

Another thing that's needed is a high quality demo or game to show off the new performance.

This is a brilliant idea. Imagine an ideal world where the developers were shadowed by the 'demo game' team, who with a direct interest in an efficient and easy to use library could provide useful empirical API and implementation feedback as library development progressed.

I agree with the majority here, Allegro has long ago been elbowed out of the market in terms of low level stuff (and was never that good at it anyway), so it should probably reposition itself as a game development library bringing the sorts of things 2d game developers want without trying to claim things like the game loop from the programmer as ClanLib does. With that aim it is perfectly acceptable that Allegro be built on top of SDL or whatever.

Quote:

Gamma ramps, I'm a little reticent. I don't like it when a windowed app hijacks the global gamma settings, and then crashes, leaving the messed-up gamma.

Some late thoughts on this. An extension of the same logic means that those working in a window shouldn't be allowed to modify the palette if a hardware palette is in use.

Alternatively, a feature of SDL appeals. It has a 'parachute' which (unless disabled) activates if your program generates an exception and releases as much as it can back to the operating system. Could we not have an Allegro parachute which, if the application crashed restored the gamma ramps to the settings they had when the application started?

An implementation of the latter would certainly defeat any argument with respect to the former about proportions of people likely to be affected.

Bob
Free Market Evangelist
September 2000
avatar

Quote:

An implementation of the latter would certainly defeat any argument with respect to the former about proportions of people likely to be affected.

Agreed.

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



Go to: