2 using System.Collections.Generic;
\r
4 using System.Windows;
\r
5 using System.Windows.Media;
\r
6 using System.Windows.Media.Effects;
\r
7 using System.Windows.Media.Media3D;
\r
12 namespace PsychlopsSilverlight5test
\r
15 public partial class MainPage : System.Windows.Controls.UserControl
\r
17 //System.Collections.Generic.IEnumerator<int> main_routine;
\r
18 public System.Windows.Controls.Image master;
\r
19 public PsychlopsSilverlightApp.PsychlopsMain main;
\r
21 public System.Windows.Controls.TextBlock DebugConsole;
\r
23 System.Windows.Controls.Image img;
\r
26 InitializeComponent();
\r
29 Canvas.default_api_canvas = LayoutRoot;
\r
30 Canvas.default_panel = this;
\r
31 this.IsTabStop = true;
\r
32 this.IsEnabled = true;
\r
33 this.MouseEnter += getFocusMouseEnter;
\r
34 System.Windows.Application.Current.Host.Settings.MaxFrameRate = 60;
\r
35 System.Windows.Application.Current.Host.Settings.EnableFrameRateCounter = true;
\r
36 System.Windows.Application.Current.Host.Settings.EnableCacheVisualization = false;
\r
37 //System.Windows.Application.Current.Host.Settings.EnableGPUAcceleration = false;
\r
38 //<param name="enableGPUAcceleration" value="true"/>
\r
39 System.Windows.Media.CompositionTarget.Rendering += new System.EventHandler(CompositionTarget_Rendering);
\r
40 //main_routine = new System.ComponentModel.BackgroundWorker();
\r
41 //main_routine.DoWork += new System.ComponentModel.DoWorkEventHandler(psychlops_main);
\r
42 //main_routine.RunWorkerAsync();
\r
44 main = new PsychlopsSilverlightApp.PsychlopsMain();
\r
45 // Psychlops.AppState.statusBar.
\r
46 Psychlops.Internal.Main.routine = new System.Threading.Thread(main.psychlops_main);
\r
47 Psychlops.Internal.Main.routine.Start();
\r
48 //main.initialize();
\r
49 //main_routine = main.psychlops_main();
\r
51 Psychlops.Internal.Main.statusBar = AppStatusBar;
\r
52 Psychlops.Internal.Main.layoutRoot = LayoutRoot;
\r
53 //Psychlops.Internal.Main.widgetStack = Controller;
\r
54 AppStatusBar.Text = "Now starting Psychlops environment... please wait a minute";
\r
57 //eff__ = new Psychlops.Shader.GaborProgram();
\r
58 //rect__ = new System.Windows.Shapes.Rectangle();
\r
59 //rect__.Width = 200;
\r
60 //rect__.Height = 200;
\r
61 //rect__.Effect = eff__;
\r
62 //rect__.Fill = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Blue);
\r
64 protected void getFocusMouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
\r
67 //if(!b) { LayoutRoot.Children.Add(rect__); b = true; }
\r
69 //System.Windows.Shapes.Rectangle rect__;
\r
70 //Psychlops.Shader.GaborProgram eff__;
\r
73 private void CompositionTarget_Rendering(object sender, System.EventArgs e)
\r
75 //Controller.Children.Clear();
\r
76 if (Main.canvas != null) Main.canvas.executeFlip();
\r
77 //if (nextIntervalFrame-- <= 0)
\r
79 // main_routine.MoveNext();
\r
80 // nextIntervalFrame = main_routine.Current;
\r