本文整理汇总了C++中MOAILuaState::Push方法的典型用法代码示例。如果您正苦于以下问题:C++ MOAILuaState::Push方法的具体用法?C++ MOAILuaState::Push怎么用?C++ MOAILuaState::Push使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MOAILuaState
的用法示例。
在下文中一共展示了MOAILuaState::Push方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _tostring
//----------------------------------------------------------------//
int MOAILuaObject::_tostring ( lua_State* L ) {
MOAILuaState state ( L );
MOAILuaObject* data = ( MOAILuaObject* )state.GetPtrUserData ( 1 );
if ( data ) {
STLString str;
lua_getfield ( state, 1, "getClassName" );
if ( state.IsType ( -1, LUA_TFUNCTION )) {
lua_pushvalue ( state, 1 );
state.DebugCall ( 1, 1 );
cc8* classname = state.GetValue < cc8* >( -1, "" );
str.write ( "%p <%s>", data, classname );
state.Push ( str );
return 1;
}
str.write ( "%p <%s>", data, data->TypeName ());
state.Push ( str );
return 1;
}
return 0;
}
示例2: _getFrameBuffer
/** @name getMaxTextureUnits
@text Returns the frame buffer associated with the device.
@out MOAIFrameBuffer frameBuffer
*/
int MOAIGfxDevice::_getFrameBuffer ( lua_State* L ) {
MOAILuaState state ( L );
state.Push ( MOAIGfxDevice::Get ().GetDefaultBuffer ());
return 1;
}
示例3: _getFormat
//----------------------------------------------------------------//
// TODO: doxygen
int MOAIVertexFormatMgr::_getFormat ( lua_State* L ) {
MOAILuaState state ( L );
u32 formatID = state.GetValue < u32 >( 1, 0xffffffff );
state.Push ( MOAIVertexFormatMgr::Get ().GetFormat ( formatID ));
return 1;
}
示例4: _tostring
//----------------------------------------------------------------//
int MOAILuaObject::_tostring ( lua_State* L ) {
MOAILuaState state ( L );
MOAILuaObject* data = ( MOAILuaObject* )state.GetPtrUserData ( 1 );
if ( data ) {
STLString str;
str.write ( "0x%p <%s>", data, data->TypeName ()); // TODO: 64-bit
state.Push ( str );
return 1;
}
return 0;
}
示例5: _randSFMT
//----------------------------------------------------------------//
// TODO: doxygen
int MOAIMath::_randSFMT ( lua_State* L ) {
MOAILuaState state ( L );
double lower = 0.0;
double upper = 1.0;
if ( state.IsType ( 1, LUA_TNUMBER )) {
upper = state.GetValue < double >( 1, 0.0 );
if ( state.IsType ( 2, LUA_TNUMBER )) {
lower = upper;
upper = state.GetValue < double >( 2, 0.0 );
}
}
double r = sfmt_genrand_real1 ( MOAIMath::Get ().mSFMT ); // [0, 1]
state.Push ( lower + ( r * ( upper - lower )));
return 1;
}
示例6: PushInterfaceTable
//----------------------------------------------------------------//
void MOAILuaClass::PushInterfaceTable ( MOAILuaState& state ) {
state.Push ( this->mInterfaceTable );
}
示例7: PushTBWidgetOrNil
bool MOAITBWidget::PushTBWidgetOrNil( MOAILuaState& state, TBWidget* widget ) {
if( PushTBWidget( state, widget ) ) return true;
state.Push();
return false;
}