// Geometric Tools, Inc.
// http://www.geometrictools.com
// Copyright (c) 1998-2005.  All Rights Reserved
//
// The Wild Magic Library (WM3) source code is supplied under the terms of
// the license agreement
//     http://www.geometrictools.com/License/WildMagic3License.pdf
// and may not be copied or disclosed except in accordance with the terms
// of that agreement.

#ifndef WM3APPLICATION_H
#define WM3APPLICATION_H

#include "WildMagic3.h"
#include "Wm3Command.h"

namespace Wm3
{

class Application
{
public:
    // abstract base class
    virtual ~Application ();

    // the unique application object
    static Application* TheApplication;

    // the unique command-line arguments object
    static Command* TheCommand;

    // Derived classes must set this function pointer.  The int parameter is
    // the number of command line arguments.  The char** parameter is the
    // array of argument strings.
    typedef int (*EntryPoint)(int, char**);
    static EntryPoint Run;

    // Extra data storage to be used for platform-specific implementations.
    void SetExtraData (int iIndex, int iSize, const void* pvData);
    void GetExtraData (int iIndex, int iSize, void* pvData) const;

    bool LaunchFileDialog () const;

protected:
    Application ();

    // extra data
    enum { APP_EXTRA_DATA_QUANTITY = 128 };
    char m_acExtraData[APP_EXTRA_DATA_QUANTITY];

    // support for file dialogs
    bool m_bLaunchFileDialog;
};

#include "Wm3Application.mcr"

}

#endif



