本文整理汇总了C++中duk_require_number函数的典型用法代码示例。如果您正苦于以下问题:C++ duk_require_number函数的具体用法?C++ duk_require_number怎么用?C++ duk_require_number使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了duk_require_number函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: Terrain_GetTerrainHeightRange_float_float
static duk_ret_t Terrain_GetTerrainHeightRange_float_float(duk_context* ctx)
{
Terrain* thisObj = GetThisWeakObject<Terrain>(ctx);
float minHeight = (float)duk_require_number(ctx, 0);
float maxHeight = (float)duk_require_number(ctx, 1);
thisObj->GetTerrainHeightRange(minHeight, maxHeight);
return 0;
}
开发者ID:realXtend,项目名称:tundra-urho3d,代码行数:8,代码来源:TerrainBindings.cpp
示例2: Line_ProjectToAxis_float3_float_float
static duk_ret_t Line_ProjectToAxis_float3_float_float(duk_context* ctx)
{
Line* thisObj = GetThisValueObject<Line>(ctx, Line_ID);
float3& direction = *GetCheckedValueObject<float3>(ctx, 0, float3_ID);
float outMin = (float)duk_require_number(ctx, 1);
float outMax = (float)duk_require_number(ctx, 2);
thisObj->ProjectToAxis(direction, outMin, outMax);
return 0;
}
开发者ID:realXtend,项目名称:tundra-urho3d,代码行数:9,代码来源:LineBindings.cpp
示例3: Terrain_PatchExists_uint_uint
static duk_ret_t Terrain_PatchExists_uint_uint(duk_context* ctx)
{
Terrain* thisObj = GetThisWeakObject<Terrain>(ctx);
uint patchX = (uint)duk_require_number(ctx, 0);
uint patchY = (uint)duk_require_number(ctx, 1);
bool ret = thisObj->PatchExists(patchX, patchY);
duk_push_boolean(ctx, ret);
return 1;
}
开发者ID:realXtend,项目名称:tundra-urho3d,代码行数:9,代码来源:TerrainBindings.cpp
示例4: Terrain_GetPoint_uint_uint
static duk_ret_t Terrain_GetPoint_uint_uint(duk_context* ctx)
{
Terrain* thisObj = GetThisWeakObject<Terrain>(ctx);
uint x = (uint)duk_require_number(ctx, 0);
uint y = (uint)duk_require_number(ctx, 1);
float ret = thisObj->GetPoint(x, y);
duk_push_number(ctx, ret);
return 1;
}
开发者ID:realXtend,项目名称:tundra-urho3d,代码行数:9,代码来源:TerrainBindings.cpp
示例5: Terrain_SetPointHeight_uint_uint_float
static duk_ret_t Terrain_SetPointHeight_uint_uint_float(duk_context* ctx)
{
Terrain* thisObj = GetThisWeakObject<Terrain>(ctx);
uint x = (uint)duk_require_number(ctx, 0);
uint y = (uint)duk_require_number(ctx, 1);
float height = (float)duk_require_number(ctx, 2);
thisObj->SetPointHeight(x, y, height);
return 0;
}
开发者ID:realXtend,项目名称:tundra-urho3d,代码行数:9,代码来源:TerrainBindings.cpp
示例6: Terrain_MakePatchFlat_uint_uint_float
static duk_ret_t Terrain_MakePatchFlat_uint_uint_float(duk_context* ctx)
{
Terrain* thisObj = GetThisWeakObject<Terrain>(ctx);
uint patchX = (uint)duk_require_number(ctx, 0);
uint patchY = (uint)duk_require_number(ctx, 1);
float heightValue = (float)duk_require_number(ctx, 2);
thisObj->MakePatchFlat(patchX, patchY, heightValue);
return 0;
}
开发者ID:realXtend,项目名称:tundra-urho3d,代码行数:9,代码来源:TerrainBindings.cpp
示例7: Line_ToLineSegment_float_float
static duk_ret_t Line_ToLineSegment_float_float(duk_context* ctx)
{
Line* thisObj = GetThisValueObject<Line>(ctx, Line_ID);
float dStart = (float)duk_require_number(ctx, 0);
float dEnd = (float)duk_require_number(ctx, 1);
LineSegment ret = thisObj->ToLineSegment(dStart, dEnd);
PushValueObjectCopy<LineSegment>(ctx, ret, LineSegment_ID, LineSegment_Finalizer);
return 1;
}
开发者ID:realXtend,项目名称:tundra-urho3d,代码行数:9,代码来源:LineBindings.cpp
示例8: Line_Distance_LineSegment_float_float
static duk_ret_t Line_Distance_LineSegment_float_float(duk_context* ctx)
{
Line* thisObj = GetThisValueObject<Line>(ctx, Line_ID);
LineSegment& other = *GetCheckedValueObject<LineSegment>(ctx, 0, LineSegment_ID);
float d = (float)duk_require_number(ctx, 1);
float d2 = (float)duk_require_number(ctx, 2);
float ret = thisObj->Distance(other, d, d2);
duk_push_number(ctx, ret);
return 1;
}
开发者ID:realXtend,项目名称:tundra-urho3d,代码行数:10,代码来源:LineBindings.cpp
示例9: Line_ClosestPoint_LineSegment_float_float
static duk_ret_t Line_ClosestPoint_LineSegment_float_float(duk_context* ctx)
{
Line* thisObj = GetThisValueObject<Line>(ctx, Line_ID);
LineSegment& other = *GetCheckedValueObject<LineSegment>(ctx, 0, LineSegment_ID);
float d = (float)duk_require_number(ctx, 1);
float d2 = (float)duk_require_number(ctx, 2);
float3 ret = thisObj->ClosestPoint(other, d, d2);
PushValueObjectCopy<float3>(ctx, ret, float3_ID, float3_Finalizer);
return 1;
}
开发者ID:realXtend,项目名称:tundra-urho3d,代码行数:10,代码来源:LineBindings.cpp
示例10: Terrain_LoadFromImageFile_String_float_float
static duk_ret_t Terrain_LoadFromImageFile_String_float_float(duk_context* ctx)
{
Terrain* thisObj = GetThisWeakObject<Terrain>(ctx);
String filename = duk_require_string(ctx, 0);
float offset = (float)duk_require_number(ctx, 1);
float scale = (float)duk_require_number(ctx, 2);
bool ret = thisObj->LoadFromImageFile(filename, offset, scale);
duk_push_boolean(ctx, ret);
return 1;
}
开发者ID:realXtend,项目名称:tundra-urho3d,代码行数:10,代码来源:TerrainBindings.cpp
示例11: Line_Intersects_OBB_float_float
static duk_ret_t Line_Intersects_OBB_float_float(duk_context* ctx)
{
Line* thisObj = GetThisValueObject<Line>(ctx, Line_ID);
OBB& obb = *GetCheckedValueObject<OBB>(ctx, 0, OBB_ID);
float dNear = (float)duk_require_number(ctx, 1);
float dFar = (float)duk_require_number(ctx, 2);
bool ret = thisObj->Intersects(obb, dNear, dFar);
duk_push_boolean(ctx, ret);
return 1;
}
开发者ID:realXtend,项目名称:tundra-urho3d,代码行数:10,代码来源:LineBindings.cpp
示例12: Line_ClosestPointLineLine_Static_float3_float3_float3_float3_float_float
static duk_ret_t Line_ClosestPointLineLine_Static_float3_float3_float3_float3_float_float(duk_context* ctx)
{
float3& start0 = *GetCheckedValueObject<float3>(ctx, 0, float3_ID);
float3& dir0 = *GetCheckedValueObject<float3>(ctx, 1, float3_ID);
float3& start1 = *GetCheckedValueObject<float3>(ctx, 2, float3_ID);
float3& dir1 = *GetCheckedValueObject<float3>(ctx, 3, float3_ID);
float d = (float)duk_require_number(ctx, 4);
float d2 = (float)duk_require_number(ctx, 5);
Line::ClosestPointLineLine(start0, dir0, start1, dir1, d, d2);
return 0;
}
开发者ID:realXtend,项目名称:tundra-urho3d,代码行数:11,代码来源:LineBindings.cpp
示例13: Terrain_Resize_uint_uint_uint_uint
static duk_ret_t Terrain_Resize_uint_uint_uint_uint(duk_context* ctx)
{
int numArgs = duk_get_top(ctx);
Terrain* thisObj = GetThisWeakObject<Terrain>(ctx);
uint newWidth = (uint)duk_require_number(ctx, 0);
uint newHeight = (uint)duk_require_number(ctx, 1);
uint oldPatchStartX = numArgs > 2 ? (uint)duk_require_number(ctx, 2) : 0;
uint oldPatchStartY = numArgs > 3 ? (uint)duk_require_number(ctx, 3) : 0;
thisObj->Resize(newWidth, newHeight, oldPatchStartX, oldPatchStartY);
return 0;
}
开发者ID:realXtend,项目名称:tundra-urho3d,代码行数:11,代码来源:TerrainBindings.cpp
示例14: SignalWrapper_RigidBody_NewPhysicsCollision_Emit
static duk_ret_t SignalWrapper_RigidBody_NewPhysicsCollision_Emit(duk_context* ctx)
{
SignalWrapper_RigidBody_NewPhysicsCollision* wrapper = GetThisValueObject<SignalWrapper_RigidBody_NewPhysicsCollision>(ctx, SignalWrapper_RigidBody_NewPhysicsCollision_ID);
if (!wrapper->owner_) return 0;
Entity* param0 = GetWeakObject<Entity>(ctx, 0);
float3& param1 = *GetCheckedValueObject<float3>(ctx, 1, float3_ID);
float3& param2 = *GetCheckedValueObject<float3>(ctx, 2, float3_ID);
float param3 = (float)duk_require_number(ctx, 3);
float param4 = (float)duk_require_number(ctx, 4);
wrapper->signal_->Emit(param0, param1, param2, param3, param4);
return 0;
}
开发者ID:realXtend,项目名称:tundra-urho3d,代码行数:12,代码来源:RigidBodyBindings.cpp
示例15: js_getentint
int js_getentint(duk_context* c) {
int index = duk_require_number(c,-1);
int offset = duk_require_number(c,-2);
ENTITY* ent = game->getEntity(index);
if(ent) {
int value;
ent->get(offset, &value, sizeof(value));
duk_push_int(c,value);
} else {
duk_push_int(c,0);
}
return 1;
}
开发者ID:AnasBunny,项目名称:CoDExtended,代码行数:13,代码来源:js.cpp
示例16: PhysicsWorld_Raycast_float3_float3_float_int_int
static duk_ret_t PhysicsWorld_Raycast_float3_float3_float_int_int(duk_context* ctx)
{
int numArgs = duk_get_top(ctx);
PhysicsWorld* thisObj = GetThisWeakObject<PhysicsWorld>(ctx);
float3& origin = *GetCheckedValueObject<float3>(ctx, 0, float3_ID);
float3& direction = *GetCheckedValueObject<float3>(ctx, 1, float3_ID);
float maxDistance = (float)duk_require_number(ctx, 2);
int collisionGroup = numArgs > 3 ? (int)duk_require_number(ctx, 3) : -1;
int collisionMask = numArgs > 4 ? (int)duk_require_number(ctx, 4) : -1;
PhysicsRaycastResult ret = thisObj->Raycast(origin, direction, maxDistance, collisionGroup, collisionMask);
PushValueObjectCopy<PhysicsRaycastResult>(ctx, ret, PhysicsRaycastResult_ID, PhysicsRaycastResult_Finalizer);
return 1;
}
开发者ID:realXtend,项目名称:tundra-urho3d,代码行数:13,代码来源:PhysicsWorldBindings.cpp
示例17: SignalWrapper_PhysicsWorld_PhysicsCollision_Emit
static duk_ret_t SignalWrapper_PhysicsWorld_PhysicsCollision_Emit(duk_context* ctx)
{
SignalWrapper_PhysicsWorld_PhysicsCollision* wrapper = GetThisValueObject<SignalWrapper_PhysicsWorld_PhysicsCollision>(ctx, SignalWrapper_PhysicsWorld_PhysicsCollision_ID);
if (!wrapper->owner_) return 0;
Entity* param0 = GetWeakObject<Entity>(ctx, 0);
Entity* param1 = GetWeakObject<Entity>(ctx, 1);
float3& param2 = *GetCheckedValueObject<float3>(ctx, 2, float3_ID);
float3& param3 = *GetCheckedValueObject<float3>(ctx, 3, float3_ID);
float param4 = (float)duk_require_number(ctx, 4);
float param5 = (float)duk_require_number(ctx, 5);
bool param6 = duk_require_boolean(ctx, 6);
wrapper->signal_->Emit(param0, param1, param2, param3, param4, param5, param6);
return 0;
}
开发者ID:realXtend,项目名称:tundra-urho3d,代码行数:14,代码来源:PhysicsWorldBindings.cpp
示例18: PhysicsWorld_SetMaxSubSteps_int
static duk_ret_t PhysicsWorld_SetMaxSubSteps_int(duk_context* ctx)
{
PhysicsWorld* thisObj = GetThisWeakObject<PhysicsWorld>(ctx);
int steps = (int)duk_require_number(ctx, 0);
thisObj->SetMaxSubSteps(steps);
return 0;
}
开发者ID:realXtend,项目名称:tundra-urho3d,代码行数:7,代码来源:PhysicsWorldBindings.cpp
示例19: es_file_write
/**
* fd, buffer, offset, length, position
*/
static int
es_file_write(duk_context *ctx)
{
es_fd_t *efd = es_fd_get(ctx, 0);
duk_size_t bufsize;
char *buf = duk_to_buffer(ctx, 1, &bufsize);
int len;
const int offset = duk_to_int(ctx, 2);
if(duk_is_null(ctx, 3)) {
len = bufsize;
} else {
len = duk_to_int(ctx, 3);
}
// Don't read past buffer end
if(offset + len > bufsize)
len = bufsize - offset;
if(!duk_is_null(ctx, 4)) {
// Seek
fa_seek(efd->efd_fh, duk_require_number(ctx, 4), SEEK_SET);
}
int r = fa_write(efd->efd_fh, buf + offset, len);
if(r < 0)
duk_error(ctx, DUK_ERR_ERROR, "Write error to '%s'", efd->efd_path);
duk_push_int(ctx, r);
return 1;
}
开发者ID:Ezio-PS,项目名称:movian,代码行数:34,代码来源:es_fs.c
示例20: js_Font_drawZoomedText
static duk_ret_t
js_Font_drawZoomedText(duk_context* ctx)
{
int x = duk_require_int(ctx, 0);
int y = duk_require_int(ctx, 1);
float scale = duk_require_number(ctx, 2);
const char* text = duk_to_string(ctx, 3);
ALLEGRO_BITMAP* bitmap;
font_t* font;
color_t mask;
int text_w, text_h;
duk_push_this(ctx);
font = duk_require_sphere_obj(ctx, -1, "Font");
duk_get_prop_string(ctx, -1, "\xFF" "color_mask"); mask = duk_require_sphere_color(ctx, -1); duk_pop(ctx);
duk_pop(ctx);
if (!screen_is_skipframe(g_screen)) {
text_w = get_text_width(font, text);
text_h = get_font_line_height(font);
bitmap = al_create_bitmap(text_w, text_h);
al_set_target_bitmap(bitmap);
draw_text(font, mask, 0, 0, TEXT_ALIGN_LEFT, text);
al_set_target_backbuffer(screen_display(g_screen));
al_draw_scaled_bitmap(bitmap, 0, 0, text_w, text_h, x, y, text_w * scale, text_h * scale, 0x0);
al_destroy_bitmap(bitmap);
}
return 0;
}
开发者ID:svaarala,项目名称:minisphere,代码行数:29,代码来源:font.c
注:本文中的duk_require_number函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论