Skip to content

Commit

Permalink
Add glBlendFunc and glEnable
Browse files Browse the repository at this point in the history
  • Loading branch information
puffnfresh committed Sep 21, 2010
1 parent b1bb314 commit 3f13823
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/glcontext.h
Expand Up @@ -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);
Expand Down Expand Up @@ -385,6 +388,27 @@ class GLContext : public ObjectWrap {
return Undefined();
}

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;
Expand Down

0 comments on commit 3f13823

Please sign in to comment.