/Samples/ExampleToolForm/Program.cs
C# | 53 lines | 38 code | 5 blank | 10 comment | 2 complexity | dc5cf67e5a8b4b3a081039dbf97c2425 MD5 | raw file
Possible License(s): Apache-2.0
- using System;
- using Delta.Engine;
- using Delta.Platforms.Windows;
- using Delta.Utilities.Datatypes;
- using Delta.InputSystem;
- using Delta.Rendering.Basics.Fonts;
- using Delta.Rendering.Basics.Drawing;
-
- namespace Delta.Tools.ExampleToolForm
- {
- /// <summary>
- /// Program, will start the tool.
- /// </summary>
- public static class Program
- {
- #region Main
- /// <summary>
- /// Initializes the ExampleForm and starts the whole editor!
- /// </summary>
- [STAThread]
- static void Main()
- {
- using (ExampleForm form = new ExampleForm())
- {
- // Make sure to use our editor window for the engine.
- WindowsApplication.SetEditorForm(form, form.viewportPanel);
-
- // Add something to render
- Application.BackgroundColor = Color.CornflowerBlue;
-
- float wheelValue = 0.0f;
- // And start the application the normal way (it will show the editor)
- Application.Start(delegate
- {
- // Line from top left up to bottom right in quadratic space
- Line.Draw(new Point(0, 0), new Point(1, 1), Color.Red);
- Font.Default.Draw("Mouse position=" + Input.Mouse.Position,
- ScreenSpace.DrawArea);
-
- float wheelDelta = Input.Mouse.ScrollWheelDelta;
- if (wheelDelta != 0)
- {
- wheelValue += wheelDelta;
- } // if
-
- Font.Default.Draw("Mouse wheelValue= '" + wheelValue + "'",
- Rectangle.FromCenter(new Point(0.5f, 0.65f), Size.Half));
- });
- }
- }
- #endregion
- }
- }