Giter Club home page Giter Club logo

chamberlain91 / heirloom Goto Github PK

View Code? Open in Web Editor NEW
24.0 3.0 0.0 103.95 MB

A C# framework that provides utilities for 2D drawing, audio, basic algorithms, and more. Useful for quick prototyping and implementing games and other graphical applications. Heirloom currently is supported on Windows, Linux, and macOS.

License: Other

C# 99.58% GLSL 0.42%
graphics-library graphics 2d 2d-graphics 2d-framework audio audio-effect sound polygons math

heirloom's People

Contributors

chamberlain91 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

heirloom's Issues

Desktop - Fullscreen mode list bug

On a friends Mac it failed to get the "current" video mode from the known modes. This is strange behavior, but there are ways around this. Since discovering this bug, I rewrote the GLFW / Desktop infrastructure, so maybe this has been resolved. I do not however have a macOS machine at my disposal to validate.

Tutorials - Getting Started

Improve documentation by adding tutorials for getting started with both Visual Studio and dotnet. Need to provide a description of the dependencies/modules, what they do and what should be included for both CLI and IDE.

Drawing - Vertical / Paragraph Alignment in Text Rendering

Text rendering eventually needs features for vertical alignment. Currently this is possible by getting the computed text box size by font.MeasureText(...) and done manually in user code, but probably could and should be built into the rendering code to either or both:

  1. Improve performance of that operation .
  2. Simply be that much more convenient.

Drawing - Shader / Effect System

Eventually I would like to include a post effect / shader system into the the drawing API.

May look something like the following:

var myShader = new Shader(Files.OpenStream(...));
myShader.Set("thickness", 2);
...
ctx.Shader = myShader;
ctx.Draw(...)

Ideally the shader source will be GLSL or some simplistic DSL language. In either case, restrictions are placed on the shader for vertex input and texture systems. A DSL may be more complicated to implement, but I feel may make the act of writing shaders simpler. An additional benefit may be the DSL parser can emit GLSL, HLSL or Spir-V or whatever is consumed by the target platform.

simple.shader

Image image;
Color color;

Color frag_main(Vector uv) {
    return sampleImage(image, uv) * color;
}

The other option is to use an augmented version of GLSL with restrictions / requirements.

default.vert

#include "standard/standard.vert"

vec2 vert_main(vec2 position)
{
	// Simply forward vertex position
	return position;
}

default.frag

#include "standard/standard.frag"
 
vec4 frag_main(in vec2 uv) 
{ 
	// Simply sample image
	return sampleImage(uv);
}

Drawing - Add HSV Color Conversion

Currently there is no way to construct a color from the HSB or HSV color space.

Suggested API:

  • col = Color.FromHSV(h, s, v)
  • col.ToHSV(out var h, out var s, out var v)
  • col.Hue, col.Saturation, col.Value

Parameter h (Hue) in the range 0.0 to 360.0.
Parameter s (Saturation) in the range 0.0 to 1.0.
Parameter v (Value) in the range 0.0 to 1.0.

Unnecessary call to ctx.ResetState()

It seems that a call to ctx.ResetState() is necessary to properly configure the viewport and other internals before drawing anything. The user should not need to do this unless they are actually intending to "reset to default state" and not "initialize default state"

Drawing - Outline Quality

Drawing outline shapes, curves or 'poly line' are currently implemented with ctx.DrawLine(...). This is efficient, but can lead to visual breaks with thick lines or harsh angles.

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.