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


C++ MOAILuaState::Push方法代码示例

本文整理汇总了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;
}
开发者ID:AzureRodrigo,项目名称:moai-dev,代码行数:27,代码来源:MOAILuaObject.cpp

示例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;
}
开发者ID:LOFI,项目名称:moai-dev,代码行数:12,代码来源:MOAIGfxDevice.cpp

示例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;
}
开发者ID:,项目名称:,代码行数:10,代码来源:

示例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;
}
开发者ID:kengonakajima,项目名称:moai-dev,代码行数:15,代码来源:MOAILuaObject.cpp

示例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;
	}
开发者ID:Heyzap,项目名称:moai-dev,代码行数:22,代码来源:MOAIMath.cpp

示例6: PushInterfaceTable

//----------------------------------------------------------------//
void MOAILuaClass::PushInterfaceTable ( MOAILuaState& state ) {

	state.Push ( this->mInterfaceTable );
}
开发者ID:nathanharper,项目名称:moai-dev,代码行数:5,代码来源:MOAILuaClass.cpp

示例7: PushTBWidgetOrNil

bool MOAITBWidget::PushTBWidgetOrNil( MOAILuaState& state, TBWidget* widget ) {
	if( PushTBWidget( state, widget ) ) return true;
	state.Push();
	return false;
}
开发者ID:tommo,项目名称:moai-tb,代码行数:5,代码来源:WidgetTypes.cpp


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