package gui;

import gui.constants.Fonts;
import gui.constants.Images;
import gui.menu.MainMenu;
import gui.menu.StateMachine;
import imgui.app.Application;
import imgui.app.Configuration;

public class Main extends Application {

    private final StateMachine stateMachine = new StateMachine();

    @Override
    protected void configure(Configuration config) {
        config.setTitle("Let's play sudoku!");
    }

    @Override
    protected void disposeWindow() {
        stateMachine.clear();
    }

    @Override
    protected void initImGui(Configuration config) {
        super.initImGui(config);
        Fonts.createFonts();
        stateMachine.pushState(new MainMenu(stateMachine));
    }
    
    @Override
    protected void preRun() {
        super.preRun();
        Images.reloadImages();
    }

    @Override
    public void process() {
        stateMachine.render();
        // ImGui.showDemoWindow();
    }

    public static void main(String[] args) {
        launch(new Main());
    }
}