From: unknown Date: Sat, 21 Aug 2010 13:42:20 +0000 (+0900) Subject: 12313 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;ds=sidebyside;h=c37e9a5c4af3c1917504ba88864ebcd6c536a0d5;p=psychlops%2Fsilverlight.git 12313 --- diff --git a/dev4/PsychlopsSilverlight4.csproj b/dev4/PsychlopsSilverlight4.csproj index 63125e6..62b4e86 100644 --- a/dev4/PsychlopsSilverlight4.csproj +++ b/dev4/PsychlopsSilverlight4.csproj @@ -81,6 +81,7 @@ + diff --git a/dev4/psychlops/core/graphic/canvas.cs b/dev4/psychlops/core/graphic/canvas.cs index 536bf48..c129d82 100644 --- a/dev4/psychlops/core/graphic/canvas.cs +++ b/dev4/psychlops/core/graphic/canvas.cs @@ -637,6 +637,37 @@ namespace Psychlops #endregion + #region compatibitily trick + + public enum Mode { window, fullscreen } + public static readonly Mode window = Mode.window, fullscreen = Mode.fullscreen; + + public Canvas(int wid, int hei, Mode mod) + { + panel = default_panel; + api_canvas = default_api_canvas; + initialize(500, 500); + } + public Canvas(Mode mod) + { + panel = default_panel; + api_canvas = default_api_canvas; + initialize(500, 500); + } + + + public void showFPS(bool sw = true) { } + public void watchFPS(bool sw = true) { } + + + public void clear(double lum) + { + clear(new Color(lum)); + } + + #endregion + + } diff --git a/dev4/psychlops/core/graphic/shape.cs b/dev4/psychlops/core/graphic/shape.cs index 9cebe91..23cbeca 100644 --- a/dev4/psychlops/core/graphic/shape.cs +++ b/dev4/psychlops/core/graphic/shape.cs @@ -19,6 +19,10 @@ namespace Psychlops{ } public static class ShapeExtention { + public static void draw(this Shape drawee, double c) + { + drawee.draw( new Color(c) ); + } public static void draw(this Shape drawee, Color c) { Color tmp_col = drawee.fill; diff --git a/dev4/psychlops/core/math/interval.cs b/dev4/psychlops/core/math/interval.cs index 6426046..0b9a22d 100644 --- a/dev4/psychlops/core/math/interval.cs +++ b/dev4/psychlops/core/math/interval.cs @@ -11,6 +11,11 @@ namespace Psychlops public struct VAL { public double val; public OPERATOR op; + /*public VAL() + { + val = Double.NaN; + op = OPERATOR.CLOSE; + }*/ public VAL(double v, OPERATOR o) { val = v; @@ -23,13 +28,12 @@ namespace Psychlops } public VAL begin, end; - /* - public Interval() + + /*public Interval() { begin = new VAL { val = Double.PositiveInfinity, op = OPERATOR.CLOSE }; end = new VAL { val = Double.NegativeInfinity, op = OPERATOR.CLOSE }; - } - */ + }*/ public Interval(double floor_val, double ceil_val) { begin.val = floor_val; diff --git a/test4/PsychlopsMain.cs b/test4/PsychlopsMain.cs index 5e19dfb..f5df20f 100644 --- a/test4/PsychlopsMain.cs +++ b/test4/PsychlopsMain.cs @@ -1,4 +1,70 @@ -using Psychlops; + +using Psychlops; + +namespace PsychlopsSilverlight4test +{ + + public class PsychlopsMain + { + + Psychlops.Widgets.Slider rect_size; + Psychlops.Widgets.Slider rect_lum; + Psychlops.Widgets.Slider bg_lum; + + + void RectLuminance() + { + Canvas display = new Canvas(Canvas.window); + Interval rng = new Interval(); + rect_size = new Psychlops.Widgets.Slider("Rect Size", 1 < rng < 500, 10.0); + rect_lum = new Psychlops.Widgets.Slider("Rect Luminance", 0.0 <= rng <= 1.0, 0.1); + bg_lum = new Psychlops.Widgets.Slider("BG Luminance", 0.0 <= rng <= 1.0, 0.1); + Ellipse drawee = new Ellipse(100, 100); + display.showFPS(); + display.watchFPS(); + + Rectangle rect = new Rectangle(rect_size, rect_size); + rect.centering(); + + + Clock before = new Clock(), after = new Clock(); + while (!Keyboard.esc.pushed()) + { + Display.clear(bg_lum); + rect.resize(rect_size, rect_size).draw(rect_lum); + after.update(); + display.var((after - before).at_msec(), 100, 100, Color.green); + display.var((after - before).at_msec(), 100, 200, Color.green); + drawee.centering().shift(Math.random(100), 0); + drawee.draw(Color.black); + Display.flip(); + } + + } + + + public void psychlops_main() + { + RectLuminance(); + } + + + } + +} + + + + + + + + + + + +/* + using Psychlops; namespace PsychlopsSilverlight4test { @@ -126,7 +192,7 @@ namespace PsychlopsSilverlight4test } } - +*/ /*using Psychlops;