Beispiel #1
0
        public ChaosDisplay(int pDisplayWidth, int pDisplayHeight)
        {
            //Create a gradient of Dark Grey to White for our colors to start out.
            SuperColor tmpInfiniteColor, tmpGradientStartColor, tmpGradientEndColor;

            tmpInfiniteColor = new SuperColor(0, 0, 0);

            tmpGradientStartColor = new SuperColor(75, 0, 40);
            tmpGradientEndColor   = new SuperColor(0, 202, 243);

            //Instantiate the display box and the event handler for it.
            this._ChaosDisplayBox = new EventBox();
            this._ChaosDisplayBox.ButtonPressEvent   += new ButtonPressEventHandler(this.ChaosDisplayClickEvent);
            this._ChaosDisplayBox.ButtonReleaseEvent += new ButtonReleaseEventHandler(this.ChaosDisplayClickReleaseEvent);
            this._ChaosDisplayBox.MotionNotifyEvent  += new MotionNotifyEventHandler(this.ChaosDisplayMouseMotionEvent);
            this._ChaosDisplayBox.ScrollEvent        += new ScrollEventHandler(this.ChaosDisplayMouseScrolledEvent);

            //The ubiquitous main view.
            this._OutputChaosRenderingMachine           = new ChaosRenderingMachine("MainView", pDisplayWidth, pDisplayHeight, tmpInfiniteColor, tmpGradientStartColor, tmpGradientEndColor, 500);
            this._OutputChaosRenderingMachine.WriteLog += new WriteLogEventHandler(this.ChainedMachineWriteLog);

            //Create a chaos engine list
            this._ChaosEngineList = new ChaosEngineList();

            this.InstantiateEngines();

            //The rendering method
            //Hook up the output machine and the engine with the renderer
            this._ChaosRenderer = new ChaosRenderer(this._OutputChaosRenderingMachine, this._ChaosEngineList.Engine);
            this._ChaosRenderer.RefreshDisplay += new EventHandler(RenderUpdateDisplayEvent);
            this._ChaosRenderer.WriteLog       += new WriteLogEventHandler(ChainedRendererWriteLog);

            this.ResetRenderingMachines();
        }
Beispiel #2
0
        public ChaosRenderer(ChaosRenderingMachine pOutputPort, ChaosEngine pRenderingEngine)
        {
            //Assign the object references for this renderer.
            this._RenderingEngine = pRenderingEngine;
            this._OutputPort      = pOutputPort;

            this._RenderProgressAmount = 0;

            //Default to visual interactive renders
            this._VisualRender = true;
        }