Skip to content

LightShade12/StrawPlate

Repository files navigation

StrawPlate

A basic, general-purpose, OpenGL GUI application wrapper library for C++.

What it is:


This is a basic C++ GUI library, using GLFW, Dear ImGui and GLAD. Made for speeding up GUI application development.

Pre-Requisites

  • Cmake (3.27 or above) : The build system

Libraries used:

Usage

//
#include "strawplate.hpp" //-- Include the public header
//

#include <stdexcept>
#include <iostream>

int main(int argc, const char* argv[])
{
    try
    {
        //-- set settings
        StrawPlate::WindowSettings win_sttng;
        win_sttng.label="demo window";

        //-- Create a Layer Factory 👇
        const std::shared_ptr<StrawPlate::LayerMaker> layer_factory =
		    std::make_shared<
		        StrawPlate::ConcreteLayerMaker<StrawPlate::SampleLayer>>();
        //-- Implement a custom StrawPlateLayer for your App logic ☝

        StrawPlate::GLFWApplication app(win_sttng, layer_factory);
        //-- Customize window settings etc. ☝
        
        app.run();//-- Execute!
    }
    catch(const std::exception& err)
    {
        std::cerr << "EXCEPTION:" << err.what() << "\n";
        return EXIT_FAILURE;
    }
    return EXIT_SUCCESS;
}

Building

System: Cmake ( v3.27 <= v3.31.6 <= )

Build supports: Windows, Linux

Pre-Requisites:

  • Linux : GLFW package from AUR

One-click build :

  • build.bat (Windows) :

    • Run build.bat from repo root
    • The library and headers are now in the Dist/ folder in build/
  • build.sh (Linux) :

    • Run chmod +x build.sh from repo root (adds executable priviledge to the script)
    • Run build.sh
    • The library and headers are now in the Dist/ folder in build/

CMakeLists.txt:

  • Run mkdir build && cmake -B build -DCMAKE_BUILD_TYPE=Release -t install
  • Run cmake --build ./build
  • The library and headers are now in the Dist/ folder in build/

License

StrawPlate is licensed under the MIT license.


2025

About

Wrapper GUI application lib for C++.

Topics

Resources

License

Stars

Watchers

Forks

Languages