Giter VIP home page Giter VIP logo

mather's Introduction


Logo
Mather

GitHub Actions License: MIT

A library to draw 2D primitives shapes quickly and efficiently.

About The ProjectHow To UseExamplesDependencies

About The Project

Mather is a library that allow you to quickly create a windows and to draw simple 2D Shapes.

Currently supporting :

  • Line
  • Poly Line
  • Circle
  • Rect
  • Polygon

How to Use

Importing

Add the library as a dependencies, the most elegant way is to clone it as a git submodule :

git submodule add https://github.com/Carbone13/mather.git
git submodule update --init --recursive

Then add it to your CMakeLists.txt and link to your executable :

add_subdirectory(path/to/mather)
...
target_link_libraries(your_project mather)

Usage

The code below demonstrate how to spawn the window and start a rendering loop

#include "mather.hpp"

int main()
{
    mather::Context ctx = mather::Context();
    while (!ctx.closeRequested())
    {
        ctx.beginFrame();
        // Here come your rendering code !
        ctx.endFrame();
    }

    return 0;
}

You don't need to use this loop at all, you can instead use your own one, just note that you need to surround any draw calls with beginFrame() and endFrame()

The closeRequested() is set to true when the user click on the close button of the window.

TODO : Support custom surface plugging

Examples

See main.cpp in demo

Dependencies

This project depend on 2 libraries :

  • GLFW for windowing and creating the surface
  • AGG for sub-pixel anti-aliasing

mather's People

Contributors

carbone13 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.