gianmarcopicarella / aiv-draw

Simple wrapper for teaching computer graphics principles to AIV first year students

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

aiv-draw

Simple wrapper for teaching computer graphics principles to AIV first year students

using System;
using Aiv.Draw;

namespace DrawTest
{
  class MainClass
  {
    public static void Main (string[] args)
    {
       Window window = new Window (1024, 768, "Hello", PixelFormat.RGB);
       while (window.opened) {
        // write bytes into window.bitmap array to draw ...
        // read window.deltaTime to get float time delta (1f = 1 second)
        // call window.GetKey(KeyCode.xxx) to check for key press
        window.Blit ();
       }
    }
  }
}

You can get an RGBA array from images using the Sprite class:

Sprite hero = new Sprite("heroSpriteSheet.png");
byte []bitmap = hero.bitmap;
int width = hero.width;
int height = hero.height;

About

Simple wrapper for teaching computer graphics principles to AIV first year students

License:GNU General Public License v2.0


Languages

Language:C# 100.0%