Skip to content

Quickstart

realonepiecefreak edited this page Sep 28, 2024 · 2 revisions

Create a form class, with which the application should start with. It has to derive from Form.
Use its constructor to set up the various properties, like Content, Size, Title, Icon, and more.

class MainForm : Form
{
    public MainForm()
    {
        this.Title = "Demo App";
        this.Size = new Vector2(700, 400);

        // ImGui.Forms uses imageSharp for its internal operations and image buffers.
        this.Icon = Image.Load<Rgba32>(@"path/to/icon");

        this.Content = new Label { Text = "Demo Text" };
    }
}

Create an instance of Application and let it show your main form.

var app = new Application();
var form = new MainForm();

app.Execute(form);

Voila. You have created and started your first application with ImGui.Forms.

For all the components, how to use them, and additional properties on Form and Application, see the remaining wiki.
Have fun coding!

Clone this wiki locally