Beispiel #1
0
// DECL: ButtonState getButtonState(unsigned int buttonId) const;
value hx_Gamepad_getButtonState(value thisObj, value buttonId)
{
    Gamepad* _thisObj;
    int _buttonId = ValueToUint(buttonId);
    ValueToObject(thisObj, _thisObj);
    return EnumToValue(_thisObj->getButtonState(_buttonId));
}
 void controlEvent(Control *control, EventType type)
 {
     val_call2(
             clbkControlEvent.get(),
             ReferenceToValue(control, true),
             EnumToValue(type)
         );
 }
Beispiel #3
0
static void logFunction(Logger::Level level, const char *message)
{
    if (clbkLogFunction != NULL)
    {
        val_call2(
                clbkLogFunction->get(),
                EnumToValue(level),
                StringToValue(message)
            );
    }
}
Beispiel #4
0
    bool mouseEvent(Mouse::MouseEvent event, int x, int y, int wheelData)
    {
        value vals[] =
            {
                EnumToValue(event),
                alloc_int(x),
                alloc_int(y),
                alloc_int(wheelData)
            };

        return val_get_bool(val_callN(clbkMouseEvent.get(), vals, 4));
    }
Beispiel #5
0
    void touchEvent(Touch::TouchEvent event, int x, int y, unsigned int contactIndex)
    {
        value vals[] =
            {
                EnumToValue(event),
                alloc_int(x),
                alloc_int(y),
                alloc_int(contactIndex)
            };

        val_callN(clbkTouchEvent.get(), vals, 4);
    }
    void collisionEvent(
                PhysicsCollisionObject::CollisionListener::EventType type,
                const PhysicsCollisionObject::CollisionPair &collisionPair,
                const Vector3 &contactPointA,
                const Vector3 &contactPointB)
    {
        value args[] =
            {
                EnumToValue(type),
                ObjectToValue(
                        new PhysicsCollisionObject::CollisionPair(
                                collisionPair.objectA,
                                collisionPair.objectB
                            )
                    ),
                ObjectToValue(&contactPointA, false),
                ObjectToValue(&contactPointB, false)
            };

        val_callN(clbkCollisionEvent.get(), args, 4);
    }
// DECL: virtual PhysicsCollisionObject::Type getType() const = 0;
value hx_PhysicsCollisionObject_getType(value thisObj)
{
    PhysicsCollisionObject *_thisObj;
    ValueToObject(thisObj, _thisObj);
    return EnumToValue(_thisObj->getType());
}
// DECL: PhysicsCollisionObject::Type getType() const;
value hx_PhysicsVehicleWheel_getType(value thisObj)
{
    PhysicsVehicleWheel *_thisObj;
    ValueToObject(thisObj, _thisObj);
    return EnumToValue(_thisObj->getType());
}
Beispiel #9
0
 void keyEvent(Keyboard::KeyEvent event, int key)
 {
     val_call2(clbkKeyEvent.get(), EnumToValue(event), alloc_int(key));
 }
Beispiel #10
0
 void gamepadEvent(Gamepad::GamepadEvent event, Gamepad *gamepad)
 {
     val_call2(clbkGamepadEvent.get(), EnumToValue(event), ObjectToValue(gamepad, false));
 }
Beispiel #11
0
// DECL: inline State getState() const;
value hx_Game_getState(value thisObj)
{
    Game *_thisObj;
    ValueToObject(thisObj, _thisObj);
    return EnumToValue(_thisObj->getState());
}
Beispiel #12
0
// DECL: AudioSource::State getState() const;
value hx_AudioSource_getState(value thisObj)
{
    AudioSource *_thisObj;
    ValueToObject(thisObj, _thisObj);
    return EnumToValue(_thisObj->getState());
}
Beispiel #13
0
// DECL: inline Format getFormat() const;
value hx_Image_getFormat(value thisObj)
{
    Image *_thisObj;
    ValueToObject(thisObj, _thisObj);
    return EnumToValue(_thisObj->getFormat());
}
Beispiel #14
0
// DECL: Node::Type getType() const;
value hx_Joint_getType(value thisObj)
{
    Joint *_thisObj;
    ValueToObject(thisObj, _thisObj);
    return EnumToValue(_thisObj->getType());
}