add initial Buffer class
This commit is contained in:
parent
d76838f229
commit
bdf0e1c6bc
17
src/Buffer.cc
Normal file
17
src/Buffer.cc
Normal 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
src/Buffer.h
Normal file
6
src/Buffer.h
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#ifndef BUFFER_H
|
||||||
|
#define BUFFER_H
|
||||||
|
|
||||||
|
void Buffer_Init();
|
||||||
|
|
||||||
|
#endif
|
@ -1,6 +1,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "ruby.h"
|
#include "ruby.h"
|
||||||
|
|
||||||
|
#include "Buffer.h"
|
||||||
#include "Font.h"
|
#include "Font.h"
|
||||||
#include "GL.h"
|
#include "GL.h"
|
||||||
#include "GLProgram.h"
|
#include "GLProgram.h"
|
||||||
@ -54,6 +55,7 @@ static int bootstrap()
|
|||||||
int rv = 0;
|
int rv = 0;
|
||||||
int err_state = 0;
|
int err_state = 0;
|
||||||
|
|
||||||
|
Buffer_Init();
|
||||||
Font_Init();
|
Font_Init();
|
||||||
GL_Init();
|
GL_Init();
|
||||||
GLProgram_Init();
|
GLProgram_Init();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user