add GLShader_id()

This commit is contained in:
josh committed 2014-07-22 18:51:38 -04:00
1 parent 6aef5dab75
commit bd188f9e83
2 files changed
+12 -3

No files matched your search

+8 -3
View File
@@ -1,6 +1,4 @@
#include "GLShader.h"
#include "ruby.h"
#include "gl3w.h"
typedef struct
{
@@ -95,5 +93,12 @@ void GLShader_Init()
{
ruby_class = rb_define_class("GLShader", rb_cObject);
rb_define_singleton_method(ruby_class, "new", (VALUE(*)(...))GLShader_new, 2);
rb_define_attr(ruby_class, "id", 0, 1);
}
GLuint GLShader_id(VALUE shader)
{
GLShader * glshader;
Data_Get_Struct(shader, GLShader, glshader);
return glshader->id;
}
+4
View File
@@ -1,6 +1,10 @@
#ifndef GLSHADER_H
#define GLSHADER_H
#include "ruby.h"
#include "gl3w.h"
void GLShader_Init();
GLuint GLShader_id(VALUE shader);
#endif