コード例 #1
0
ファイル: ofVbo.cpp プロジェクト: cigraphics/ofxMoonLight
/** void ofVbo::updateVertexData(const ofVec3f *verts, int total)
 * api/openFrameworks/gl/ofVbo.h:36
 */
static int ofVbo_updateVertexData(lua_State *L) {
  try {
    ofVbo *self = *((ofVbo **)dub_checksdata(L, 1, "ofVbo"));
    int type__ = lua_type(L, 2);
    void **ptr2__;
    if ( (ptr2__ = dub_issdata(L, 2, "ofVec3f", type__)) ) {
      ofVec3f *verts = *((ofVec3f **)ptr2__);
      int total = dub_checkint(L, 3);
      self->updateVertexData(verts, total);
      return 0;
    } else if ( (ptr2__ = dub_issdata(L, 2, "ofVec2f", type__)) ) {
      ofVec2f *verts = *((ofVec2f **)ptr2__);
      int total = dub_checkint(L, 3);
      self->updateVertexData(verts, total);
      return 0;
    } else {
      float * ver0x = (float *) lua_touserdata (L, 2);
      
      int total = dub_checkint(L, 3);
      self->updateVertexData((float *) ver0x, total);
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "updateVertexData: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "updateVertexData: Unknown exception");
  }
  return dub_error(L);
}
コード例 #2
0
ファイル: ofBuffer.cpp プロジェクト: cigraphics/ofxMoonLight
/** void ofBuffer::set(const char *_buffer, unsigned int _size)
 * api/openFrameworks/utils/ofFileUtils.h:21
 */
static int ofBuffer_set(lua_State *L) {
  try {
    ofBuffer *self = *((ofBuffer **)dub_checksdata(L, 1, "ofBuffer"));
    int top__ = lua_gettop(L);
    if (top__ >= 3) {
      const char *_buffer = dub_checkstring(L, 2);
      unsigned int _size = dub_checkint(L, 3);
      self->set(_buffer, _size);
      return 0;
    } else {
      int type__ = lua_type(L, 2);
      void **ptr2__;
      if ( (ptr2__ = dub_issdata(L, 2, "istream", type__)) ) {
        istream *stream = *((istream **)ptr2__);
        lua_pushboolean(L, self->set(*stream));
        return 1;
      } else {
        size_t text_sz_;
        const char *text = dub_checklstring(L, 2, &text_sz_);
        self->set(std::string(text, text_sz_));
        return 0;
      }
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "set: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "set: Unknown exception");
  }
  return dub_error(L);
}
コード例 #3
0
ファイル: ofFbo.cpp プロジェクト: cigraphics/ofxMoonLight
/** void ofFbo::readToPixels(ofPixels &pixels, int attachmentPoint=0)
 * api/openFrameworks/gl/ofFbo.h:37
 */
static int ofFbo_readToPixels(lua_State *L) {
  try {
    ofFbo *self = *((ofFbo **)dub_checksdata(L, 1, "ofFbo"));
    int top__ = lua_gettop(L);
    if (top__ >= 3) {
      int type__ = lua_type(L, 2);
      void **ptr2__;
      if ( (ptr2__ = dub_issdata(L, 2, "ofShortPixels", type__)) ) {
        ofShortPixels *pixels = *((ofShortPixels **)ptr2__);
        int attachmentPoint = dub_checkint(L, 3);
        self->readToPixels(*pixels, attachmentPoint);
        return 0;
      } else if ( (ptr2__ = dub_issdata(L, 2, "ofPixels", type__)) ) {
        ofPixels *pixels = *((ofPixels **)ptr2__);
        int attachmentPoint = dub_checkint(L, 3);
        self->readToPixels(*pixels, attachmentPoint);
        return 0;
      } else {
        ofFloatPixels *pixels = *((ofFloatPixels **)dub_checksdata(L, 2, "ofFloatPixels"));
        int attachmentPoint = dub_checkint(L, 3);
        self->readToPixels(*pixels, attachmentPoint);
        return 0;
      }
    } else {
      int type__ = lua_type(L, 2);
      void **ptr2__;
      if ( (ptr2__ = dub_issdata(L, 2, "ofShortPixels", type__)) ) {
        ofShortPixels *pixels = *((ofShortPixels **)ptr2__);
        self->readToPixels(*pixels);
        return 0;
      } else if ( (ptr2__ = dub_issdata(L, 2, "ofPixels", type__)) ) {
        ofPixels *pixels = *((ofPixels **)ptr2__);
        self->readToPixels(*pixels);
        return 0;
      } else {
        ofFloatPixels *pixels = *((ofFloatPixels **)dub_checksdata(L, 2, "ofFloatPixels"));
        self->readToPixels(*pixels);
        return 0;
      }
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "readToPixels: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "readToPixels: Unknown exception");
  }
  return dub_error(L);
}
コード例 #4
0
ファイル: b2_BiFrictionJointDef.cpp プロジェクト: lubyk/b2
/** void b2BiFrictionJointDef::Initialize(b2Body *body, const b2Vec2 &mu)
 * vendor/Box2D/Box2D/Dynamics/Joints/b2BiFrictionJoint.h:35
 */
static int b2BiFrictionJointDef_Initialize(lua_State *L) {
  try {
    b2BiFrictionJointDef *self = *((b2BiFrictionJointDef **)dub_checksdata(L, 1, "b2.BiFrictionJointDef"));
    int top__ = lua_gettop(L);
    if (top__ >= 4) {
      int type__ = lua_type(L, 4);
      void **ptr4__;
      if ( (ptr4__ = dub_issdata(L, 4, "b2.Mat22", type__)) ) {
        b2Body *body = *((b2Body **)dub_checksdata(L, 2, "b2.Body"));
        b2Mat22 *muStatic = *((b2Mat22 **)dub_checksdata(L, 3, "b2.Mat22"));
        b2Mat22 *muKinetic = *((b2Mat22 **)ptr4__);
        self->Initialize(body, *muStatic, *muKinetic);
        return 0;
      } else {
        b2Body *body = *((b2Body **)dub_checksdata(L, 2, "b2.Body"));
        b2Vec2 *muStatic = *((b2Vec2 **)dub_checksdata(L, 3, "b2.Vec2"));
        b2Vec2 *muKinetic = *((b2Vec2 **)dub_checksdata(L, 4, "b2.Vec2"));
        self->Initialize(body, *muStatic, *muKinetic);
        return 0;
      }
    } else {
      int type__ = lua_type(L, 3);
      void **ptr3__;
      if ( (ptr3__ = dub_issdata(L, 3, "b2.Mat22", type__)) ) {
        b2Body *body = *((b2Body **)dub_checksdata(L, 2, "b2.Body"));
        b2Mat22 *muStatic = *((b2Mat22 **)ptr3__);
        self->Initialize(body, *muStatic);
        return 0;
      } else {
        b2Body *body = *((b2Body **)dub_checksdata(L, 2, "b2.Body"));
        b2Vec2 *mu = *((b2Vec2 **)dub_checksdata(L, 3, "b2.Vec2"));
        self->Initialize(body, *mu);
        return 0;
      }
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "Initialize: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "Initialize: Unknown exception");
  }
  return dub_error(L);
}
コード例 #5
0
ファイル: ofBuffer.cpp プロジェクト: cigraphics/ofxMoonLight
/** ofBuffer::ofBuffer()
 * api/openFrameworks/utils/ofFileUtils.h:13
 */
static int ofBuffer_ofBuffer(lua_State *L) {
  try {
    int top__ = lua_gettop(L);
    if (top__ >= 2) {
      const char *buffer = dub_checkstring(L, 1);
      unsigned int size = dub_checkint(L, 2);
      ofBuffer *retval__ = new ofBuffer(buffer, size);
      dub_pushudata(L, retval__, "ofBuffer", true);
      return 1;
    } else if (top__ >= 1) {
      int type__ = lua_type(L, 1);
      void **ptr1__;
      if ( (ptr1__ = dub_issdata(L, 1, "istream", type__)) ) {
        istream *stream = *((istream **)ptr1__);
        ofBuffer *retval__ = new ofBuffer(*stream);
        dub_pushudata(L, retval__, "ofBuffer", true);
        return 1;
      } else if ( (ptr1__ = dub_issdata(L, 1, "ofBuffer", type__)) ) {
        ofBuffer *buffer_ = *((ofBuffer **)ptr1__);
        ofBuffer *retval__ = new ofBuffer(*buffer_);
        dub_pushudata(L, retval__, "ofBuffer", true);
        return 1;
      } else {
        size_t text_sz_;
        const char *text = dub_checklstring(L, 1, &text_sz_);
        ofBuffer *retval__ = new ofBuffer(std::string(text, text_sz_));
        dub_pushudata(L, retval__, "ofBuffer", true);
        return 1;
      }
    } else {
      ofBuffer *retval__ = new ofBuffer();
      dub_pushudata(L, retval__, "ofBuffer", true);
      return 1;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "new: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "new: Unknown exception");
  }
  return dub_error(L);
}
コード例 #6
0
ファイル: ofFile.cpp プロジェクト: cigraphics/ofxMoonLight
/** ofFile::ofFile()
 * api/openFrameworks/utils/ofFileUtils.h:100
 */
static int ofFile_ofFile(lua_State *L) {
  try {
    int top__ = lua_gettop(L);
    if (top__ >= 3) {
      size_t filePath_sz_;
      const char *filePath = dub_checklstring(L, 1, &filePath_sz_);
      ofFile::Mode mode = (ofFile::Mode)dub_checkint(L, 2);
      bool binary = dub_checkboolean(L, 3);
      ofFile *retval__ = new ofFile(std::string(filePath, filePath_sz_), mode, binary);
      dub_pushudata(L, retval__, "ofFile", true);
      return 1;
    } else if (top__ >= 2) {
      size_t filePath_sz_;
      const char *filePath = dub_checklstring(L, 1, &filePath_sz_);
      ofFile::Mode mode = (ofFile::Mode)dub_checkint(L, 2);
      ofFile *retval__ = new ofFile(std::string(filePath, filePath_sz_), mode);
      dub_pushudata(L, retval__, "ofFile", true);
      return 1;
    } else if (top__ >= 1) {
      int type__ = lua_type(L, 1);
      void **ptr1__;
      if ( (ptr1__ = dub_issdata(L, 1, "ofFile", type__)) ) {
        ofFile *mom = *((ofFile **)ptr1__);
        ofFile *retval__ = new ofFile(*mom);
        dub_pushudata(L, retval__, "ofFile", true);
        return 1;
      } else {
        size_t filePath_sz_;
        const char *filePath = dub_checklstring(L, 1, &filePath_sz_);
        ofFile *retval__ = new ofFile(std::string(filePath, filePath_sz_));
        dub_pushudata(L, retval__, "ofFile", true);
        return 1;
      }
    } else {
      ofFile *retval__ = new ofFile();
      dub_pushudata(L, retval__, "ofFile", true);
      return 1;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "new: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "new: Unknown exception");
  }
  return dub_error(L);
}
コード例 #7
0
ファイル: ofVbo.cpp プロジェクト: cigraphics/ofxMoonLight
/** void ofVbo::setVertexData(const ofVec3f *verts, int total, int usage)
 * api/openFrameworks/gl/ofVbo.h:21
 */
static int ofVbo_setVertexData(lua_State *L) {
  try {
    ofVbo *self = *((ofVbo **)dub_checksdata(L, 1, "ofVbo"));
    int top__ = lua_gettop(L);
    if (top__ >= 6) {
      float * vert0x = (float *) lua_touserdata (L, 2);
      
      int numCoords = dub_checkint(L, 3);
      int total = dub_checkint(L, 4);
      int usage = dub_checkint(L, 5);
      int stride = dub_checkint(L, 6);
      self->setVertexData((float *) vert0x, numCoords, total, usage, stride);
      return 0;
    } else if (top__ >= 5) {
      float * vert0x = (float *) lua_touserdata (L, 2);
      
      int numCoords = dub_checkint(L, 3);
      int total = dub_checkint(L, 4);
      int usage = dub_checkint(L, 5);
      self->setVertexData((float *) vert0x, numCoords, total, usage);
      return 0;
    } else {
      int type__ = lua_type(L, 2);
      void **ptr2__;
      if ( (ptr2__ = dub_issdata(L, 2, "ofVec3f", type__)) ) {
        ofVec3f *verts = *((ofVec3f **)ptr2__);
        int total = dub_checkint(L, 3);
        int usage = dub_checkint(L, 4);
        self->setVertexData(verts, total, usage);
        return 0;
      } else {
        ofVec2f *verts = *((ofVec2f **)dub_checksdata(L, 2, "ofVec2f"));
        int total = dub_checkint(L, 3);
        int usage = dub_checkint(L, 4);
        self->setVertexData(verts, total, usage);
        return 0;
      }
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "setVertexData: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setVertexData: Unknown exception");
  }
  return dub_error(L);
}
コード例 #8
0
ファイル: bt_Matrix3x3.cpp プロジェクト: lubyk/old_bt
/** btMatrix3x3::btMatrix3x3()
 * src/vendor/bullet/src/LinearMath/btMatrix3x3.h:50
 */
static int btMatrix3x3_btMatrix3x3(lua_State *L) {
  try {
    int top__ = lua_gettop(L);
    if (top__ >= 9) {
      btScalar xx = dub_checknumber(L, 1);
      btScalar xy = dub_checknumber(L, 2);
      btScalar xz = dub_checknumber(L, 3);
      btScalar yx = dub_checknumber(L, 4);
      btScalar yy = dub_checknumber(L, 5);
      btScalar yz = dub_checknumber(L, 6);
      btScalar zx = dub_checknumber(L, 7);
      btScalar zy = dub_checknumber(L, 8);
      btScalar zz = dub_checknumber(L, 9);
      btMatrix3x3 *retval__ = new btMatrix3x3(xx, xy, xz, yx, yy, yz, zx, zy, zz);
      dub_pushudata(L, retval__, "bt.Matrix3x3", true);
      return 1;
    } else if (top__ >= 1) {
      int type__ = lua_type(L, 1);
      void **ptr1__;
      if ( (ptr1__ = dub_issdata(L, 1, "bt.Matrix3x3", type__)) ) {
        btMatrix3x3 *other = *((btMatrix3x3 **)ptr1__);
        btMatrix3x3 *retval__ = new btMatrix3x3(*other);
        dub_pushudata(L, retval__, "bt.Matrix3x3", true);
        return 1;
      } else {
        btQuaternion *q = *((btQuaternion **)dub_checksdata(L, 1, "bt.Quaternion"));
        btMatrix3x3 *retval__ = new btMatrix3x3(*q);
        dub_pushudata(L, retval__, "bt.Matrix3x3", true);
        return 1;
      }
    } else {
      btMatrix3x3 *retval__ = new btMatrix3x3();
      dub_pushudata(L, retval__, "bt.Matrix3x3", true);
      return 1;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "new: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "new: Unknown exception");
  }
  return dub_error(L);
}
コード例 #9
0
ファイル: ofVec2f.cpp プロジェクト: cigraphics/ofxMoonLight
/** ofVec2f::ofVec2f()
 * api/openFrameworks/math/ofVec2f.h:13
 */
static int ofVec2f_ofVec2f(lua_State *L) {
  try {
    int top__ = lua_gettop(L);
    if (top__ >= 2) {
      float _x = dub_checknumber(L, 1);
      float _y = dub_checknumber(L, 2);
      ofVec2f *retval__ = new ofVec2f(_x, _y);
      dub_pushudata(L, retval__, "ofVec2f", true);
      return 1;
    } else if (top__ >= 1) {
      int type__ = lua_type(L, 1);
      void **ptr1__;
      if (type__ == LUA_TNUMBER) {
        float _scalar = dub_checknumber(L, 1);
        ofVec2f *retval__ = new ofVec2f(_scalar);
        dub_pushudata(L, retval__, "ofVec2f", true);
        return 1;
      } else if ( (ptr1__ = dub_issdata(L, 1, "ofVec3f", type__)) ) {
        ofVec3f *vec = *((ofVec3f **)ptr1__);
        ofVec2f *retval__ = new ofVec2f(*vec);
        dub_pushudata(L, retval__, "ofVec2f", true);
        return 1;
      } else {
        ofVec4f *vec = *((ofVec4f **)dub_checksdata(L, 1, "ofVec4f"));
        ofVec2f *retval__ = new ofVec2f(*vec);
        dub_pushudata(L, retval__, "ofVec2f", true);
        return 1;
      }
    } else {
      ofVec2f *retval__ = new ofVec2f();
      dub_pushudata(L, retval__, "ofVec2f", true);
      return 1;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "new: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "new: Unknown exception");
  }
  return dub_error(L);
}
コード例 #10
0
ファイル: ofVbo.cpp プロジェクト: cigraphics/ofxMoonLight
/** void ofVbo::setColorData(const ofFloatColor *colors, int total, int usage)
 * api/openFrameworks/gl/ofVbo.h:24
 */
static int ofVbo_setColorData(lua_State *L) {
  try {
    ofVbo *self = *((ofVbo **)dub_checksdata(L, 1, "ofVbo"));
    int top__ = lua_gettop(L);
    if (top__ >= 5) {
      float * color0r = (float *) lua_touserdata (L, 2);
      
      int total = dub_checkint(L, 3);
      int usage = dub_checkint(L, 4);
      int stride = dub_checkint(L, 5);
      self->setColorData((float *) color0r, total, usage, stride);
      return 0;
    } else {
      int type__ = lua_type(L, 2);
      void **ptr2__;
      if ( (ptr2__ = dub_issdata(L, 2, "ofFloatColor", type__)) ) {
        ofFloatColor *colors = *((ofFloatColor **)ptr2__);
        int total = dub_checkint(L, 3);
        int usage = dub_checkint(L, 4);
        self->setColorData(colors, total, usage);
        return 0;
      } else {
        float * color0r = (float *) lua_touserdata (L, 2);
        
        int total = dub_checkint(L, 3);
        int usage = dub_checkint(L, 4);
        self->setColorData((float *) color0r, total, usage);
        return 0;
      }
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "setColorData: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setColorData: Unknown exception");
  }
  return dub_error(L);
}