add initial Buffer class

This commit is contained in:
josh committed 2014-08-14 21:13:33 -04:00
1 parent d76838f229
commit bdf0e1c6bc
3 files changed
+25

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
#include "Buffer.h"
#include "ruby.h"
static VALUE ruby_class;
static VALUE Buffer_brackets(VALUE self, VALUE index)
{
/* TODO: implement for real */
VALUE s = rb_funcall(index, rb_intern("to_s"), 0);
return s;
}
void Buffer_Init()
{
ruby_class = rb_define_class("Buffer", rb_cObject);
rb_define_method(ruby_class, "[]", (VALUE(*)(...))Buffer_brackets, 1);
}
+6
View File
@@ -0,0 +1,6 @@
#ifndef BUFFER_H
#define BUFFER_H
void Buffer_Init();
#endif
+2
View File
@@ -1,6 +1,7 @@
#include <iostream>
#include "ruby.h"
#include "Buffer.h"
#include "Font.h"
#include "GL.h"
#include "GLProgram.h"
@@ -54,6 +55,7 @@ static int bootstrap()
int rv = 0;
int err_state = 0;
Buffer_Init();
Font_Init();
GL_Init();
GLProgram_Init();