X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;ds=sidebyside;f=test4%2FMainPage.xaml.cs;fp=test4%2FMainPage.xaml.cs;h=a125451311ae46e74e9bd51ae4ee47673ed55730;hb=08bcb090f6a3e6ee38c712571f24b57a4dd32fb4;hp=0000000000000000000000000000000000000000;hpb=7fe25aa821826f09903fb14def74d6b0376e3b5a;p=psychlops%2Fsilverlight.git diff --git a/test4/MainPage.xaml.cs b/test4/MainPage.xaml.cs new file mode 100644 index 0000000..a125451 --- /dev/null +++ b/test4/MainPage.xaml.cs @@ -0,0 +1,84 @@ +using Psychlops; +using System; +using System.Windows; +using System.Windows.Media; +using System.Windows.Media.Effects; +using System.Windows.Media.Media3D; + + +namespace PsychlopsSilverlight4test +{ + public partial class MainPage : System.Windows.Controls.UserControl + { + //System.Collections.Generic.IEnumerator main_routine; + public System.Windows.Controls.Image master; + public PsychlopsSilverlightApp.PsychlopsMain main; +#if DEBUG + public System.Windows.Controls.TextBlock DebugConsole; +#endif + System.Windows.Controls.Image img; + public MainPage() + { + InitializeComponent(); + // Show fps counter + + Canvas.default_api_canvas = LayoutRoot; + Canvas.default_panel = this; + this.IsTabStop = true; + this.IsEnabled = true; + 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 = false; + //System.Windows.Application.Current.Host.Settings.EnableGPUAcceleration = 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 PsychlopsSilverlightApp.PsychlopsMain(); +// Psychlops.AppState.statusBar. + Psychlops.Internal.Main.routine = new System.Threading.Thread(main.psychlops_main); + Psychlops.Internal.Main.routine.Start(); + //main.initialize(); + //main_routine = main.psychlops_main(); + + Psychlops.Internal.Main.statusBar = AppStatusBar; + Psychlops.Internal.Main.layoutRoot = LayoutRoot; + //Psychlops.Internal.Main.widgetStack = Controller; + AppStatusBar.Text = "Now starting Psychlops environment... please wait a minute"; + + +//eff__ = new Psychlops.Shader.GaborProgram(); +//rect__ = new System.Windows.Shapes.Rectangle(); +//rect__.Width = 200; +//rect__.Height = 200; +//rect__.Effect = eff__; +//rect__.Fill = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Blue); + } + protected void getFocusMouseEnter(object sender, System.Windows.Input.MouseEventArgs e) { + this.Focus(); +//if(!b) { LayoutRoot.Children.Add(rect__); b = true; } + } +//System.Windows.Shapes.Rectangle rect__; +//Psychlops.Shader.GaborProgram eff__; +//bool b = false; + + private void CompositionTarget_Rendering(object sender, System.EventArgs e) + { + //Controller.Children.Clear(); + if (Main.canvas != null) Main.canvas.executeFlip(); + //if (nextIntervalFrame-- <= 0) + //{ + // main_routine.MoveNext(); + // nextIntervalFrame = main_routine.Current; + //} + } + + } + + + +} +