smrendererv3/SMCode/SM.Base/Controls/Mouse.cs
Michel Fedde 03b3942732 Holidays 12.10. -> 25.10.2020
~ Moved code around in files.

SM.Base:
+ PostProcessing-system
+ OnInitialization() for Scenes.
+ Shader-Extensions
+ Added option to not react while unfocused to the window.
+ Added Screenshots to the window.
+ Connected the log system to the SM.OGL-action system.

~ Replaced IShader with abstract MaterialShader.
~ When a log compression folder doesn't exist, it will create one.

SM.OGL:
+ Added support for UniformArrays
+ Added ShaderPreProcessing
+ Added Shader Extensions.
+ Added Debug actions.
+ SM.OGL settings

~ Framebuffer Size is automaticly changed, when the window and scale is set.

SM2D:
+ Added easy shader drawing.
2020-10-24 15:10:36 +02:00

51 lines
No EOL
1.4 KiB
C#

#region usings
using OpenTK;
using OpenTK.Input;
#endregion
namespace SM.Base.Controls
{
/// <summary>
/// Mouse controller
/// </summary>
/// <typeparam name="TWindow">The type of window this controller is connected to.</typeparam>
public class Mouse<TWindow>
where TWindow : GenericWindow
{
/// <summary>
/// The window it is connected to.
/// </summary>
protected TWindow _window;
/// <summary>
/// The constructor
/// </summary>
/// <param name="window">The window, its listen to.</param>
protected internal Mouse(TWindow window)
{
_window = window;
}
/// <summary>
/// The current position of the mouse in the screen.
/// </summary>
public Vector2 InScreen { get; private set; }
/// <summary>
/// The current position of the mouse in the screen from 0..1.
/// </summary>
public Vector2 InScreenNormalized { get; private set; }
/// <summary>
/// The event to update the values.
/// </summary>
/// <param name="mmea">The event args.</param>
protected void MouseMoveEvent(MouseMoveEventArgs mmea)
{
InScreen = new Vector2(mmea.X, mmea.Y);
InScreenNormalized = new Vector2(mmea.X / (float) _window.Width, mmea.Y / (float) _window.Height);
}
}
}