add GLShader_id()
This commit is contained in:
parent
6aef5dab75
commit
bd188f9e83
@ -1,6 +1,4 @@
|
|||||||
#include "GLShader.h"
|
#include "GLShader.h"
|
||||||
#include "ruby.h"
|
|
||||||
#include "gl3w.h"
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@ -95,5 +93,12 @@ void GLShader_Init()
|
|||||||
{
|
{
|
||||||
ruby_class = rb_define_class("GLShader", rb_cObject);
|
ruby_class = rb_define_class("GLShader", rb_cObject);
|
||||||
rb_define_singleton_method(ruby_class, "new", (VALUE(*)(...))GLShader_new, 2);
|
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;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
#ifndef GLSHADER_H
|
#ifndef GLSHADER_H
|
||||||
#define GLSHADER_H
|
#define GLSHADER_H
|
||||||
|
|
||||||
|
#include "ruby.h"
|
||||||
|
#include "gl3w.h"
|
||||||
|
|
||||||
void GLShader_Init();
|
void GLShader_Init();
|
||||||
|
GLuint GLShader_id(VALUE shader);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user