• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ dub_checkint函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: btMatrix3x3_getEulerZYX

/** void btMatrix3x3::getEulerZYX(btScalar &yaw, btScalar &pitch, btScalar &roll, unsigned int solution_number=1) const
 * src/vendor/bullet/src/LinearMath/btMatrix3x3.h:517
 */
static int btMatrix3x3_getEulerZYX(lua_State *L) {
  try {
    btMatrix3x3 *self = *((btMatrix3x3 **)dub_checksdata(L, 1, "bt.Matrix3x3"));
    int top__ = lua_gettop(L);
    if (top__ >= 5) {
      btScalar yaw = dub_checknumber(L, 2);
      btScalar pitch = dub_checknumber(L, 3);
      btScalar roll = dub_checknumber(L, 4);
      unsigned int solution_number = dub_checkint(L, 5);
      self->getEulerZYX(yaw, pitch, roll, solution_number);
      return 0;
    } else {
      btScalar yaw = dub_checknumber(L, 2);
      btScalar pitch = dub_checknumber(L, 3);
      btScalar roll = dub_checknumber(L, 4);
      self->getEulerZYX(yaw, pitch, roll);
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "getEulerZYX: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "getEulerZYX: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:lubyk,项目名称:old_bt,代码行数:28,代码来源:bt_Matrix3x3.cpp


示例17: HBoxLayout_setContentsMargins

/** void QLayout::setContentsMargins(int left, int top, int right, int bottom)
 * bind/QLayout.h:15
 */
static int HBoxLayout_setContentsMargins(lua_State *L) {
  try {
    HBoxLayout *self = *((HBoxLayout **)dub_checksdata(L, 1, "mimas.HBoxLayout"));
    int left = dub_checkint(L, 2);
    int top = dub_checkint(L, 3);
    int right = dub_checkint(L, 4);
    int bottom = dub_checkint(L, 5);
    self->setContentsMargins(left, top, right, bottom);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setContentsMargins: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setContentsMargins: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:lubyk,项目名称:mimas,代码行数:19,代码来源:mimas_HBoxLayout.cpp


示例18: btMatrix3x3_cofac

/** btScalar btMatrix3x3::cofac(int r1, int c1, int r2, int c2) const
 * src/vendor/bullet/src/LinearMath/btMatrix3x3.h:723
 */
static int btMatrix3x3_cofac(lua_State *L) {
  try {
    btMatrix3x3 *self = *((btMatrix3x3 **)dub_checksdata(L, 1, "bt.Matrix3x3"));
    int r1 = dub_checkint(L, 2);
    int c1 = dub_checkint(L, 3);
    int r2 = dub_checkint(L, 4);
    int c2 = dub_checkint(L, 5);
    lua_pushnumber(L, self->cofac(r1, c1, r2, c2));
    return 1;
  } catch (std::exception &e) {
    lua_pushfstring(L, "cofac: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "cofac: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:lubyk,项目名称:old_bt,代码行数:19,代码来源:bt_Matrix3x3.cpp


示例19: ofBuffer_set

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


示例20: ofPolyline_arcNegative

/** void ofPolyline::arcNegative(const ofPoint &center, float radiusX, float radiusY, float angleBegin, float angleEnd, int curveResolution=20)
 * api/openFrameworks/graphics/ofPolyline.h:52
 */
static int ofPolyline_arcNegative(lua_State *L) {
  try {
    ofPolyline *self = *((ofPolyline **)dub_checksdata(L, 1, "ofPolyline"));
    int top__ = lua_gettop(L);
    if (top__ >= 7) {
      ofVec3f *center = *((ofVec3f **)dub_checksdata(L, 2, "ofVec3f"));
      float radiusX = dub_checknumber(L, 3);
      float radiusY = dub_checknumber(L, 4);
      float angleBegin = dub_checknumber(L, 5);
      float angleEnd = dub_checknumber(L, 6);
      int curveResolution = dub_checkint(L, 7);
      self->arcNegative(*center, radiusX, radiusY, angleBegin, angleEnd, curveResolution);
      return 0;
    } else {
      ofVec3f *center = *((ofVec3f **)dub_checksdata(L, 2, "ofVec3f"));
      float radiusX = dub_checknumber(L, 3);
      float radiusY = dub_checknumber(L, 4);
      float angleBegin = dub_checknumber(L, 5);
      float angleEnd = dub_checknumber(L, 6);
      self->arcNegative(*center, radiusX, radiusY, angleBegin, angleEnd);
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "arcNegative: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "arcNegative: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:cigraphics,项目名称:ofxMoonLight,代码行数:32,代码来源:ofPolyline.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ dub_checknumber函数代码示例发布时间:2022-05-30
下一篇:
C++ duRGBA函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap