如何在IMGUI中打开网页
我到处都找过了,但似乎找不到解决我的问题的方法。我想知道如何使用 imgui 打开弹出窗口并使用“https://google.com”等网站打开 chrome 窗口。我认为 ImGui::OpenPopup 可能会起作用,但后来我查看了该函数,然后在谷歌上查看,似乎它不起作用。当您单击一个按钮时,它会重定向到计算机上的一个窗口,就像您单击不和谐中的链接时,它会在您的计算机上打开一个谷歌选项卡。
我认为它可能看起来有点像这样
void GUI::renderAboutMenu() noexcept
{
if (ImGui::MenuItem("My Discord"))
openWebsite("https://discord.gg/myinvitecode");
if (ImGui::MenuItem("My Patreon"))
openWebsite("https://patreon.com/myinvitecode");
}
I've looked everywhere, and I can't seem to find the solution to my problem. I am wanting to know how I could use imgui to open a popup window and opening a chrome window with a website like "https://google.com". I thought that ImGui::OpenPopup might work, but then I looked at the function and then on google and it seemed like it wouldn't work. When you click a button and it redirects to a window on your computer, like when you click a link in discord and it opens a google tab on your computer.
I assumed it may look a little like this
void GUI::renderAboutMenu() noexcept
{
if (ImGui::MenuItem("My Discord"))
openWebsite("https://discord.gg/myinvitecode");
if (ImGui::MenuItem("My Patreon"))
openWebsite("https://patreon.com/myinvitecode");
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这实际上并不是一个亲爱的 imgui 问题,更多的是关于如何使用操作系统 API 来执行此操作。
类似的东西会起作用:
It's not really a dear imgui question, more about how to use your OS API to perform that.
Something like that would work: