Coder Social home page Coder Social logo

halcyon's Introduction

HALCYON is a C platform library in the vein of SDL, except with a focus on extreme API minimalism and artificial limitation.

NEW single header micro version hc0_linux.h for Linux (no kbd/audio)

  • used by included demo program "spectre"

Features include:

  • Single window locked to 480p (240p upscaled 2x)
  • Fixed 60fps
  • Software rendering primitives
    • Point
    • Line
    • Filled Triangle
    • Textured Triangle
  • 4 channel sound (GameBoy inspired)
    • 2 pulse wave channels
    • 1 4-bit sample channel
    • 1 LSFR noise channel
  • Keyboard and MIDI input available in extension header
  • No mouse input

A demonstration "intro" is included.
A tracker is also under development, to be included soon™.

To build everything, type: make

halcyon's People

Contributors

baines avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

halcyon's Issues

hc0_linux.h: hc_tri misses one pixel

The provided hc_tri function misses one pixel in some cases. I'm not too sure what the conditions are (the vertex order maybe?). Seems like an off-by-one error.

Full repro:

#define WHITE 0xFFFFFFFF

#include "hc0_linux.h"

static void
draw_quad(hc_v2 pos, int8_t side)
{
    hc_v2 a = { pos.x + side, pos.y + side };
    hc_v2 b = { pos.x + side, pos.y };
    hc_v2 c = { pos.x, pos.y + side };
    hc_v2 d = { pos.x, pos.y };
    hc_tri(a, b, c, WHITE, WHITE);
//    hc_tri(b, d, c, WHITE, WHITE);
}

int32_t
main(int32_t argc, char *argv[])
{
    hc_init("");

    for (;;) {
        hc_v2 pos = { WIN_W / 2, WIN_H / 2 };
        draw_quad(pos, 10);
        hc_finish(HC_CLEAR);
    }

    return(0);
}

The code above results in this image (the bottom-right pixel is missing):
image

hc0_linux.h: HC_FPS macro is not used

The single-file version of the library does not use the defined HC_FPS value. Instead, 60UL is hardcoded (see hc0_linux.h:234). Changing the define to 60UL from 60 and using it seems to have fixed the issue for me.

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.