WhiteRose
WhiteRose

Reputation: 21

How can I render a webpage with dear ImGui c++?

I'm currently trying to render a couple of webpages with dear ImGui I looked everywhere but couldn't find it so here I am. And I would like to be able to load https://google.com in Window1 per example.

Thank you for your time :)

#include "App.h"
#include "imgui.h"

namespace App {
    void Application() {
        ImGui::Begin("Window1");
        ImGui::End();
        ImGui::Begin("Window2");
        ImGui::End();

        ImGui::Begin("Window3");
        ImGui::End();
    }
}

Upvotes: 1

Views: 2029

Answers (1)

Jerry Coffin
Jerry Coffin

Reputation: 490408

ImGUI doesn't include a control to render HTML, or anything like that.

If you want to badly enough, you could download the page, use something like WebKit to render it to a texture, then render the texture with ImGui.

Depending on how ambitious you're feeling, you could do the downloading completely on your own using sockets directly, using ASIO, or using libcurl, for only a few of the obvious possibilities.

Building WebKit on Linux is fairly easy, but on Windows it's somewhat non-trivial (or was the last time I did it, anyway).

Upvotes: 4

Related Questions