Initial commit
A modern .NET 9 NativeAOT framework for Asheron's Call client modding. Self-contained injection system that hooks D3D9 EndScene to render an ImGui overlay inside the AC client process.
This commit is contained in:
commit
80b71d295d
179 changed files with 52858 additions and 0 deletions
45
src/RynthCore.Engine/UI/OverlaySurfaceFrame.cs
Normal file
45
src/RynthCore.Engine/UI/OverlaySurfaceFrame.cs
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
using System;
|
||||
|
||||
namespace RynthCore.Engine.UI;
|
||||
|
||||
internal enum OverlaySurfaceKind
|
||||
{
|
||||
SoftwareBgra32 = 0,
|
||||
AngleSharedTexture = 1,
|
||||
DxgiSharedTexture = 2,
|
||||
D3D9SharedTexture = 3
|
||||
}
|
||||
|
||||
internal readonly record struct OverlaySharedTextureDescriptor(
|
||||
IntPtr SharedHandle,
|
||||
long AdapterLuid,
|
||||
int Width,
|
||||
int Height,
|
||||
int PixelFormat,
|
||||
int RowPitch,
|
||||
int Usage);
|
||||
|
||||
internal sealed class OverlaySurfaceFrame
|
||||
{
|
||||
public OverlaySurfaceFrame(byte[] pixels, int width, int height)
|
||||
{
|
||||
Kind = OverlaySurfaceKind.SoftwareBgra32;
|
||||
SoftwarePixels = pixels;
|
||||
Width = width;
|
||||
Height = height;
|
||||
}
|
||||
|
||||
public OverlaySurfaceFrame(OverlaySurfaceKind kind, OverlaySharedTextureDescriptor sharedTexture)
|
||||
{
|
||||
Kind = kind;
|
||||
SharedTexture = sharedTexture;
|
||||
Width = sharedTexture.Width;
|
||||
Height = sharedTexture.Height;
|
||||
}
|
||||
|
||||
public OverlaySurfaceKind Kind { get; }
|
||||
public byte[]? SoftwarePixels { get; }
|
||||
public OverlaySharedTextureDescriptor? SharedTexture { get; }
|
||||
public int Width { get; }
|
||||
public int Height { get; }
|
||||
}
|
||||
Loading…
Reference in a new issue