/// <summary> /// /// </summary> public override void Unbind() { WinGLCanvas winCanvas = this.BindingCanvas; if (winCanvas != null) { winCanvas.MouseMove -= mouseMove; winCanvas.MouseDown -= mouseDown; winCanvas.MouseUp -= mouseUp; winCanvas.KeyDown -= keyDown; winCanvas.KeyUp -= keyUp; this.BindingCanvas = null; } }
/// <summary> /// /// </summary> /// <param name="canvas"></param> public override void Bind(IGLCanvas canvas) { var winCanvas = canvas as WinGLCanvas; if (winCanvas == null) { throw new ArgumentException(); } winCanvas.MouseMove += mouseMove; winCanvas.MouseDown += mouseDown; winCanvas.MouseUp += mouseUp; winCanvas.KeyDown += keyDown; winCanvas.KeyUp += keyUp; winCanvas.Resize += resize; this.BindingCanvas = winCanvas; }
public DesignModeAssist(WinGLCanvas canvas, bool designMode, System.ComponentModel.LicenseUsageMode licenseUsageMode) { var camera = new Camera(new vec3(0, 0, 4), new vec3(0, 0, 0), new vec3(0, 1, 0), CameraType.Perspecitive, canvas.Width, canvas.Height); GroupNode group; { group = new GroupNode(); if (designMode) { var propeller = new PropellerRenderer() { WorldPosition = new vec3(0, -1.5f, 0) }; group.Children.Add(propeller); } if (licenseUsageMode == System.ComponentModel.LicenseUsageMode.Designtime) { var clock = new ClockNode(); group.Children.Add(clock); } } var scene = new Scene(camera) { ClearColor = Color.Black.ToVec4(), RootNode = group, }; this.scene = scene; var list = new ActionList(); var transformAction = new TransformAction(scene); list.Add(transformAction); var renderAction = new RenderAction(scene); list.Add(renderAction); this.actionList = list; this.fullname = canvas.GetType().FullName; }
public DesignModeAssist(WinGLCanvas canvas) : this(canvas, true, System.ComponentModel.LicenseUsageMode.Designtime) { }