Raffaello / sdl2-vga-terminal

SDL2 VGA Terminal
MIT License
6 stars 1 forks source link
cmake gtest retro-computing sdl2 sdl2-image terminal thread-safe vga

SDL2 VGA Terminal

Codacy Badge codecov

Monolithic CI Note
Build status disabled
Build Status disabled
Linux (x64) Windows (x86, x64) macOS (x64) Analyzer
Build Status Build Status Build Status Build Status

SonarCloud

NOTE: Code Coverage is not yet computed

Bugs Code Smells Coverage Duplicated Lines (%) Lines of Code Maintainability Rating Quality Gate Status Reliability Rating Security Rating Technical Debt Vulnerabilities

Azure Pipelines

NOTE: unmaintained pipelines, it looks like something changed in azure pipelines, i don't have the interest to fix it at the moment. (replaced with simpler basic GitHub workflows instead, to do the CI build&testing&install, then release the pacakge)

there are 5 pipelines, 1 for each OS and one dedicated to "Analysis", plus 1 for matrix build.

FLAGS\OS Windows Linux macos
Debug :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
Release :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
BUILD_SHARED_LIBS :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
WITH_SDL2_STATIC :heavy_check_mark: only only
BUILD_TESTING :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
BUILD_EXAMPLES :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
BUILD_SNAPSHOT :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
TEST_DUMP_SNAPSHOT :no_entry: :no_entry: :no_entry:
ENABLE_CODE_COVERAGE :no_entry_sign: :no_entry_sign: :heavy_check_mark:

Linux Note

It is required to install sdl[x11] along side sdl package otherwise linking error. NOTE: it looks like not anymore true using vcpkg.json

SDL2-static switch

It has been disabled as it has been moved to a different triplet x64-windows-static and just makes it annoying to test for it as it requires to have also a VCPKG_TARGET_TRIPLET to be changed and so it should be used as a different job itself rather than a switch, even though the switch in CMAKE is required to link the proper SDL2::SDL2 or SDL2::SDL2-static.

At the moment the WITH_SDL2_STATIC option in CMAKE has been disabled.

Synopsis

It is just a VGA font terminal using SDL2.

the VGA fonts are related to vgabios project.

At the moment support only mode 3.

It should be on 16 colors in the classic way, but can support more thanks to SDL2.

It is just a matter of fonts and a terminal grid for displaying texts.

Requirements

Compiling

These are the requirements to compile the project from source:

Usage

SDL2 Video sub-system has to be initialized before using VgaTerminal class.

There are few examples too in examples folder.

Screenshot

This screenshot is also used in the snapshot test.

alt text

Testing

using GTest framework.

There is a technique, snapshot testing, to verify some expectation, due to some required raster image to compare with, there is a boolean option TEST_DUMP_SNAPSHOT, that will run the test suit for generating the expected result. It could be a little bit risky, but it is a way to have generated expected results for the test suite.

The test suite take advantages of the option and will be compiled accordingly based on "dumping" or "testing".

please note if you are dumping the snapshot, you have to copy back to the test/snapshot directory to make them usable.

The filename generated are based on the test that are running, ideally: [Test-suite.Test-name].png

Just as a convention.

Tui Terminal (Experimental)

This is just a show case and has not to be considered following the semantic versioning of the project, it implies things might change with no objective reason at all.

It might could be detached completely and be its own library using this one.

At the moment is really very basic, error-prone and not well designed neither.

There is an example too among the examples.

Screenshot

This is a TUI screenshot used in the snapshot test too.

alt text

Done with

Projects Idea to be done in the future