using MTV3D65;
using System.Windows.Forms;
using System;
using System.IO;

namespace ComponentFramework
{
    /// <summary>
    /// The engine initialization settings.
    /// The whole structure does not have to be filled, but certain illegal combinations will
    /// cause exceptions to be raised.
    /// </summary>
    public class EngineSettings
    {
        /// <summary>
        /// Public parameterless constructor.
        /// Use properties for construction settings.
        /// </summary>
        public EngineSettings()
        {
            DebugFile = new FileInfo(Application.StartupPath + @"\Debug.txt");
        }

        /// <summary>
        /// Internal copy constructor.
        /// </summary>
        /// <param name="source"></param>
        internal EngineSettings(EngineSettings source)
        {
            MultiThreading = source.MultiThreading;
            DebugFile = source.DebugFile;
            WindowedForm = source.WindowedForm;
            WindowedHandle = source.WindowedHandle;
            Fullscreen = source.Fullscreen;
            FullscreenMode = source.FullscreenMode;
            VSync = source.VSync;
            MultisampleType = source.MultisampleType;
        }

        /// <summary>
        /// Whether multi-threading mode of the TV3D engine is used.
        /// </summary>
        public bool MultiThreading { get; set; }

        /// <summary>
        /// The debug file location, Debug.txt in the application startup path as default.
        /// </summary>
        public FileInfo DebugFile { get; set; }

        /// <summary>
        /// The windowed form, if application does not use <see cref="Fullscreen"/> mode.
        /// </summary>
        public Form WindowedForm { get; set; }

        /// <summary>
        /// The windowed render target handle, if application does not use <see cref="Fullscreen"/> mode.
        /// </summary>
        public IntPtr WindowedHandle { get; set; }

        /// <summary>
        /// Whether fullscreen mode is used.
        /// </summary>
        public bool Fullscreen { get; set; }

        /// <summary>
        /// The fullscreen mode format.
        /// </summary>
        public TV_MODEFORMAT FullscreenMode { get; set; }

        /// <summary>
        /// Whether vertical synchronization is used.
        /// </summary>
        public bool VSync { get; set; }

        /// <summary>
        /// The multisampling (FSAA) type used, <see cref="CONST_TV_MULTISAMPLE_TYPE.TV_MULTISAMPLE_NONE"/> if none is wanted.
        /// </summary>
        public CONST_TV_MULTISAMPLE_TYPE MultisampleType { get; set; }
    }
}