using ComponentFramework;
using ComponentFramework.Modules;

namespace FullScreenShaders.Components.Hosts
{
    [AutoLoad(RunMode.Debug)]
    class DebugAxisHost : Component
    {
        int axisRecord;

        public DebugAxisHost(ICore core) : base(core) { }

        public override void Initialize()
        {
            Screen2DImmediate.Action_RecordStart();

            Screen2DImmediate.Draw_Line3D(0, 0, 0, 10, 0, 0, Globals.RGBA(1, 0, 0, 1));
            Screen2DImmediate.Draw_Line3D(0, 0, 0, 0, 10, 0, Globals.RGBA(0, 1, 0, 1));
            Screen2DImmediate.Draw_Line3D(0, 0, 0, 0, 0, 10, Globals.RGBA(0, 0, 1, 1));

            Screen2DImmediate.Draw_Line3D(0, 0, 0, -10, 0, 0, Globals.RGBA(0.5f, 0, 0, 1));
            Screen2DImmediate.Draw_Line3D(0, 0, 0, 0, -10, 0, Globals.RGBA(0, 0.5f, 0, 1));
            Screen2DImmediate.Draw_Line3D(0, 0, 0, 0, 0, -10, Globals.RGBA(0, 0, 0.5f, 1));

            axisRecord = Screen2DImmediate.Action_RecordEnd();

            base.Initialize();
        }

        public override void PostDraw()
        {
            Screen2DImmediate.Draw_Recorded(axisRecord);
        }

        public override int Order
        {
            get { return 100; }
        }
    }
}
