X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=test3%2FMainPage.xaml.cs;h=7aa4b92e753551fe4e05e67d5f02a0a982e3d361;hb=e05ab8e68d381f8f5c9a2ddb7c63b89a7bb6371a;hp=f2d896041f0db98bb14dcb2b2760c4c5358f3cc4;hpb=2d76f63033cd4044624e9fcf1330389f515d9c8c;p=psychlops%2Fsilverlight.git diff --git a/test3/MainPage.xaml.cs b/test3/MainPage.xaml.cs index f2d8960..7aa4b92 100644 --- a/test3/MainPage.xaml.cs +++ b/test3/MainPage.xaml.cs @@ -14,7 +14,7 @@ namespace PsychlopsSilverlight3test { InitializeComponent(); // Show fps counter - //Canvas.default_buffer_frame = main_buffer; + Canvas.default_api_canvas = LayoutRoot; Canvas.default_panel = this; this.IsTabStop = true; @@ -22,38 +22,35 @@ namespace PsychlopsSilverlight3test this.MouseEnter += getFocusMouseEnter; System.Windows.Application.Current.Host.Settings.MaxFrameRate = 60; System.Windows.Application.Current.Host.Settings.EnableFrameRateCounter = true; - System.Windows.Application.Current.Host.Settings.EnableCacheVisualization = true; + System.Windows.Application.Current.Host.Settings.EnableCacheVisualization = false; + // System.Windows.Media.CompositionTarget.Rendering += new System.EventHandler(CompositionTarget_Rendering); //main_routine = new System.ComponentModel.BackgroundWorker(); //main_routine.DoWork += new System.ComponentModel.DoWorkEventHandler(psychlops_main); //main_routine.RunWorkerAsync(); main = new PsychlopsMain(); + Psychlops.Internal.Main.routine = new System.Threading.Thread(main.psychlops_main); + Psychlops.Internal.Main.routine.Start(); //main.initialize(); - Main.flag = new System.Threading.AutoResetEvent(false); - Main.routine = new System.Threading.Thread(main.psychlops_main); - Main.routine.Start(); //main_routine = main.psychlops_main(); -#if DEBUG - DebugConsole = new System.Windows.Controls.TextBlock(); - TotalRoot.Children.Add(DebugConsole); -#endif + + Psychlops.Internal.Main.statusBar = AppStatusBar; + Psychlops.Internal.Main.widgetStack = Controller; + AppStatusBar.Text = System.Windows.Application.Current.Host.Settings.EnableGPUAcceleration.ToString(); } protected void getFocusMouseEnter(object sender, System.Windows.Input.MouseEventArgs e) { this.Focus(); } - int nextIntervalFrame = 1; private void CompositionTarget_Rendering(object sender, System.EventArgs e) { if (Main.canvas != null) Main.canvas.executeFlip(); - Main.flag.Set(); - nextIntervalFrame--; - if (nextIntervalFrame<=0) - { - //main_routine.MoveNext(); - //nextIntervalFrame = main_routine.Current; - } + //if (nextIntervalFrame-- <= 0) + //{ + // main_routine.MoveNext(); + // nextIntervalFrame = main_routine.Current; + //} } }