yagl was intended to be a less complex alternative to SDL featuring all a 2d game developer might need. the features of yagl are:
+ crossplatform ( Linux, Windows )
+ 3D Sound module via OpenAL
+ plugable Decoder module to decode various Audio formats ( currently supported: ogg, wav, snd, au, aiff, aifc and a couple of others )
+ 2D Graphics Module via Gfxlib2 by Angelo Mottola ( originally created for use with freebasic http://www.freebasic.net )
+ True Type Fonts via FreeType
+ Input module for keyboard, mouse and multiple joysticks/gamepads again via Gfxlib2 by Angelo Mottola
+ Threading Module featuring a generic Thread class and a Mutex class
+ Networking Module supporting TCP only for now ( udp support is planed in the next version )
+ memory leak detection via debug_new by Wu Yongwei
yagl is still in a very early development stage and a lot of tests have to be written. contributors and testers are more than welcome to join this little project especially if you want to write a c-wrapper around yagl :)
yagl is composed of a couple of modules, each being seperated from the others ( except from Thread and Mutex which are more or less utility classes ). the 3 main modules, sfx, gfx and networking, all share the same principle of having one device representing the hardware via which you can create things, such as bitmap Surfaces, SoundSources or ListeningConnections. you are not allowed to create any of these things yourself but rather let the devices create them for you. the devices manage all these things and guarantee that they will be destroyed at the end of the program or on deinitialization of the specific device. this mechanism was implemented to avoid memory leaks and hogging resources. it might sound scary at first but you will get the hang of it quickly :)
yagl relies on a couple of design patterns, most of all on the singleton design pattern. The sound, graphics, and networking module are all controlled via one singleton, each representing the hardware device for the specific area ( SfxDevice, GfxDevice, NetDevice ). To gain access to these singleton instances, it is suggested to use the proper methods of the namespace Yagl, namely Yagl::getSfxDevice(), Yagl::getGfxDevice() and Yagl::getNetDevice(). these methods can be accessed globally as long as you include Yagl.h into your sourcefile. The namespace Yagl also offers methods to query the input devices, there's no seperate module for handling input in yagl. I'm aware that this is not the cleanest design possible and might be changed in the next release.
in general, you will do this in your application when you use a device:
step 1) initialize the device, e.g. Yagl::getSfxDevice().initialize()
step 2) create objects via the device, e.g. Yagl::SoundSource *soundsource = Yagl::getSfxDevice().createSoundSource( buffer_handle );
step 3) use the created objects, e.g. soundsource->play()
step 4) deinitialize the device, e.g. Yagl::getSfxDevice().deinitialize()
all objects will be invalid after step 4, so be careful. also, given the singleton nature of the devices, their destructor will be called at program exit automatically and thus call the deinitialize method of each device. this guarantees that everything formerly created is destroyed again.
this is the basic principle the library follows.
+ Yagl::GfxDevice
+ Yagl::Surface
+ Yagl::Font
+ Yagl::SfxDevice
+ Yagl::SoundSource
+ Yagl::SoundStream
+ Yagl::NetDevice
+ Yagl::ListeningConnection
+ Yagl::BiDirectionalConnectionReceiver
+ Yagl::BiDirectionalConnection
+ Yagl::MessageReceiver
+ Yagl::Message
note that classes with "Sock" in front of the classname denotes that this is an implementation of the abstract class in berkley sockets. however, when working with the networking module, don't use the SockXXX classnames but the abstract class classnames e.g. instead of SockNetDevice use NetDevice only, instead of SockListeningConnection use ListeningConnection only
1.4.5