Permalink
Browse files

Add glBlendFunc and glEnable

  • Loading branch information...
1 parent b1bb314 commit 3f138238153044d38b1c2af717bc71dea6e848b5 @puffnfresh committed Sep 21, 2010
Showing with 24 additions and 0 deletions.
  1. +24 −0 src/glcontext.h
View
@@ -108,6 +108,9 @@ class GLContext : public ObjectWrap {
NODE_SET_PROTOTYPE_METHOD(t, "clearColor", ClearColor);
NODE_SET_PROTOTYPE_METHOD(t, "clear", Clear);
+ NODE_SET_PROTOTYPE_METHOD(t, "blendFunc", BlendFunc);
+ NODE_SET_PROTOTYPE_METHOD(t, "enable", Enable);
+
NODE_SET_PROTOTYPE_METHOD(t, "drawArrays", DrawArrays);
NODE_SET_PROTOTYPE_METHOD(t, "createTexture", CreateTexture);
@@ -386,6 +389,27 @@ class GLContext : public ObjectWrap {
}
static Handle<Value>
+ BlendFunc (const Arguments& args) {
+ HandleScope scope;
+
+ GLenum sfactor = args[0]->Uint32Value();
+ GLenum dfactor = args[0]->Uint32Value();
+ glBlendFunc(sfactor, dfactor);
+
+ return Undefined();
+ }
+
+ static Handle<Value>
+ Enable (const Arguments& args) {
+ HandleScope scope;
+
+ GLenum cap = args[0]->Uint32Value();
+ glEnable(cap);
+
+ return Undefined();
+ }
+
+ static Handle<Value>
Clear (const Arguments& args) {
HandleScope scope;

0 comments on commit 3f13823

Please sign in to comment.