Skip to content

Instantly share code, notes, and snippets.

@roxlu

roxlu/roxlu.cc Secret

Created March 22, 2014 19:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roxlu/8ba065c7125fa9abf318 to your computer and use it in GitHub Desktop.
Save roxlu/8ba065c7125fa9abf318 to your computer and use it in GitHub Desktop.
#include <node.h>
#include <v8.h>
#define GLFW_INCLUDE_GLCOREARB
#include <GLFW/glfw3.h>
using namespace v8;
void Method(const FunctionCallbackInfo<v8::Value>& args) {
Isolate* isolate = Isolate::GetCurrent();
HandleScope scope(isolate);
args.GetReturnValue().Set(String::NewFromUtf8(isolate, "world"));
}
void init(Handle<Object> exports) {
Isolate* isolate = Isolate::GetCurrent();
exports->Set(String::NewFromUtf8(isolate, "hello"), FunctionTemplate::New(isolate, Method)->GetFunction());
// NODE_SET_METHOD(exports, "hello", Method);
}
NODE_MODULE(hello, init)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment