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