Replaced IntX by intX, Basic AssetViewer (can view Textures, kind of)

This commit is contained in:
Simon Lübeß
2023-07-01 00:15:01 +02:00
parent e12fcaacff
commit 77c45db122
37 changed files with 1299 additions and 1688 deletions
@@ -479,7 +479,7 @@ namespace GlitchyEngine.Renderer
return .Ok;
}
public override void CopyTo(RenderTargetGroup destination, int dstTarget, Int2 dstTopLeft, Int2 size, Int2 srcTopLeft, int srcTarget)
public override void CopyTo(RenderTargetGroup destination, int dstTarget, int2 dstTopLeft, int2 size, int2 srcTopLeft, int srcTarget)
{
ID3D11Texture2D* dstTexture = destination.GetNativeTexture(dstTarget);
ID3D11Texture2D* srcTexture = GetNativeTexture(srcTarget);
@@ -19,13 +19,13 @@ namespace GlitchyEngine
//[CLink, CallingConvention(.Stdcall)]
//static extern int16 GetKeyState(int32 keycode);
[CLink, CallingConvention(.Stdcall)]
static extern IntBool GetCursorPos(out Int2 p);
static extern IntBool GetCursorPos(out int2 p);
[CLink, CallingConvention(.Stdcall)]
static extern IntBool SetCursorPos(c_int x, c_int y);
[CLink, CallingConvention(.Stdcall)]
static extern IntBool ScreenToClient(HWnd hWnd, ref Int2 p);
static extern IntBool ScreenToClient(HWnd hWnd, ref int2 p);
[CLink, CallingConvention(.Stdcall)]
static extern IntBool ClientToScreen(HWnd hWnd, ref Int2 p);
static extern IntBool ClientToScreen(HWnd hWnd, ref int2 p);
[Import("user32.lib"), CLink]
public static extern IntBool RegisterRawInputDevices(RAWINPUTDEVICE* pRawInputDevices, uint32 uiNumDevices, uint32 cbSize);
@@ -50,9 +50,9 @@ namespace GlitchyEngine
struct WindowsInputState
{
public int8[256] KeyStates;
public Int2 CursorPosition;
public Int2 CursorPositionDifference;
public Int2 RawCursorMovement;
public int2 CursorPosition;
public int2 CursorPositionDifference;
public int2 RawCursorMovement;
}
static WindowsInputState[2] IputStates;
@@ -157,11 +157,11 @@ namespace GlitchyEngine
public override static bool IsMouseButtonReleasing(MouseButton button) => IsMouseButtonReleased(button) && WasMouseButtonPressed(button);
public override static Int2 GetMousePosition() => CurrentState.CursorPosition;
public override static int2 GetMousePosition() => CurrentState.CursorPosition;
public override static Int2 GetMouseMovement() => CurrentState.CursorPositionDifference;
public override static int2 GetMouseMovement() => CurrentState.CursorPositionDifference;
public override static Int2 GetRawMouseMovement() => CurrentState.RawCursorMovement;
public override static int2 GetRawMouseMovement() => CurrentState.RawCursorMovement;
public override static int32 GetMouseX() => CurrentState.CursorPosition.X;
@@ -182,17 +182,17 @@ namespace GlitchyEngine
return state >= 0;
}
public override static Int2 GetLastMousePosition() => LastState.CursorPosition;
public override static int2 GetLastMousePosition() => LastState.CursorPosition;
public override static Int2 GetLastMouseMovement() => LastState.CursorPositionDifference;
public override static int2 GetLastMouseMovement() => LastState.CursorPositionDifference;
public override static Int2 GetLastRawMouseMovement() => LastState.RawCursorMovement;
public override static int2 GetLastRawMouseMovement() => LastState.RawCursorMovement;
public override static int32 GetLastMouseX() => LastState.CursorPosition.X;
public override static int32 GetLastMouseY() => LastState.CursorPosition.Y;
public override static void SetMousePosition(Int2 pos)
public override static void SetMousePosition(int2 pos)
{
HWnd windowHandle = (HWnd)(int)Application.Get().Window.NativeWindow;
@@ -67,13 +67,13 @@ namespace GlitchyEngine
//
// Size
//
public override Int2 Size
public override int2 Size
{
get => *(Int2*)&_clientRect.Width;
get => *(int2*)&_clientRect.Width;
set
{
*(Int2*)&_clientRect.Width = value;
*(int2*)&_clientRect.Width = value;
ApplyRectangle();
}
}
@@ -103,13 +103,13 @@ namespace GlitchyEngine
//
// Position
//
public override Int2 Position
public override int2 Position
{
get => *(Int2*)&_clientRect;
get => *(int2*)&_clientRect;
set
{
*(Int2*)&_clientRect = value;
*(int2*)&_clientRect = value;
ApplyRectangle();
}
}
@@ -263,7 +263,7 @@ namespace GlitchyEngine
return .Ok;
}
internal Int2 _rawMouseMovementAccumulator;
internal int2 _rawMouseMovementAccumulator;
private static LRESULT MessageHandler(HWND hwnd, uint32 uMsg, WPARAM wParam, LPARAM lParam)
{
@@ -478,7 +478,7 @@ namespace GlitchyEngine
window._eventCallback(event);
// We accumulate the raw movements an collect them once each frame in WindowsInput.Impl_NewFrame()
window._rawMouseMovementAccumulator += Int2(raw.Data.Mouse.lLastX, raw.Data.Mouse.lLastY);
window._rawMouseMovementAccumulator += int2(raw.Data.Mouse.lLastX, raw.Data.Mouse.lLastY);
}
}
}