ahmed605 / imgui-uwp

UWP backend for ImGui

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I get tons of errors, i need a little bit of help, all errors are in the backends cpp file

ChairWareDev opened this issue · comments

image
this is the error i get, can you please help me <3

which ImGui version are you using? ImGui-UWP was only tested on v1.90+
also what are the C++ & Windows SDK versions used? ImGui-UWP was only tested on C++ 17 with Windows 11 22000+ SDK

also make sure you included ImGui headers in this order: imgui.h, imgui_impl_uwp.h, and the graphics backend header of choice, so like this for example:

#include <imgui.h>
#include <imgui_impl_uwp.h>
#include <imgui_impl_dx12.h>

ok, i got everything narrowed down to just these issues.

image

i tried using GPT but it was no help

im using imgui 1.95, C++ 20, release x64

ive also tried to set them to values but nothing worked

ok, i got everything narrowed down to just these issues.

image

i tried using GPT but it was no help

Seems like you aren't using a standard UWP project, can you check if linking WindowsApp.lib fixes it?

ok, i got everything narrowed down to just these issues.
image
i tried using GPT but it was no help

Seems like you aren't using a standard UWP project, can you check if linking WindowsApp.lib fixes it?

i will try right now

IT FIXED IT!!! THANK YOU SO MUCH

Also, how can i hook keyboard inputs? i managed to do mouse inputs but not keyboard

the backend should already support keyboard input, I have tried it with built-in ImGui text input controls and it was working

image
i cant type still, is there something i need to add into my main code for it to work? currently i have only included the backends

Can you show me how do you initialize the backend?

thats what im having trouble with, im very new to imgui

this is my main thread

image

this is my current render init

image

oh this is how the backend should be initialized

CoreWindow window = CoreWindow::GetForCurrentThread();
CoreDispatcher dispatcher = window.Dispatcher();
window.Activate();
// Setup Dear ImGui context
IMGUI_CHECKVERSION();
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO(); (void)io;
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls
io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\segoeui.ttf", 18.0f);
// High DPI scaling
DisplayInformation currentDisplayInformation = DisplayInformation::GetForCurrentView();
float dpi = currentDisplayInformation.LogicalDpi() / 96.0f;
io.DisplayFramebufferScale = { dpi, dpi }; // TODO: Handle DPI change
// Setup Dear ImGui style
ImGui::StyleColorsDark();
//ImGui::StyleColorsLight();
// Setup Platform/Renderer backends
ImGui_ImplUwp_InitForCurrentView();
ImGui_ImplDX12_Init(m_pd3dDevice.get(), NUM_FRAMES_IN_FLIGHT,
DXGI_FORMAT_R8G8B8A8_UNORM, m_pd3dSrvDescHeap.get(),
m_pd3dSrvDescHeap->GetCPUDescriptorHandleForHeapStart(),
m_pd3dSrvDescHeap->GetGPUDescriptorHandleForHeapStart());

ill give it a shot, thanks!

do you have discord by any chance?

yes, @ahmedwalid

sent im havic