Giter Site home page Giter Site logo

bigredeye / librterm Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 0.0 962 KB

Cross-platform terminal emulator library

License: MIT License

C++ 87.04% CMake 8.81% Shell 0.88% Batchfile 2.64% C 0.13% Python 0.51%
c-plus-plus terminal-emulators roguelike-library roguelike

librterm's People

Contributors

bigredeye avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

librterm's Issues

CI builds

Configure CI to build linux/windows binaries, AFAIK it's possible.

Synchronous event polling

On Windows terminal cannot receive events from different thread. The solution is quite simple -- add rterm::Term::poll() and remove all code related to threading.

Optimization

Problem

On my GTX 1070 in benchmark mode i get only ~180 fps, and on GT 820m benchmark runs on 45 fps. It's really slow, so i have to find ways to speed up.

Suggestions

  • I should split background texture and text;
  • Add rterm::Term::move function to save time
  • Add big screen buffer

OpenGL

We should use OpenGL for text rendering because SDL2 copies whole texture to GPU each frame and this is extremely slow.

Several different APIs usage

The rendering logics should be isolated from a high-level api, so we will be able to use different APIs:
the first two should be SDL2 and OpenGL.

Optimize glyph cache

Usage of a small number of hardware textures for glyph cache will significantly increase the rendering speed.

Conan package

  • Use conan to collect SDL2 / GLAD / FreeType / etc
  • Packet it.

Custom event system

SDL's event system is ugly, so it is very difficult provide complex event handling. This code

rterm::Term term(...);
term.onKeyDown([](rterm::Key key){
    /* do something with key */
});

Looks much nicer than

rterm::Term term(...);
while (term.isRunning()) {
    rterm::Key key = term.getKey();
    /* do something with key */
}

Now we have the second one.

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.