mirror of
https://github.com/maxartz15/MoonWorksDearImGuiScaffold.git
synced 2024-11-12 19:05:30 +01:00
testing d3d11
This commit is contained in:
parent
b34d1444e7
commit
de2e6dd3b8
@ -23,6 +23,7 @@ class MoonWorksDearImGuiScaffoldGame : Game
|
||||
private GpuBuffer ImGuiIndexBuffer = null;
|
||||
|
||||
private TextureStorage TextureStorage;
|
||||
private Texture FontTexture;
|
||||
|
||||
private ResourceUploader ResourceUploader;
|
||||
|
||||
@ -152,13 +153,12 @@ class MoonWorksDearImGuiScaffoldGame : Game
|
||||
var io = ImGui.GetIO();
|
||||
var drawDataPtr = ImGui.GetDrawData();
|
||||
|
||||
UpdateImGuiBuffers(drawDataPtr);
|
||||
|
||||
var commandBuffer = GraphicsDevice.AcquireCommandBuffer();
|
||||
var swapchainTexture = commandBuffer.AcquireSwapchainTexture(MainWindow);
|
||||
|
||||
if (swapchainTexture != null)
|
||||
{
|
||||
UpdateImGuiBuffers(drawDataPtr);
|
||||
RenderCommandLists(commandBuffer, swapchainTexture, drawDataPtr, io);
|
||||
}
|
||||
|
||||
@ -302,7 +302,7 @@ class MoonWorksDearImGuiScaffoldGame : Game
|
||||
out int bytesPerPixel
|
||||
);
|
||||
|
||||
var fontTexture = resourceUploader.CreateTexture2D(
|
||||
FontTexture = resourceUploader.CreateTexture2D(
|
||||
new Span<byte>((void*) pixelData, width * height * bytesPerPixel),
|
||||
(uint) width,
|
||||
(uint) height
|
||||
@ -311,9 +311,9 @@ class MoonWorksDearImGuiScaffoldGame : Game
|
||||
resourceUploader.Upload();
|
||||
resourceUploader.Dispose();
|
||||
|
||||
io.Fonts.SetTexID(fontTexture.Handle);
|
||||
io.Fonts.SetTexID(FontTexture.Handle);
|
||||
io.Fonts.ClearTexData();
|
||||
|
||||
TextureStorage.Add(fontTexture);
|
||||
TextureStorage.Add(FontTexture);
|
||||
}
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ class Program
|
||||
MoonWorksDearImGuiScaffoldGame game = new MoonWorksDearImGuiScaffoldGame(
|
||||
windowCreateInfo,
|
||||
frameLimiterSettings,
|
||||
[Backend.Vulkan, Backend.D3D11],
|
||||
[Backend.D3D11, Backend.Vulkan],
|
||||
debugMode
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user