Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| faaadbf5b1 | |||
| 764b2bff8b | |||
| aaa79d1878 | |||
| f9e374db50 | |||
| 5bcc2d8214 | |||
| 804a3979fd | |||
| d299084db5 |
@@ -74,9 +74,9 @@ namespace Dashboard.BlurgText.OpenGL
|
||||
|
||||
private void UpdateTexture(IntPtr texture, IntPtr buffer, int x, int y, int width, int height)
|
||||
{
|
||||
GL.BindTexture(TextureTarget.Texture2d, (int)texture);
|
||||
GL.TexSubImage2D(TextureTarget.Texture2d, 0, x, y, width, height, OPENGL.PixelFormat.Rgba, PixelType.UnsignedByte, buffer);
|
||||
// GL.TexSubImage2D(TextureTarget.Texture2d, 0, x, y, width, height, OPENGL.PixelFormat.Red, PixelType.Byte, buffer);
|
||||
GL.BindTexture(TextureTarget.Texture2D, (int)texture);
|
||||
GL.TexSubImage2D(TextureTarget.Texture2D, 0, x, y, width, height, OPENGL.PixelFormat.Rgba, PixelType.UnsignedByte, buffer);
|
||||
// GL.TexSubImage2D(TextureTarget.Texture2D, 0, x, y, width, height, OPENGL.PixelFormat.Red, PixelType.Byte, buffer);
|
||||
}
|
||||
|
||||
|
||||
@@ -84,16 +84,16 @@ namespace Dashboard.BlurgText.OpenGL
|
||||
{
|
||||
int texture = GL.GenTexture();
|
||||
|
||||
GL.BindTexture(TextureTarget.Texture2d, texture);
|
||||
GL.TexImage2D(TextureTarget.Texture2d, 0, InternalFormat.Rgba, width, height, 0, OPENGL.PixelFormat.Rgba, PixelType.UnsignedByte, IntPtr.Zero);
|
||||
// GL.TexImage2D(TextureTarget.Texture2d, 0, InternalFormat.R8, width, height, 0, OPENGL.PixelFormat.Red, PixelType.Byte, IntPtr.Zero);
|
||||
GL.BindTexture(TextureTarget.Texture2D, texture);
|
||||
GL.TexImage2D(TextureTarget.Texture2D, 0, InternalFormat.Rgba, width, height, 0, OPENGL.PixelFormat.Rgba, PixelType.UnsignedByte, IntPtr.Zero);
|
||||
// GL.TexImage2D(TextureTarget.Texture2D, 0, InternalFormat.R8, width, height, 0, OPENGL.PixelFormat.Red, PixelType.Byte, IntPtr.Zero);
|
||||
|
||||
GL.TexParameteri(TextureTarget.Texture2d, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear);
|
||||
GL.TexParameteri(TextureTarget.Texture2d, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear);
|
||||
// GL.TexParameteri(TextureTarget.Texture2d, TextureParameterName.TextureSwizzleR, (int)TextureSwizzle.One);
|
||||
// GL.TexParameteri(TextureTarget.Texture2d, TextureParameterName.TextureSwizzleG, (int)TextureSwizzle.One);
|
||||
// GL.TexParameteri(TextureTarget.Texture2d, TextureParameterName.TextureSwizzleB, (int)TextureSwizzle.One);
|
||||
// GL.TexParameteri(TextureTarget.Texture2d, TextureParameterName.TextureSwizzleA, (int)TextureSwizzle.Red);
|
||||
GL.TexParameteri(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear);
|
||||
GL.TexParameteri(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear);
|
||||
// GL.TexParameteri(TextureTarget.Texture2D, TextureParameterName.TextureSwizzleR, (int)TextureSwizzle.One);
|
||||
// GL.TexParameteri(TextureTarget.Texture2D, TextureParameterName.TextureSwizzleG, (int)TextureSwizzle.One);
|
||||
// GL.TexParameteri(TextureTarget.Texture2D, TextureParameterName.TextureSwizzleB, (int)TextureSwizzle.One);
|
||||
// GL.TexParameteri(TextureTarget.Texture2D, TextureParameterName.TextureSwizzleA, (int)TextureSwizzle.Red);
|
||||
|
||||
_textures.Add(texture);
|
||||
|
||||
@@ -191,7 +191,7 @@ namespace Dashboard.BlurgText.OpenGL
|
||||
|
||||
foreach (DrawCall call in drawCalls)
|
||||
{
|
||||
GL.BindTexture(TextureTarget.Texture2d, call.Texture);
|
||||
GL.BindTexture(TextureTarget.Texture2D, call.Texture);
|
||||
GL.Uniform4f(_fillColorLocation, call.FillColor.X, call.FillColor.Y, call.FillColor.Z,
|
||||
call.FillColor.W);
|
||||
GL.DrawElements(PrimitiveType.Triangles, call.Count, DrawElementsType.UnsignedShort, call.Offset);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
@@ -155,6 +155,10 @@ namespace Dashboard.BlurgText
|
||||
protected BlurgFontProxy InternFont(IFont font)
|
||||
{
|
||||
BlurgTextExtension appExtension = Application.ExtensionRequire<BlurgTextExtension>();
|
||||
|
||||
if (font is Font xfont)
|
||||
font = xfont.Base;
|
||||
|
||||
if (font is FontInfo fontInfo)
|
||||
{
|
||||
return (BlurgFontProxy)appExtension.Load(fontInfo);
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="BlurgText" Version="0.1.0-nightly-19" />
|
||||
<PackageReference Include="BlurgText" Version="0.1.0-nightly-33" />
|
||||
<ProjectReference Include="..\Dashboard.Common\Dashboard.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<RootNamespace>Dashboard</RootNamespace>
|
||||
|
||||
@@ -14,11 +14,13 @@ namespace Dashboard.Drawing
|
||||
|
||||
public class ImageBrush(Image image) : Brush
|
||||
{
|
||||
public Image Image { get; set; } = image;
|
||||
public Box2d TextureCoordinates { get; set; } = new Box2d(0, 0, 1, 1);
|
||||
}
|
||||
|
||||
public class NinePatchImageBrush(Image image) : Brush
|
||||
{
|
||||
public Image Image { get; set; } = image;
|
||||
public Box2d CenterCoordinates { get; set; } = new Box2d(0, 0, 1, 1);
|
||||
public Vector4 Extents { get; set; } = Vector4.Zero;
|
||||
}
|
||||
|
||||
@@ -34,25 +34,161 @@ namespace Dashboard.Events
|
||||
|
||||
public enum ScanCode
|
||||
{
|
||||
// TODO: this array is from ReFuel, see if this makes any sense.
|
||||
// This scan code table is based on the Win32 scan code table.
|
||||
// See https://learn.microsoft.com/en-us/windows/win32/inputdev/about-keyboard-input
|
||||
Error = 0xFF,
|
||||
SystemPowerDown = 0xE05E,
|
||||
SystemSleep = 0xE05F,
|
||||
SystemWakeUp = 0xE063,
|
||||
|
||||
Esc, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12,
|
||||
Tilde, _1, _2, _3, _4, _5, _6, _7, _8, _9, _0, Minus, Equals, Backspace,
|
||||
Tab, Q, W, E, R, T, Y, U, I, O, P, LBracket, RBracket, Backslash,
|
||||
CapsLock, A, S, D, F, G, H, J, K, L, Semicolon, Quote, Enter,
|
||||
LShift, Z, X, C, V, B, N, M, Dot, Comma, Slash, RShift,
|
||||
LCtrl, LWin, LAlt, Space, RAlt, RWin, Menu, RCtrl,
|
||||
A = 0x1E,
|
||||
B = 0x30,
|
||||
C = 0x2E,
|
||||
D = 0x20,
|
||||
E = 0x12,
|
||||
F = 0x21,
|
||||
G = 0x22,
|
||||
H = 0x23,
|
||||
I = 0x17,
|
||||
J = 0x24,
|
||||
K = 0x25,
|
||||
L = 0x26,
|
||||
M = 0x32,
|
||||
N = 0x31,
|
||||
O = 0x18,
|
||||
P = 0x19,
|
||||
Q = 0x10,
|
||||
R = 0x13,
|
||||
S = 0x1F,
|
||||
T = 0x14,
|
||||
U = 0x16,
|
||||
V = 0x2F,
|
||||
W = 0x11,
|
||||
X = 0x2D,
|
||||
Y = 0x15,
|
||||
Z = 0x2C,
|
||||
|
||||
PrtSc, ScrollLock, PauseBreak,
|
||||
Insert, Delete, Home, End, PgUp, PgDown,
|
||||
Up, Down, Left, Right,
|
||||
D1 = 0x02,
|
||||
D2 = 0x03,
|
||||
D3 = 0x04,
|
||||
D4 = 0x05,
|
||||
D5 = 0x06,
|
||||
D6 = 0x07,
|
||||
D7 = 0x08,
|
||||
D8 = 0x09,
|
||||
D9 = 0x0A,
|
||||
D0 = 0x0B,
|
||||
|
||||
NumLock, NumDiv, NumMul, NumSub, NumAdd, NumEnter, NumDecimal,
|
||||
Num0, Num1, Num2, Num3, Num4, Num5, Num6, Num7, Num8, Num9,
|
||||
|
||||
IsoB00,
|
||||
|
||||
KeysMax,
|
||||
Return = 0x1C,
|
||||
Esc = 0x01,
|
||||
Delete = 0x0E,
|
||||
Tab = 0x0F,
|
||||
Space = 0x39,
|
||||
Dash = 0x0C,
|
||||
Equals = 0x0D,
|
||||
LBracket = 0x1A,
|
||||
RBracket = 0x1B,
|
||||
Backslash = 0x2B,
|
||||
Semicolon = 0x27,
|
||||
Apostrophe = 0x28,
|
||||
Grave = 0x29,
|
||||
Comma = 0x33,
|
||||
Period = 0x34,
|
||||
ForwardSlash = 0x35,
|
||||
CapsLock = 0x3A,
|
||||
F1 = 0x3B,
|
||||
F2 = 0x3C,
|
||||
F3 = 0x3D,
|
||||
F4 = 0x3E,
|
||||
F5 = 0x3F,
|
||||
F6 = 0x40,
|
||||
F7 = 0x41,
|
||||
F8 = 0x42,
|
||||
F9 = 0x43,
|
||||
F10 = 0x44,
|
||||
F11 = 0x45,
|
||||
F12 = 0x46,
|
||||
PrintScr = 0xE037,
|
||||
ScrollLock = 0x46,
|
||||
Pause = 0xE046,
|
||||
Insert = 0xE052,
|
||||
Home = 0xE047,
|
||||
PageUp = 0xE049,
|
||||
Backspace = 0xE053,
|
||||
End = 0xE04F,
|
||||
PageDown = 0xE051,
|
||||
RightArrow = 0xE04D,
|
||||
LeftArrow = 0xE04B,
|
||||
DownArrow = 0xE050,
|
||||
UpArrow = 0xE048,
|
||||
NumLock = 0xE045,
|
||||
NumDiv = 0xE035,
|
||||
NumMul = 0x37,
|
||||
NumSub = 0x4A,
|
||||
NumAdd = 0x4E,
|
||||
NumEnter = 0xE01C,
|
||||
Num1 = 0x4F,
|
||||
Num2 = 0x50,
|
||||
Num3 = 0x51,
|
||||
Num4 = 0x4B,
|
||||
Num5 = 0x4C,
|
||||
Num6 = 0x4D,
|
||||
Num7 = 0x47,
|
||||
Num8 = 0x48,
|
||||
Num9 = 0x49,
|
||||
Num0 = 0x52,
|
||||
NumDecimal = 0x53,
|
||||
NumBackslash = 0x56,
|
||||
NumEquals = 0x59,
|
||||
Application = 0xE05D,
|
||||
F13 = 0x64,
|
||||
F14 = 0x65,
|
||||
F15 = 0x66,
|
||||
F16 = 0x67,
|
||||
F17 = 0x68,
|
||||
F18 = 0x69,
|
||||
F19 = 0x6A,
|
||||
F20 = 0x6B,
|
||||
F21 = 0x6C,
|
||||
F22 = 0x6D,
|
||||
F23 = 0x6E,
|
||||
F24 = 0x76,
|
||||
NumComma = 0x7E,
|
||||
International1 = 0x73,
|
||||
International2 = 0x70,
|
||||
International3 = 0x7D,
|
||||
International4 = 0x79,
|
||||
International5 = 0x7B,
|
||||
International6 = 0x5C,
|
||||
Lang1 = 0x72,
|
||||
Lang2 = 0x71,
|
||||
Lang3 = 0x78,
|
||||
Lang4 = 0x77,
|
||||
LCtrl = 0x1D,
|
||||
LShift = 0x2A,
|
||||
LWin = 0xE05B,
|
||||
LAlt = 0x38,
|
||||
RAlt = 0xE038,
|
||||
RWin = 0xE05C,
|
||||
RCtrl = 0xE01D,
|
||||
RShift = 0x36,
|
||||
NextTrack = 0xE019,
|
||||
PrevTrack = 0xE010,
|
||||
Stop = 0xE024,
|
||||
PlayPause = 0xE022,
|
||||
VolUp = 0xE030,
|
||||
VolDown = 0xE029,
|
||||
Configuration = 0xE06D,
|
||||
Email = 0xE06C,
|
||||
Calculator = 0xE021,
|
||||
Browser = 0xE06B,
|
||||
Search = 0xE065,
|
||||
HomePage = 0xE032,
|
||||
Back = 0xE06A,
|
||||
Forward = 0xE69,
|
||||
Halt = 0xE068,
|
||||
Refresh = 0xE67,
|
||||
Bookmarks = 0xE066,
|
||||
}
|
||||
|
||||
public class KeyboardButtonEventArgs(KeyCode keyCode, ScanCode scanCode, ModifierKeys modifierKeys, bool up)
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace Dashboard.Pal
|
||||
CancellationToken = token;
|
||||
CancellationToken.Value.Register(() => Quit = true);
|
||||
|
||||
InitializeInternal();
|
||||
Initialize();
|
||||
|
||||
while (!Quit && !token.IsCancellationRequested)
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>disable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>disable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
|
||||
@@ -67,14 +67,14 @@ namespace Dashboard.OpenGL.Drawing
|
||||
_program_image = GL.GetUniformLocation(_program, "image");
|
||||
|
||||
GL.GenTexture(out _white);
|
||||
GL.BindTexture(TextureTarget.Texture2d, _white);
|
||||
GL.TexImage2D(TextureTarget.Texture2d, 0, InternalFormat.Rgb, 1, 1, 0, OpenTK.Graphics.OpenGL.PixelFormat.Rgb, PixelType.Byte, IntPtr.Zero);
|
||||
GL.TexParameteri(TextureTarget.Texture2d, TextureParameterName.TextureSwizzleA, (int)All.One);
|
||||
GL.TexParameteri(TextureTarget.Texture2d, TextureParameterName.TextureSwizzleR, (int)All.One);
|
||||
GL.TexParameteri(TextureTarget.Texture2d, TextureParameterName.TextureSwizzleG, (int)All.One);
|
||||
GL.TexParameteri(TextureTarget.Texture2d, TextureParameterName.TextureSwizzleB, (int)All.One);
|
||||
GL.TexParameteri(TextureTarget.Texture2d, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Nearest);
|
||||
GL.TexParameteri(TextureTarget.Texture2d, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Nearest);
|
||||
GL.BindTexture(TextureTarget.Texture2D, _white);
|
||||
GL.TexImage2D(TextureTarget.Texture2D, 0, InternalFormat.Rgb, 1, 1, 0, OpenTK.Graphics.OpenGL.PixelFormat.Rgb, PixelType.Byte, IntPtr.Zero);
|
||||
GL.TexParameteri(TextureTarget.Texture2D, TextureParameterName.TextureSwizzleA, (int)All.One);
|
||||
GL.TexParameteri(TextureTarget.Texture2D, TextureParameterName.TextureSwizzleR, (int)All.One);
|
||||
GL.TexParameteri(TextureTarget.Texture2D, TextureParameterName.TextureSwizzleG, (int)All.One);
|
||||
GL.TexParameteri(TextureTarget.Texture2D, TextureParameterName.TextureSwizzleB, (int)All.One);
|
||||
GL.TexParameteri(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Nearest);
|
||||
GL.TexParameteri(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Nearest);
|
||||
|
||||
GL.GenVertexArray(out _vao);
|
||||
}
|
||||
@@ -116,7 +116,7 @@ namespace Dashboard.OpenGL.Drawing
|
||||
GL.UseProgram(_program);
|
||||
|
||||
GL.ActiveTexture(TextureUnit.Texture0);
|
||||
GL.BindTexture(TextureTarget.Texture2d, _white);
|
||||
GL.BindTexture(TextureTarget.Texture2D, _white);
|
||||
|
||||
GL.UniformMatrix4f(_program_transforms, 1, true, ref view);
|
||||
GL.Uniform1i(_program_image, 0);
|
||||
@@ -155,7 +155,7 @@ namespace Dashboard.OpenGL.Drawing
|
||||
GL.UseProgram(_program);
|
||||
|
||||
GL.ActiveTexture(TextureUnit.Texture0);
|
||||
GL.BindTexture(TextureTarget.Texture2d, _white);
|
||||
GL.BindTexture(TextureTarget.Texture2D, _white);
|
||||
|
||||
GL.UniformMatrix4f(_program_transforms, 1, true, ref view);
|
||||
GL.Uniform1i(_program_image, 0);
|
||||
@@ -207,7 +207,7 @@ namespace Dashboard.OpenGL.Drawing
|
||||
GL.UseProgram(_program);
|
||||
|
||||
GL.ActiveTexture(TextureUnit.Texture0);
|
||||
GL.BindTexture(TextureTarget.Texture2d, ((GLTexture)texture).Handle);
|
||||
GL.BindTexture(TextureTarget.Texture2D, ((GLTexture)texture).Handle);
|
||||
|
||||
GL.UniformMatrix4f(_program_transforms, 1, true, ref view);
|
||||
GL.Uniform1i(_program_image, 0);
|
||||
|
||||
@@ -79,10 +79,10 @@ namespace Dashboard.OpenGL
|
||||
|
||||
private TextureTarget Target { get; } = type switch
|
||||
{
|
||||
TextureType.Texture1D => TextureTarget.Texture1d,
|
||||
TextureType.Texture2D => TextureTarget.Texture2d,
|
||||
TextureType.Texture3D => TextureTarget.Texture3d,
|
||||
TextureType.Texture2DArray => TextureTarget.Texture2dArray,
|
||||
TextureType.Texture1D => TextureTarget.Texture1D,
|
||||
TextureType.Texture2D => TextureTarget.Texture2D,
|
||||
TextureType.Texture3D => TextureTarget.Texture3D,
|
||||
TextureType.Texture2DArray => TextureTarget.Texture2DArray,
|
||||
TextureType.Texture2DCube => TextureTarget.TextureCubeMap,
|
||||
_ => throw new NotSupportedException()
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace Dashboard.OpenTK.PAL2
|
||||
TK.Window.PostUserEvent(new ApplicationQuitEventArgs());
|
||||
});
|
||||
|
||||
EventQueue.EventRaised += OnEventRaised;
|
||||
Toolkit.Event.EventRaised += OnEventRaised;
|
||||
|
||||
Toolkit.Init(options ?? new ToolkitOptions());
|
||||
}
|
||||
@@ -93,11 +93,11 @@ namespace Dashboard.OpenTK.PAL2
|
||||
}
|
||||
}
|
||||
|
||||
private void OnEventRaised(PalHandle? handle, PlatformEventType type, EventArgs args)
|
||||
private void OnEventRaised(EventArgs args)
|
||||
{
|
||||
if (handle is WindowHandle window)
|
||||
if (args is WindowEventArgs window)
|
||||
{
|
||||
OnWindowEventRaised(window, type, args);
|
||||
OnWindowEventRaised(window.Window, window);
|
||||
return;
|
||||
}
|
||||
else
|
||||
@@ -106,7 +106,7 @@ namespace Dashboard.OpenTK.PAL2
|
||||
}
|
||||
}
|
||||
|
||||
private void OnWindowEventRaised(WindowHandle handle, PlatformEventType type, EventArgs args)
|
||||
private void OnWindowEventRaised(WindowHandle handle, EventArgs args)
|
||||
{
|
||||
if (!_windowHandleWindowMap.TryGetValue(handle, out WindowExtraInfo? info))
|
||||
{
|
||||
@@ -114,7 +114,8 @@ namespace Dashboard.OpenTK.PAL2
|
||||
return;
|
||||
}
|
||||
|
||||
switch (type)
|
||||
// TODO: fix this.
|
||||
switch (PlatformEventType.UserMessage)
|
||||
{
|
||||
case PlatformEventType.UserMessage:
|
||||
if (args is ApplicationQuitEventArgs)
|
||||
@@ -228,7 +229,7 @@ namespace Dashboard.OpenTK.PAL2
|
||||
}
|
||||
|
||||
default:
|
||||
Debugger?.LogDebug($"Unknown event type {type} with \"{args}\".");
|
||||
Debugger?.LogDebug($"Unknown event type {args.GetType().Name} with \"{args}\".");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -286,6 +287,7 @@ namespace Dashboard.OpenTK.PAL2
|
||||
Scancode.F => ScanCode.F,
|
||||
Scancode.G => ScanCode.G,
|
||||
Scancode.H => ScanCode.H,
|
||||
Scancode.I => ScanCode.I,
|
||||
Scancode.J => ScanCode.J,
|
||||
Scancode.K => ScanCode.K,
|
||||
Scancode.L => ScanCode.L,
|
||||
@@ -303,20 +305,20 @@ namespace Dashboard.OpenTK.PAL2
|
||||
Scancode.X => ScanCode.X,
|
||||
Scancode.Y => ScanCode.Y,
|
||||
Scancode.Z => ScanCode.Z,
|
||||
Scancode.D0 => ScanCode._0,
|
||||
Scancode.D1 => ScanCode._1,
|
||||
Scancode.D2 => ScanCode._2,
|
||||
Scancode.D3 => ScanCode._3,
|
||||
Scancode.D4 => ScanCode._4,
|
||||
Scancode.D5 => ScanCode._5,
|
||||
Scancode.D6 => ScanCode._6,
|
||||
Scancode.D7 => ScanCode._7,
|
||||
Scancode.D8 => ScanCode._8,
|
||||
Scancode.D9 => ScanCode._9,
|
||||
Scancode.UpArrow => ScanCode.Up,
|
||||
Scancode.DownArrow => ScanCode.Down,
|
||||
Scancode.LeftArrow => ScanCode.Left,
|
||||
Scancode.RightArrow => ScanCode.Right,
|
||||
Scancode.D0 => ScanCode.D0,
|
||||
Scancode.D1 => ScanCode.D1,
|
||||
Scancode.D2 => ScanCode.D2,
|
||||
Scancode.D3 => ScanCode.D3,
|
||||
Scancode.D4 => ScanCode.D4,
|
||||
Scancode.D5 => ScanCode.D5,
|
||||
Scancode.D6 => ScanCode.D6,
|
||||
Scancode.D7 => ScanCode.D7,
|
||||
Scancode.D8 => ScanCode.D8,
|
||||
Scancode.D9 => ScanCode.D9,
|
||||
Scancode.UpArrow => ScanCode.UpArrow,
|
||||
Scancode.DownArrow => ScanCode.DownArrow,
|
||||
Scancode.LeftArrow => ScanCode.LeftArrow,
|
||||
Scancode.RightArrow => ScanCode.RightArrow,
|
||||
_ => (ScanCode)0,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>disable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
Reference in New Issue
Block a user