You must have .Net Core SDK
- Clone this project
- Restore dependencies
OR
- Download latest release
- Create new project and link the dll
- Add the dependencies to your project
through Nuget Packet Manager
- OpenTK.NetCore
- CoreCompact.System.Drawing
- NAudio
using System;
using Szark;
namespace Example
{
class RandomExample : SzarkEngine
{
private Random random;
private SpriteRenderer renderer;
RandomExample() : base("Random Pixels Example",
800, 800, 8) { }
protected override void Start()
{
random = new Random();
renderer = CreateRenderer(new Sprite(ScreenWidth, ScreenHeight));
}
protected override void Update(float deltaTime) { }
protected override void Draw(float deltaTime)
{
for (int i = 0; i < ScreenWidth; i++)
{
for (int j = 0; j < ScreenHeight; j++)
{
renderer.Graphics.Draw(i, j, new Pixel((byte)random.Next(255),
(byte)random.Next(255), (byte)random.Next(255)));
}
}
renderer.Render(0, 0, 0, 1, -1, true);
renderer.Refresh();
}
protected override void Destroyed() { }
static void Main(string[] theArgs) =>
new RandomExample();
}
}
You can find documentation by going to the wiki tab.
Check out the C++ inspiration of this engine, the olcPixelGameEngine by Javidx9 (OneLoneCoder.com). He uses the OLC-3 License in his original project.