Hey guys,
But simply put it's a toolkit that allows you to create games and applications for different targets under one haxe api ( think Lime, SDL, etc).
I'm not assuming any of you have a lot of Kha experience so I'll try to keep it as abstract as possible.
At this point I'm trying to define the Context and View for Kha. From all the other drivers I've seen they all work with existing containers from each backend. Kha however doesn't have concepts such as graphs/containers , it's rather more to the bone. I need to define these myself.
Kha has an interface Canvas, Image derives from this.
An Image type is either created from assets; static, you can not use this as a render target, you use these to render onto a render target.
Or an Image type that is created with Image Image.createRenderTarget(...), as the name suggest, allows you to draw onto them.
So I came up with this:
typedef Context = KhaContext;
public var canvas:Canvas;
public function new () { }
In my entry point class I then define a new RenderTarget :
var khaContext:Context = new Context();
khaContext.canvas = Image.createRenderTarget(800, 600);
new Factory(khaContext, false, null);
What I completely fail to understand is how this will work for Views?
Each view holds its own Context. But creating a render target for each view (/entity?) would be abysmal. I can however assign loaded images ( non render targets ) to Context.canvas as well, but I have no clue where and when this would be possible?
To be honest I do not know yet how graphics for entities ( how to add them, apply shaders etc) will work eventually.
Any help would be appreciated.
Canvas holds drawing functionality for both 2D and 3D, but I'm focussing on 2D views first.
Sidar