//////////////////
// image viewer //
//////////////////
#include "ptc.h"






int main(int argc,char *argv[])
{
    // initialize from command line
    PTC ptc(320,200,argc,argv);
    if (!ptc.ok())
    {
        // fallback to fuzzy32
        if (!ptc.Init(320,200))
        {
            // failure
            ptc.Close();
            cout << "could not initialize ptc\n";
            return 1;
        }
    }
    
    // load image
    Surface surface(ptc,"image.tga");
    if (!surface.ok())
    {
        ptc.Close();
        cout << "could not load image\n";
        return 1;
    }

    // convert image
    if (!surface.Convert(ARGB8888))
    {
        // failure
        ptc.Close();
        cout << "could not convert image\n";
        return 1;
    }

    // display image
    surface.Update();
    while (!ptc.kbhit());
    return 0;
}
