Main application singleton (use this if you want to let the library manage window creation).
This convenience class sets up everything you need to display web-based content in a desktop application.
The App class initializes the Platform singleton with OS-specific defaults, creates a Renderer, and automatically manages window creation, run loop, input events, and painting.
Creating the App
Call App::Create() to initialize the library and create the App singleton.
static RefPtr< App > Create(Settings settings=Settings(), Config config=Config())
Create the App singleton.
Creating a Window
Call Window::Create() to create one or more windows during the lifetime of your app.
static RefPtr< Window > Create(Monitor *monitor, uint32_t width, uint32_t height, bool fullscreen, unsigned int window_flags)
Create a new Window.
@ kWindowFlags_Titled
Definition Window.h:78
@ kWindowFlags_Resizable
Definition Window.h:79
Creating an Overlay in a Window
Each Window can have one or more Overlay instances. Overlays are used to display web-based content in a portion of the window.
Call Overlay::Create() to create an overlay in a window.
static RefPtr< Overlay > Create(RefPtr< Window > window, uint32_t width, uint32_t height, int x, int y)
Create a new Overlay.
Each Overlay has a View instance that you can use to load web content into.
overlay->view()->LoadURL("https://google.com");
Running the App
Call App::Run() to start the main run loop.
int main() {
app->Run();
return 0;
}
Shutting Down the App
Call App::Quit() to stop the main run loop and shut down the app.
- Note
- This is optional, you can use the Renderer class directly if you want to manage your own windows and run loop.