stefkos,
Quote:
I see only one problem to port it, boost library...of course this could be trivial thing. We will see later...
This seems fairly trivial. It's all in a couple of C++ classes which handle SDL. At the moment the only Boost header I'm using is:
Code:
#include <boost/unordered_map.hpp>
This is also included with C++11, although I'm currently using the Boost version. If C++11 or Boost are not available, I could fall back to a deprecated type such as hash_map...
The above is used with SDL code as follows:
Code:
// Hash table for images:
boost::unordered_map<std::string, SDL_Surface*> images;
// Hash table for sounds:
boost::unordered_map<std::string, Mix_Chunk*> sounds;
Data is inserted like this:
Code:
// Add the optimised image to the hash table:
images.insert(make_pair<string, SDL_Surface*>("screen0", optimisedImage));
string name = ..........
// Add the sound sample to the hash table:
sounds.insert(make_pair<string, Mix_Chunk*>(name, loadedSound));
And accessed like this:
Code:
string a = ........
// Blit the new image to the screen:
SDL_Rect offset;
offset.x = 0; offset.y = 0;
SDL_BlitSurface(images[a], NULL, images["screen0"], &offset);
// Play the sound effect:
Mix_PlayChannel(-1, sounds["Boom"], 0);
Now for another technical question: Hardware graphics acceleration (not yet implemented in XAMOS but planned). I could port an unaccelerated SDL version, however for best results I would require something like OpenGL. Is MorphOS's TinyGL implementation able to handle SDL OpenGL calls? Something like this would be required to get smooth scrolling on MorphOS.
[ Edited by Mequa 31.05.2012 - 15:38 ]