Skip to content

Instantly share code, notes, and snippets.

@SplittyDev
Created November 22, 2015 02:13
Show Gist options
  • Save SplittyDev/6ff9c0004738350ed08a to your computer and use it in GitHub Desktop.
Save SplittyDev/6ff9c0004738350ed08a to your computer and use it in GitHub Desktop.
using System;
using Iodine.Runtime;
using nginz.Common;
namespace nginz.Interop.Iodine.nginzcore
{
public class GLBufferType : IodineObject, ICanLog
{
readonly static IodineTypeDefinition typeDef;
static GLBufferType () {
typeDef = new GLBufferTypeDefinition ("GLBuffer");
}
class GLBufferTypeDefinition : IodineTypeDefinition, ICanLog {
public GLBufferTypeDefinition (string name) : base (name) { }
public override IodineObject Invoke (VirtualMachine vm, IodineObject[] arguments) {
this.Log ("Initializing GLBuffer");
return null;
}
}
public GLBufferType () : base (typeDef) {
SetAttribute ("init", new InternalMethodCallback (init, this));
}
// args [0]: BufferTargetType
// args [1]: IodineArray
IodineObject init (VirtualMachine vm, IodineObject self, IodineObject[] args) {
this.Log ("Initializing GLBuffer");
//var iodinetarget = args [0] as BufferTargetType;
return null;
}
}
}
using System;
using Iodine.Runtime;
namespace nginz.Interop.Iodine.nginzcore
{
[IodineBuiltinModule ("nginz")]
public class nginzcoreModule : IodineModule
{
public nginzcoreModule () : base ("nginz") {
var glBufferCallback = new InternalMethodCallback (createGlBuffer, this);
SetAttribute ("GLBuffer", glBufferCallback);
}
static IodineObject createGlBuffer (VirtualMachine vm, IodineObject self, IodineObject[] args) {
return new GLBufferType ();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment