当前位置: 首页>>代码示例>>C++>>正文


C++ dub_checkint函数代码示例

本文整理汇总了C++中dub_checkint函数的典型用法代码示例。如果您正苦于以下问题:C++ dub_checkint函数的具体用法?C++ dub_checkint怎么用?C++ dub_checkint使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了dub_checkint函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ofFile_open

/** bool ofFile::open(string path, Mode mode=ReadOnly, bool binary=false)
 * api/openFrameworks/utils/ofFileUtils.h:106
 */
static int ofFile_open(lua_State *L) {
  try {
    ofFile *self = *((ofFile **)dub_checksdata(L, 1, "ofFile"));
    int top__ = lua_gettop(L);
    if (top__ >= 4) {
      size_t path_sz_;
      const char *path = dub_checklstring(L, 2, &path_sz_);
      ofFile::Mode mode = (ofFile::Mode)dub_checkint(L, 3);
      bool binary = dub_checkboolean(L, 4);
      lua_pushboolean(L, self->open(std::string(path, path_sz_), mode, binary));
      return 1;
    } else if (top__ >= 3) {
      size_t path_sz_;
      const char *path = dub_checklstring(L, 2, &path_sz_);
      ofFile::Mode mode = (ofFile::Mode)dub_checkint(L, 3);
      lua_pushboolean(L, self->open(std::string(path, path_sz_), mode));
      return 1;
    } else {
      size_t path_sz_;
      const char *path = dub_checklstring(L, 2, &path_sz_);
      lua_pushboolean(L, self->open(std::string(path, path_sz_)));
      return 1;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "open: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "open: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:cigraphics,项目名称:ofxMoonLight,代码行数:33,代码来源:ofFile.cpp

示例2: ofVbo_updateVertexData

/** 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);
}
开发者ID:cigraphics,项目名称:ofxMoonLight,代码行数:32,代码来源:ofVbo.cpp

示例3: Widget_Widget

/** Widget::Widget(int window_flags)
 * include/mimas/Widget.h:60
 */
static int Widget_Widget(lua_State *L) {
  try {
    int top__ = lua_gettop(L);
    if (top__ >= 2) {
      QWidget *parent = *((QWidget **)dub_checksdata(L, 1, "mimas.QWidget"));
      int window_flags = dub_checkint(L, 2);
      Widget *retval__ = new Widget(parent, window_flags);
      retval__->pushobject(L, retval__, "mimas.Widget", true);
      return 1;
    } else if (top__ >= 1) {
      int type__ = lua_type(L, 1);
      if (type__ == LUA_TNUMBER) {
        int window_flags = dub_checkint(L, 1);
        Widget *retval__ = new Widget(window_flags);
        retval__->pushobject(L, retval__, "mimas.Widget", true);
        return 1;
      } else {
        QWidget *parent = *((QWidget **)dub_checksdata(L, 1, "mimas.QWidget"));
        Widget *retval__ = new Widget(parent);
        retval__->pushobject(L, retval__, "mimas.Widget", true);
        return 1;
      }
    } else {
      Widget *retval__ = new Widget();
      retval__->pushobject(L, retval__, "mimas.Widget", 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);
}
开发者ID:lubyk,项目名称:mimas,代码行数:37,代码来源:mimas_Widget.cpp

示例4: HBoxLayout_addWidget

/** void HBoxLayout::addWidget(QWidget *widget, int stretch=0, int alignment=0)
 * include/mimas/HBoxLayout.h:54
 */
static int HBoxLayout_addWidget(lua_State *L) {
  try {
    HBoxLayout *self = *((HBoxLayout **)dub_checksdata(L, 1, "mimas.HBoxLayout"));
    int top__ = lua_gettop(L);
    if (top__ >= 4) {
      QWidget *widget = *((QWidget **)dub_checksdata(L, 2, "mimas.QWidget"));
      int stretch = dub_checkint(L, 3);
      int alignment = dub_checkint(L, 4);
      self->addWidget(widget, stretch, alignment);
      return 0;
    } else if (top__ >= 3) {
      QWidget *widget = *((QWidget **)dub_checksdata(L, 2, "mimas.QWidget"));
      int stretch = dub_checkint(L, 3);
      self->addWidget(widget, stretch);
      return 0;
    } else {
      QWidget *widget = *((QWidget **)dub_checksdata(L, 2, "mimas.QWidget"));
      self->addWidget(widget);
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "addWidget: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "addWidget: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:lubyk,项目名称:mimas,代码行数:30,代码来源:mimas_HBoxLayout.cpp

示例5: ofConsoleLoggerChannel_log

/** void ofConsoleLoggerChannel::log(ofLogLevel level, const string &module, const string &message)
 * api/openFrameworks/utils/ofLog.h:156
 */
static int ofConsoleLoggerChannel_log(lua_State *L) {
  try {
    ofConsoleLoggerChannel *self = *((ofConsoleLoggerChannel **)dub_checksdata(L, 1, "ofConsoleLoggerChannel"));
    int top__ = lua_gettop(L);
    if (top__ >= 5) {
      ofLogLevel logLevel = (ofLogLevel)dub_checkint(L, 2);
      size_t module_sz_;
      const char *module = dub_checklstring(L, 3, &module_sz_);
      const char *format = dub_checkstring(L, 4);
      va_list *args = *((va_list **)dub_checksdata(L, 5, "va"));
      self->log(logLevel, std::string(module, module_sz_), format, *args);
      return 0;
    } else {
      ofLogLevel level = (ofLogLevel)dub_checkint(L, 2);
      size_t module_sz_;
      const char *module = dub_checklstring(L, 3, &module_sz_);
      size_t message_sz_;
      const char *message = dub_checklstring(L, 4, &message_sz_);
      self->log(level, std::string(module, module_sz_), std::string(message, message_sz_));
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "log: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "log: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:cigraphics,项目名称:ofxMoonLight,代码行数:31,代码来源:ofConsoleLoggerChannel.cpp

示例6: ofVbo_drawElements

/** void ofVbo::drawElements(int drawMode, int amt)
 * api/openFrameworks/gl/ofVbo.h:72
 */
static int ofVbo_drawElements(lua_State *L) {
  try {
    ofVbo *self = *((ofVbo **)dub_checksdata(L, 1, "ofVbo"));
    int drawMode = dub_checkint(L, 2);
    int amt = dub_checkint(L, 3);
    self->drawElements(drawMode, amt);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "drawElements: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "drawElements: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:cigraphics,项目名称:ofxMoonLight,代码行数:17,代码来源:ofVbo.cpp

示例7: TableView_resize

/** void QWidget::resize(int w, int h)
 * bind/QWidget.h:11
 */
static int TableView_resize(lua_State *L) {
  try {
    TableView *self = *((TableView **)dub_checksdata(L, 1, "mimas.TableView"));
    int w = dub_checkint(L, 2);
    int h = dub_checkint(L, 3);
    self->resize(w, h);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "resize: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "resize: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:lubyk,项目名称:mimas,代码行数:17,代码来源:mimas_TableView.cpp

示例8: LineEdit_move

/** void QWidget::move(int x, int y)
 * bind/QWidget.h:10
 */
static int LineEdit_move(lua_State *L) {
  try {
    LineEdit *self = *((LineEdit **)dub_checksdata(L, 1, "mimas.LineEdit"));
    int x = dub_checkint(L, 2);
    int y = dub_checkint(L, 3);
    self->move(x, y);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "move: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "move: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:lubyk,项目名称:mimas,代码行数:17,代码来源:mimas_LineEdit.cpp

示例9: btConstraintSolver_prepareSolve

/** virtual void btConstraintSolver::prepareSolve(int, int)
 * src/vendor/bullet/src/BulletDynamics/ConstraintSolver/btConstraintSolver.h:38
 */
static int btConstraintSolver_prepareSolve(lua_State *L) {
  try {
    btConstraintSolver *self = *((btConstraintSolver **)dub_checksdata(L, 1, "bt.ConstraintSolver"));
    int p1 = dub_checkint(L, 2);
    int p2 = dub_checkint(L, 3);
    self->prepareSolve(p1, p2);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "prepareSolve: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "prepareSolve: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:lubyk,项目名称:old_bt,代码行数:17,代码来源:bt_ConstraintSolver.cpp

示例10: TableView_do_edit

/** void TableView::do_edit(int row, int col)
 * include/mimas/TableView.h:110
 */
static int TableView_do_edit(lua_State *L) {
  try {
    TableView *self = *((TableView **)dub_checksdata(L, 1, "mimas.TableView"));
    int row = dub_checkint(L, 2);
    int col = dub_checkint(L, 3);
    self->do_edit(row, col);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "do_edit: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "do_edit: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:lubyk,项目名称:mimas,代码行数:17,代码来源:mimas_TableView.cpp

示例11: LineEdit_setSelection

/** void QLineEdit::setSelection(int start, int length)
 * bind/QLineEdit.h:14
 */
static int LineEdit_setSelection(lua_State *L) {
  try {
    LineEdit *self = *((LineEdit **)dub_checksdata(L, 1, "mimas.LineEdit"));
    int start = dub_checkint(L, 2);
    int length = dub_checkint(L, 3);
    self->setSelection(start, length);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setSelection: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setSelection: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:lubyk,项目名称:mimas,代码行数:17,代码来源:mimas_LineEdit.cpp

示例12: TableView_setSizePolicy

/** void QWidget::setSizePolicy(int horizontal, int vertical)
 * bind/QWidget.h:59
 */
static int TableView_setSizePolicy(lua_State *L) {
  try {
    TableView *self = *((TableView **)dub_checksdata(L, 1, "mimas.TableView"));
    int horizontal = dub_checkint(L, 2);
    int vertical = dub_checkint(L, 3);
    self->setSizePolicy((QSizePolicy::Policy)horizontal, (QSizePolicy::Policy)vertical);
    self->updateGeometry();
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setSizePolicy: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setSizePolicy: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:lubyk,项目名称:mimas,代码行数:18,代码来源:mimas_TableView.cpp

示例13: ofVbo_setIndexData

/** void ofVbo::setIndexData(const ofIndexType *indices, int total, int usage)
 * api/openFrameworks/gl/ofVbo.h:27
 */
static int ofVbo_setIndexData(lua_State *L) {
  try {
    ofVbo *self = *((ofVbo **)dub_checksdata(L, 1, "ofVbo"));
    ofIndexType *indices = *((ofIndexType **)dub_checksdata(L, 2, "ofIndexType"));
    int total = dub_checkint(L, 3);
    int usage = dub_checkint(L, 4);
    self->setIndexData(indices, total, usage);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setIndexData: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setIndexData: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:cigraphics,项目名称:ofxMoonLight,代码行数:18,代码来源:ofVbo.cpp

示例14: ofVbo_draw

/** void ofVbo::draw(int drawMode, int first, int total)
 * api/openFrameworks/gl/ofVbo.h:71
 */
static int ofVbo_draw(lua_State *L) {
  try {
    ofVbo *self = *((ofVbo **)dub_checksdata(L, 1, "ofVbo"));
    int drawMode = dub_checkint(L, 2);
    int first = dub_checkint(L, 3);
    int total = dub_checkint(L, 4);
    self->draw(drawMode, first, total);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "draw: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "draw: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:cigraphics,项目名称:ofxMoonLight,代码行数:18,代码来源:ofVbo.cpp

示例15: btDefaultCollisionConfiguration_getCollisionAlgorithmCreateFunc

/** virtual btCollisionAlgorithmCreateFunc* btDefaultCollisionConfiguration::getCollisionAlgorithmCreateFunc(int proxyType0, int proxyType1)
 * src/vendor/bullet/src/BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h:119
 */
static int btDefaultCollisionConfiguration_getCollisionAlgorithmCreateFunc(lua_State *L) {
  try {
    btDefaultCollisionConfiguration *self = *((btDefaultCollisionConfiguration **)dub_checksdata(L, 1, "bt.DefaultCollisionConfiguration"));
    int proxyType0 = dub_checkint(L, 2);
    int proxyType1 = dub_checkint(L, 3);
    btCollisionAlgorithmCreateFunc *retval__ = self->getCollisionAlgorithmCreateFunc(proxyType0, proxyType1);
    if (!retval__) return 0;
    dub_pushudata(L, retval__, "CollisionAlgorithmCreateFunc", false);
    return 1;
  } catch (std::exception &e) {
    lua_pushfstring(L, "getCollisionAlgorithmCreateFunc: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "getCollisionAlgorithmCreateFunc: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:lubyk,项目名称:old_bt,代码行数:19,代码来源:bt_DefaultCollisionConfiguration.cpp


注:本文中的dub_checkint函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。