3 namespace PsychlopsSilverlight3test
\r
5 public partial class MainPage : System.Windows.Controls.UserControl
\r
7 //System.Collections.Generic.IEnumerator<int> main_routine;
\r
8 public System.Windows.Controls.Image master;
\r
9 public PsychlopsMain main;
\r
11 public System.Windows.Controls.TextBlock DebugConsole;
\r
15 InitializeComponent();
\r
18 Canvas.default_api_canvas = LayoutRoot;
\r
19 Canvas.default_panel = this;
\r
20 this.IsTabStop = true;
\r
21 this.IsEnabled = true;
\r
22 this.MouseEnter += getFocusMouseEnter;
\r
23 System.Windows.Application.Current.Host.Settings.MaxFrameRate = 60;
\r
24 System.Windows.Application.Current.Host.Settings.EnableFrameRateCounter = true;
\r
25 System.Windows.Application.Current.Host.Settings.EnableCacheVisualization = false;
\r
26 //<param name="enableGPUAcceleration" value="true"/>
\r
27 System.Windows.Media.CompositionTarget.Rendering += new System.EventHandler(CompositionTarget_Rendering);
\r
28 //main_routine = new System.ComponentModel.BackgroundWorker();
\r
29 //main_routine.DoWork += new System.ComponentModel.DoWorkEventHandler(psychlops_main);
\r
30 //main_routine.RunWorkerAsync();
\r
32 main = new PsychlopsMain();
\r
33 Psychlops.Internal.Main.routine = new System.Threading.Thread(main.psychlops_main);
\r
34 Psychlops.Internal.Main.routine.Start();
\r
35 //main.initialize();
\r
36 //main_routine = main.psychlops_main();
\r
38 Psychlops.Internal.Main.statusBar = AppStatusBar;
\r
39 Psychlops.Internal.Main.widgetStack = Controller;
\r
40 AppStatusBar.Text = System.Windows.Application.Current.Host.Settings.EnableGPUAcceleration.ToString();
\r
42 protected void getFocusMouseEnter(object sender, System.Windows.Input.MouseEventArgs e) {
\r
46 private void CompositionTarget_Rendering(object sender, System.EventArgs e)
\r
48 if (Main.canvas != null) Main.canvas.executeFlip();
\r
49 //if (nextIntervalFrame-- <= 0)
\r
51 // main_routine.MoveNext();
\r
52 // nextIntervalFrame = main_routine.Current;
\r