/*
 * Fire - a sample program for the XGame library
 * Copyright (C) 1997 by Thomas Bonk (thomas@ghecko.saar.de).
 * All rights reserved.
 * Fire.hpp - class declarations
 */
#if !defined( __FIRE_HPP__ )
#define __FIRE_HPP__

#include <stdlib.h>
#include <xheaders.h>
#include XResource_i
#include XApplication_i
#include XThread_i
#include XBlitter_i
#include XBlitterWindow_i
#include XGameException_i
#include XVirtualScreen_i
#include XPalette_i


class FlameThread : public XThread
{
        private:
                XBlitter* pBlitter;
                XPalette* pPal;
                PBYTE     pBuffer;

                void PrepPal( void );
                void ScrollUp( void );
                void NewLine( void );

        public:
                // ctor
                FlameThread( XBlitter* pblt ) : pBlitter( pblt ), XThread() {}

                void Init( void );
};


class FlameWindow : public XBlitterWindow
{
        public:
                FlameWindow( const XResource * resource,
                             const char * title,
                                   XBlitter* pBlitter,
                             const ULONG     blitting,
                             const ULONG createstyle = defaultStyle,
                             const XRect * rec = NULL                ) : XBlitterWindow( resource, title, pBlitter, blitting, createstyle, rec ) {}

                virtual void Activate( void ) {}
                virtual void Deactivate( void ) {}
};


class FlameApp : public XApplication
{
        private:
                XVirtualScreen* pScreen;
                XBlitter*       pBlitter;
                FlameWindow*    pWindow;
                FlameThread*    pThread;

        public:
                // ctor/dtor
                         FlameApp( void );
                virtual ~FlameApp();
};

#endif
