//BSD License  
//DXGfx® - http://www.eteractions.com
//Copyright (c) 2005
//by Guillaume Randon
//Permission is hereby granted, free of charge, to any person obtaining a copy of this software
//and associated documentation files (the "Software"), to deal in the Software without restriction,
//including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
//and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
//subject to the following conditions:
//The above copyright notice and this permission notice shall be included in all copies or substantial
//portions of the Software.
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
//INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 
//AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 
//DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using System.Drawing;
using Microsoft.DirectX;
using Microsoft.DirectX.Direct3D;
using Microsoft.Samples.DirectX.UtilityToolkit;

namespace DXGfxLib
{
    /// <summary>
    /// This interface should be implemented  by all classes that want the ability to be drawn. It derives from IComparable as
    /// we want the ability to sort these objects before rendering in order to minimize state changes for the video card and
    /// unecessary loading and unloading of effects.
    /// </summary>
    public interface IDrawable : IComparable
    {
        /// <summary>
        /// Each class that need to be drawn should have an associatedEffectGroup.
        /// </summary>
        EffectGroup AssociatedEffectGroup { get; set;}

        /// <summary>
        /// Some time it might be desirable not to show an object even if it is in the frustrum.
        /// </summary>
        bool Hide { get; set;}

        /// <summary>
        /// Each class that want to draw on screen certainly want to have some control over what will be drawn, this is done through
        /// this method.
        /// </summary>
        /// <param name="device"></param>
        void Draw(Microsoft.DirectX.Direct3D.Device device);

        /// <summary>
        /// Classes that want to draw on screen might need to set some values for the effect used to draw them. That is the purpose
        /// of this method. Technically this could be done in Draw but I prefered to have to separated methods.
        /// </summary>
        /// <param name="d3ddevice"></param>
        /// <param name="eff"></param>
        /// <param name="pass"></param>
        void SetEffectsValues(Device d3ddevice, Effect eff, int pass);
    }
}
