Giter VIP home page Giter VIP logo

bulwark's Introduction

                               |>
                               /\
                 ,            /  \       ,
                 |>   / \ ,  /____\     / \   |>
                 ,   /   /_\ |    |    /___\  ,
                /_\  |   | : :    :    :   : / \
                | | _;--;__;--;__;--;__;--;_ | |
                | |        |  _--_  |        | |
                | |        ||"____"||        | |
                | | ______ || ____ || ______ | |

 _______  __   __  ___      _     _  _______  ______    ___   _ 
|  _    ||  | |  ||   |    | | _ | ||   _   ||    _ |  |   | | |
| |_|   ||  | |  ||   |    | || || ||  |_|  ||   | ||  |   |_| |
|       ||  |_|  ||   |    |       ||       ||   |_||_ |      _|
|  _   | |       ||   |___ |       ||       ||    __  ||     |_ 
| |_|   ||       ||       ||   _   ||   _   ||   |  | ||    _  |
|_______||_______||_______||__| |__||__| |__||___|  |_||___| |_|

                      Keep (n)curses away!

Bulwark

A much-needed ncurses alternative, written in C for maximum portability.

Bulwark is a small but powerful library for making terminal apps. It's meant to be a simple ncurses alternative that works exactly how you'd expect. By simplifying and giving functions self-explanatory names, Bulwark aims to be easily discoverable in any mondern code editor.

The current goals of Bulwark are:

  • Target only POSIX environments.
  • Support 16, 256, and full RGB colors.
  • Support mouse events.
  • Support ascii and unicode characters
  • Have a decent rendering algorithm efficient enough for games.
  • Throw away legacy features no one uses.
  • Be easy to port.

Core Ideas

  • Bulwark does away with row/column coordinates in favor of width/height and x/y.
  • You don't have to define foreground/background pairs, like in ncurses. Can set them individually or together via single function calls.
  • The 16 builtin colors are mapped to the values 0-15 (diagram coming soon).

Feature Status

Please note the library is still in early stages and there are some major bugs I'm still working through (and general cleanup/refactoring that's on my to-do list). API is not currently in a stable state like you would want for writing real apps but things will stabilize over time and as the rest of the features get hammered out.

  • Base 16 colors
  • 256 colors
  • Non-blocking input via event queue
  • Diff rendering
  • Mouse events
  • Full RGB colors
  • Unicode characters

How To Use Bulwark

Installation

Bulwark can be installed just like any other cmake project (will add more specific instructions once the project is further along).

Core Application Loop

#include <Bulwark.h>
#include <stdbool.h>

int main() {
  bool running = true;
  Bulwark_Initialize();

  while (running) {
    // Handle input from Bulwark, decide if the app should keep running.

    Bulwark_ClearScreen();

    // Make draw calls

    Bulwark_UpdateScreen();
  }

  // Clean up

  Bulwark_Quit();

  return 0;
}

bulwark's People

Contributors

stberryhill avatar

Stargazers

 avatar

Watchers

 avatar  avatar

bulwark's Issues

Fix rendering issue with transparency.

Expected behavior when you clear the background and draw with just a foreground color is that whatever you're drawing gets overlaid on top of the background color below it.

Migrate to Autotools build system

I've been reading and I'm convinced it would be much better for the project if it were autotools based since it's target is POSIX. Since it's a well-known tool from the user's standpoint it should also make the project more accessible.

As of right now, this is the highest priority issue I've created.

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.