X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=test3%2FMainPage.xaml.cs;h=7aa4b92e753551fe4e05e67d5f02a0a982e3d361;hb=e05ab8e68d381f8f5c9a2ddb7c63b89a7bb6371a;hp=dcfdd2d69030792b06e92990144c5fd7e3f680fd;hpb=9c897bc043b3992b4c8907518f76e65140a4cbaa;p=psychlops%2Fsilverlight.git diff --git a/test3/MainPage.xaml.cs b/test3/MainPage.xaml.cs index dcfdd2d..7aa4b92 100644 --- a/test3/MainPage.xaml.cs +++ b/test3/MainPage.xaml.cs @@ -4,7 +4,7 @@ namespace PsychlopsSilverlight3test { public partial class MainPage : System.Windows.Controls.UserControl { - System.Collections.Generic.IEnumerator main_routine; + //System.Collections.Generic.IEnumerator main_routine; public System.Windows.Controls.Image master; public PsychlopsMain main; #if DEBUG @@ -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,35 +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_routine = new System.Threading.Thread(ThreadTest2); - //main_routine.Start(); - main_routine = main.psychlops_main(); -#if DEBUG - DebugConsole = new System.Windows.Controls.TextBlock(); - TotalRoot.Children.Add(DebugConsole); -#endif + //main_routine = main.psychlops_main(); + + 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) { - nextIntervalFrame--; - if (nextIntervalFrame<=0) - { - main_routine.MoveNext(); - nextIntervalFrame = main_routine.Current; - } + if (Main.canvas != null) Main.canvas.executeFlip(); + //if (nextIntervalFrame-- <= 0) + //{ + // main_routine.MoveNext(); + // nextIntervalFrame = main_routine.Current; + //} } }