<Compile Include="psychlops\core\math\interval.cs" />\r
<Compile Include="psychlops\core\math\matrix.cs" />\r
<Compile Include="psychlops\core\math\util.cs" />\r
+ <Compile Include="psychlops\extention\compatibility\compatibility.cs" />\r
<Compile Include="psychlops\extention\experiments\experiments.cs" />\r
<Compile Include="psychlops\extention\math\BigFloat.cs" />\r
<Compile Include="psychlops\extention\math\BigInt.cs" />\r
#endregion\r
\r
\r
+ #region compatibitily trick\r
+\r
+ public enum Mode { window, fullscreen }\r
+ public static readonly Mode window = Mode.window, fullscreen = Mode.fullscreen;\r
+\r
+ public Canvas(int wid, int hei, Mode mod)\r
+ {\r
+ panel = default_panel;\r
+ api_canvas = default_api_canvas;\r
+ initialize(500, 500);\r
+ }\r
+ public Canvas(Mode mod)\r
+ {\r
+ panel = default_panel;\r
+ api_canvas = default_api_canvas;\r
+ initialize(500, 500);\r
+ }\r
+\r
+\r
+ public void showFPS(bool sw = true) { }\r
+ public void watchFPS(bool sw = true) { }\r
+\r
+\r
+ public void clear(double lum)\r
+ {\r
+ clear(new Color(lum));\r
+ }\r
+\r
+ #endregion\r
+\r
+\r
}\r
\r
\r
}\r
public static class ShapeExtention\r
{\r
+ public static void draw(this Shape drawee, double c)\r
+ {\r
+ drawee.draw( new Color(c) );\r
+ }\r
public static void draw(this Shape drawee, Color c)\r
{\r
Color tmp_col = drawee.fill;\r
public struct VAL {\r
public double val;\r
public OPERATOR op;\r
+ /*public VAL()\r
+ {\r
+ val = Double.NaN;\r
+ op = OPERATOR.CLOSE;\r
+ }*/\r
public VAL(double v, OPERATOR o)\r
{\r
val = v;\r
}\r
public VAL begin, end;\r
\r
- /*\r
- public Interval()\r
+ \r
+ /*public Interval()\r
{\r
begin = new VAL { val = Double.PositiveInfinity, op = OPERATOR.CLOSE };\r
end = new VAL { val = Double.NegativeInfinity, op = OPERATOR.CLOSE };\r
- }\r
- */\r
+ }*/\r
public Interval(double floor_val, double ceil_val)\r
{\r
begin.val = floor_val;\r
-using Psychlops;\r
+\r
+using Psychlops;\r
+\r
+namespace PsychlopsSilverlight4test\r
+{\r
+\r
+ public class PsychlopsMain\r
+ {\r
+\r
+ Psychlops.Widgets.Slider rect_size;\r
+ Psychlops.Widgets.Slider rect_lum;\r
+ Psychlops.Widgets.Slider bg_lum;\r
+\r
+\r
+ void RectLuminance()\r
+ {\r
+ Canvas display = new Canvas(Canvas.window);\r
+ Interval rng = new Interval();\r
+ rect_size = new Psychlops.Widgets.Slider("Rect Size", 1 < rng < 500, 10.0);\r
+ rect_lum = new Psychlops.Widgets.Slider("Rect Luminance", 0.0 <= rng <= 1.0, 0.1);\r
+ bg_lum = new Psychlops.Widgets.Slider("BG Luminance", 0.0 <= rng <= 1.0, 0.1);\r
+ Ellipse drawee = new Ellipse(100, 100);\r
+ display.showFPS();\r
+ display.watchFPS();\r
+\r
+ Rectangle rect = new Rectangle(rect_size, rect_size);\r
+ rect.centering();\r
+\r
+\r
+ Clock before = new Clock(), after = new Clock();\r
+ while (!Keyboard.esc.pushed())\r
+ {\r
+ Display.clear(bg_lum);\r
+ rect.resize(rect_size, rect_size).draw(rect_lum);\r
+ after.update();\r
+ display.var((after - before).at_msec(), 100, 100, Color.green);\r
+ display.var((after - before).at_msec(), 100, 200, Color.green);\r
+ drawee.centering().shift(Math.random(100), 0);\r
+ drawee.draw(Color.black);\r
+ Display.flip();\r
+ }\r
+\r
+ }\r
+\r
+\r
+ public void psychlops_main()\r
+ {\r
+ RectLuminance();\r
+ }\r
+\r
+\r
+ }\r
+\r
+}\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+/*\r
+ using Psychlops;\r
\r
namespace PsychlopsSilverlight4test\r
{\r
}\r
\r
}\r
-\r
+*/\r
\r
\r
/*using Psychlops;\r