Esempio n. 1
0
Handle<Value> fl_shad_AddVertexShader(const Arguments& args) {
    HandleScope handle_scope;
    Local<External> entVal  = Local<External>::Cast(args.This()->GetInternalField(0));
    Shader* shader = static_cast<Shader*>(entVal->Value());
    Handle<Object> obj = args[0]->ToObject();
    Local<Value> intVal = obj->GetInternalField(0);
    Local<External> extVal = Local<External>::Cast(intVal);
    VertexShader* toAdd = static_cast<VertexShader*>(extVal->Value());
    shader->AddVertexShader(toAdd);
    return handle_scope.Close(args.This());
}
Esempio n. 2
0
jsvalue JsEngine::ManagedFromV8(Handle<Object> obj)
{
    jsvalue v;
    
	Local<External> wrap = Local<External>::Cast(obj->GetInternalField(0));
    ManagedRef* ref = (ManagedRef*)wrap->Value();
	v.type = JSVALUE_TYPE_MANAGED;
    v.length = ref->Id();
    v.value.str = 0;

    return v;
}
Esempio n. 3
0
PlayerPtr Player::GetPointerFromObj(Handle<v8::Object> obj)
{
    auto wrap = Local<External>::Cast(obj->GetInternalField(0));
    PlayerPtr self = *static_cast<PlayerPtr*>(wrap->Value());
    return self;
}