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

C++ ogre::String类代码示例

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

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



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

示例1: removeFlag

    //----------------------------------------------------------------------------------
    bool GameObject::removeFlag(Ogre::String flag)
    {
	    std::string::size_type pos1 = mFlags.find("|" + flag + "|");

	    if (pos1 == Ogre::String::npos)
	    {
		    return false;
	    }

	    ++pos1;
	    std::string::size_type pos2 = flag.length() + 1;

	    mFlags.erase(pos1, pos2);

	    return true;
    }
开发者ID:nikki93,项目名称:grall2,代码行数:17,代码来源:Ngf.cpp


示例2: SaveSoundInfoFromFile

void SoundEditDialog::SaveSoundInfoFromFile(const Ogre::String& filename)
{
    if (mSoundInfoFileChanged)
    {
        char buf[1024];
        FILE* pFile = NULL;
        pFile = ::fopen(filename.c_str(), "w");
        if(NULL == pFile)
        {
            wxMessageBox("Can't open the file, Maybe the file is missing or it is read only!");
            return;
        }

        memset(buf, 0, sizeof(buf));
        sprintf(buf, "INT\tINT\tINT\tINT\tINT\tINT\tINT\tINT\n");
        ::fwrite(buf, strlen(buf), 1, pFile);

        memset(buf, 0, sizeof(buf));
        sprintf(buf, "ID\t声音ID\t声源位置X\t声源位置Z\t有效距离\t连播次数\t间隔时间(ms)\t下一次连播间隔时间(ms)\n");
        ::fwrite(buf, strlen(buf), 1, pFile);
        
        memset(buf, 0, sizeof(buf));

        for(size_t i=0; i<mSoundItems.size(); ++i)
        {
            SoundItem* soundItem = mSoundItems[i];

            if (soundItem->mRepeatTime == 0)
            {
                sprintf(buf, "%d\t%d\t%d\t%d\t%d\n",
                    i, soundItem->mSoundID, soundItem->mXPos, soundItem->mZPos, soundItem->mRadius);
            }
            else
            {
                sprintf(buf, "%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\n",
                    i, soundItem->mSoundID, soundItem->mXPos, soundItem->mZPos, soundItem->mRadius,
                    soundItem->mRepeatTime, soundItem->mRepeatIntervalTime, soundItem->mNextRepeatTime);
            }

            ::fwrite(buf, strlen(buf), 1, pFile);
        }

        ::fclose(pFile);

        mSoundInfoFileChanged = false;
    }
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:47,代码来源:SoundEditDlg.cpp


示例3: tryLoadResource

Ogre::ResourcePtr
loadCorrelativeResource(const Ogre::String& resourceName, const Ogre::String& groupName,
                        const Ogre::String& baseResourceName, const Ogre::String& baseGroupName,
                        Ogre::ResourceManager& resourceManager)
{
    Ogre::ResourcePtr res;

   Ogre::String name, path;
    Ogre::StringUtil::splitFilename(resourceName, name, path);
    bool existsPath = !path.empty();

    // First, load in correlatived group and path if resource name doesn't exists path
    if (!existsPath)
    {
        Ogre::StringUtil::splitFilename(baseResourceName, name, path);
        if (!path.empty())
        {
            name = path + resourceName;
            res = tryLoadResource(resourceManager, name, baseGroupName);
            if (!res.isNull())
                return res;
        }
    }

    // Second, load in correlatived group
    res = tryLoadResource(resourceManager, resourceName, baseGroupName);
    if (!res.isNull())
        return res;

    // Three, load in user given group
    if (!groupName.empty())
    {
        res = tryLoadResource(resourceManager, resourceName, groupName);
        if (!res.isNull())
            return res;
    }

    // Four, load in global default group
    if (groupName != DEFAULT_RESOURCE_GROUP_NAME)
    {
        res = tryLoadResource(resourceManager, resourceName, groupName);
        if (!res.isNull())
            return res;
    }

    return res;
}
开发者ID:dodong471520,项目名称:pap,代码行数:47,代码来源:FairyResources.cpp


示例4: _writeFile

//-----------------------------------------------------------------------------
int COFSSceneSerializer::_writeFile(Ogre::String exportfile, const bool forceSave)
{
    if (exportfile.empty())
        return SCF_ERRUNKNOWN;

    OgitorsRoot *ogRoot = OgitorsRoot::getSingletonPtr();
    // Open a stream to output our XML Content and write the general headercopyFile
    std::stringstream outfile;

    outfile << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
    outfile << "<OGITORSCENE version=\"" << Globals::OGSCENE_FORMAT_VERSION << "\">\n";

    PROJECTOPTIONS *pOpt = ogRoot->GetProjectOptions();
    pOpt->CameraSpeed = ogRoot->GetViewport()->GetCameraSpeed();

    ogRoot->WriteProjectOptions(outfile, pOpt);

    ObjectVector ObjectList;
    OgitorsPropertyValueMap theList;
    OgitorsPropertyValueMap::iterator ni;

    // Start from 1, since 0 means all objects
    for(unsigned int i = 1; i < LAST_EDITOR; i++)
    {
        ogRoot->GetObjectList(i, ObjectList);
        for(unsigned int ob = 0; ob < ObjectList.size(); ob++)
        {
            /// If Object does not have a parent, then it is not part of the scene
            if(ObjectList[ob]->getParent())
            {
                ObjectList[ob]->onSave(forceSave);
                if(ObjectList[ob]->isSerializable())
                {
                    outfile << OgitorsUtils::GetObjectSaveStringV2(ObjectList[ob], 2, true, true).c_str();
                    outfile << "\n";
                }
            }
        }
    }
    outfile << "</OGITORSCENE>\n";

    if (OgitorsUtils::SaveStreamOfs(outfile, exportfile)) {
        return SCF_OK;
    }

    return SCF_ERRFILE;
}
开发者ID:jacmoe,项目名称:ogitor,代码行数:48,代码来源:OFSSceneSerializer.cpp


示例5: GetObjectListByCustomProperty

//-----------------------------------------------------------------------------------------
void OgitorsRoot::GetObjectListByCustomProperty(unsigned int type, const Ogre::String& nameregexp, bool inverse, ObjectVector& list)
{
    list.clear();

    try
    {
        const boost::regex e(nameregexp.c_str());

        NameObjectPairList::iterator list_st, list_ed;

        if(type == 0)
        {
            list_st = mNameList.begin();
            list_ed = mNameList.end();
        }
        else
        {
            list_st = mNamesByType[type].begin();
            list_ed = mNamesByType[type].end();
        }

        OgitorsPropertyVector pvec;

        while(list_st != list_ed)
        {
            pvec = list_st->second->getCustomProperties()->getPropertyVector();
            bool add_list = false;
            for(unsigned int k = 0;k < pvec.size();k++)
            {
                if(regex_match(pvec[k]->getName().c_str(), e))
                {
                    add_list = true;
                    break;
                }
            }
            
            if(add_list != inverse)
                list.push_back(list_st->second);
            
            list_st++;
        }
    }
    catch(...)
    {
        list.clear();
    }
}
开发者ID:EternalWind,项目名称:Ogitor-Facade,代码行数:48,代码来源:OgitorsRootRegExp.cpp


示例6: save

void Cube::save(Ogre::String file)
{
  if (rndCounter == 0)
  {
    std::ofstream output(file.c_str());

    // Write cube size
    output << size << std::endl;

    for (int i = 0; i < size; ++i)
      for (int j = 0; j < size; ++j)
        for (int k = 0; k < size; ++k)
        {
          CubeElement *e = data[i][j][k];
          Ogre::Entity *ent = static_cast<Ogre::Entity*>(e->node->getAttachedObject(0));
          Ogre::SceneNode *node = e->node;
          // Write name, indexes and position
          output << node->getName() << "\n"
                 << "\t" << i << " " << j << " " << k << "\n" // index in data array
                 << "\t" << node->getPosition().x << " " << node->getPosition().y << " " << node->getPosition().z << "\n"; // position
          // Write orientation
          Ogre::Vector3 orient_axis;
          Ogre::Degree orient_angle;
          node->getOrientation().ToAngleAxis(orient_angle, orient_axis);
          output << "\t" << orient_axis.x << " " << orient_axis.y << " " << orient_axis.z << " " // orientation axis
                 << orient_angle.valueDegrees() << "\n"; // orientation angle
          output << "\t" << ent->getSubEntity(0)->getMaterialName() << "\n"
                 << "\t" << ent->getSubEntity(1)->getMaterialName() << "\n"
                 << "\t" << ent->getSubEntity(2)->getMaterialName() << "\n"
                 << "\t" << ent->getSubEntity(3)->getMaterialName() << "\n"
                 << "\t" << ent->getSubEntity(4)->getMaterialName() << "\n"
                 << "\t" << ent->getSubEntity(5)->getMaterialName() << "\n";
          // Write pivot info
          output << "\t" << e->isPivot << "\n";
          if (e->isPivot)
          {
            // pivot indexes
            output << "\t" << e->pivotArrays[0] << " " << e->pivotArrayIndexes[0] << "\n"
                   << "\t" << e->pivotArrays[1] << " " << e->pivotArrayIndexes[1] << "\n";
          }
          // flush
          output << std::endl;
        }

    output.close();
  }
}
开发者ID:0xc0dec,项目名称:yarc,代码行数:47,代码来源:Cube.cpp


示例7: doConnect

bool NetworkManager::doConnect( Ogre::String serverIP, Ogre::ushort serverPort )
{
	mConnectAtemp = true;

	switch(mRakPeer->Connect(serverIP.c_str(), serverPort, 0, 0, 0))
	{
	case RakNet::CONNECTION_ATTEMPT_STARTED:
		{
			Ogre::LogManager::getSingletonPtr()
				->logMessage(RealToys::logMessagePrefix + "CONNECTION_ATTEMPT_STARTED");
			return true;
			break;
		}
	case RakNet::INVALID_PARAMETER:
		{
			Ogre::LogManager::getSingletonPtr()
				->logMessage(RealToys::logMessagePrefix + "INVALID_PARAMETER");
			break;
		}
	case RakNet::CANNOT_RESOLVE_DOMAIN_NAME:
		{
			Ogre::LogManager::getSingletonPtr()
				->logMessage(RealToys::logMessagePrefix + "CANNOT_RESOLVE_DOMAIN_NAME");
			break;
		}
	case RakNet::ALREADY_CONNECTED_TO_ENDPOINT:
		{
			Ogre::LogManager::getSingletonPtr()
				->logMessage(RealToys::logMessagePrefix + "ALREADY_CONNECTED_TO_ENDPOINT");
			break;
		}
	case RakNet::CONNECTION_ATTEMPT_ALREADY_IN_PROGRESS:
		{
			Ogre::LogManager::getSingletonPtr()
				->logMessage(RealToys::logMessagePrefix + "CONNECTION_ATTEMPT_ALREADY_IN_PROGRESS");
			break;
		}
	case RakNet::SECURITY_INITIALIZATION_FAILED:
		{
			Ogre::LogManager::getSingletonPtr()
				->logMessage(RealToys::logMessagePrefix + "SECURITY_INITIALIZATION_FAILED");
			break;
		}
	}

	return false;	
}
开发者ID:abmantis,项目名称:realtoys-aircombat,代码行数:47,代码来源:NetworkManager.cpp


示例8: fnmatch

bool fnmatch (Ogre::String pattern, Ogre::String name, int dummy)
{
	if (pattern == "*")
	{
		return true;
	}
	if (pattern.substr(0,2) == "*.")
	{
		Ogre::StringUtil::toLowerCase(pattern);
		Ogre::StringUtil::toLowerCase(name);
		Ogre::String extToFind = pattern.substr(2, pattern.size() - 2);
		if ((name.size() > extToFind.size()) &&(extToFind == name.substr(name.size() - extToFind.size(), extToFind.size())))
		{
			return 0; // match
		}
		else
		{
			return 1; // don't match
		}
	}
	return false;
}
开发者ID:airgames,项目名称:vuforia-gamekit-integration,代码行数:22,代码来源:OgreSearchOps.cpp


示例9: mpCam

MovableTextOverlayAttributes::MovableTextOverlayAttributes(const Ogre::String & name, const Ogre::Camera *cam,
						 const Ogre::String & fontName, int charHeight, const Ogre::ColourValue & color, const Ogre::String & materialName)
: mpCam(cam)
, mpFont(NULL)
, mName(name)
, mFontName("")
, mMaterialName("")
, mCharHeight(charHeight)
, mColor(ColourValue::ZERO)
{
	if (fontName.length() == 0)
        Ogre::Exception(Ogre::Exception::ERR_INVALIDPARAMS, "Invalid font name", "MovableTextOverlayAttributes::MovableTextOverlayAttributes");

	setFontName(fontName);
	setMaterialName(materialName);
	setColor(color);
}
开发者ID:allenjacksonmaxplayio,项目名称:uhasseltaacgua,代码行数:17,代码来源:MovableTextOverlay.cpp


示例10: writeXMLFile

    //-----------------------------------------------------------------------
    void XercesWriter::writeXMLFile(const XMLNode* root, const Ogre::String& filename)
    {
        XERCES_CPP_NAMESPACE_USE;

        DOMImplementation* impl = DOMImplementationRegistry::getDOMImplementation(L"Core");
        DOMDocumentType* docType = NULL;
        DOMDocument* doc = impl->createDocument(NULL, transcode(root->getName()).c_str(), docType);

        populateDOMElement(root, doc->getDocumentElement());

        LocalFileFormatTarget destination(filename.c_str());
        DOMWriter* writer = impl->createDOMWriter();
        writer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, true);
        writer->writeNode(&destination, *doc);
        writer->release();
        doc->release();
    }
开发者ID:dodong471520,项目名称:pap,代码行数:18,代码来源:FairyXercesWriter.cpp


示例11: saveAll

bool OgreDetourTileCache::saveAll(Ogre::String filename)
{
    if (!m_tileCache) {
        Ogre::LogManager::getSingletonPtr()->logMessage("Error: OgreDetourTileCache::saveAll("+filename+"). Could not save tilecache, no tilecache to save.");
        return false;
    }

       FILE* fp = fopen(filename.data(), "wb");
       if (!fp) {
           Ogre::LogManager::getSingletonPtr()->logMessage("Error: OgreDetourTileCache::saveAll("+filename+"). Could not save file.");
           return false;
       }

// Store header.
       TileCacheSetHeader header;
       header.magic = TILECACHESET_MAGIC;
       header.version = TILECACHESET_VERSION;
       header.numTiles = 0;
       for (int i = 0; i < m_tileCache->getTileCount(); ++i)
       {
               const dtCompressedTile* tile = m_tileCache->getTile(i);
               if (!tile || !tile->header || !tile->dataSize) continue;
               header.numTiles++;
       }
       memcpy(&header.cacheParams, m_tileCache->getParams(), sizeof(dtTileCacheParams));
       memcpy(&header.meshParams, m_recast->m_navMesh->getParams(), sizeof(dtNavMeshParams));
       memcpy(&header.recastConfig, &m_cfg, sizeof(rcConfig));
       fwrite(&header, sizeof(TileCacheSetHeader), 1, fp);

       // Store tiles.
       for (int i = 0; i < m_tileCache->getTileCount(); ++i)
       {
               const dtCompressedTile* tile = m_tileCache->getTile(i);
               if (!tile || !tile->header || !tile->dataSize) continue;

               TileCacheTileHeader tileHeader;
               tileHeader.tileRef = m_tileCache->getTileRef(tile);
               tileHeader.dataSize = tile->dataSize;
               fwrite(&tileHeader, sizeof(tileHeader), 1, fp);

               fwrite(tile->data, tile->dataSize, 1, fp);
       }

       fclose(fp);
       return true;
}
开发者ID:Unix4ever,项目名称:engine,代码行数:46,代码来源:OgreDetourTileCache.cpp


示例12: HasAttribute

bool LuaScriptUtilities::HasAttribute(
    lua_State* const luaVM,
    const int tableIndex,
    const Ogre::String& attributeName)
{
    if (!lua_istable(luaVM, tableIndex))
        return false;

    lua_pushstring(luaVM, attributeName.c_str());
    lua_gettable(luaVM, tableIndex);

    const bool result = lua_isnil(luaVM, -1);

    lua_pop(luaVM, 1);

    return !result;
}
开发者ID:Bewolf2,项目名称:LearningGameAI,代码行数:17,代码来源:LuaScriptUtilities.cpp


示例13: exportCollision

  void CollisionSerializer::exportCollision(const CollisionPtr& collision, const Ogre::String& filename)
  {
    if( !collision )
        OGRE_EXCEPT(Ogre::Exception::ERR_INVALIDPARAMS, "Argument collision is NULL","CollisionSerializer::exportCollision");

    mpfFile=fopen(filename.c_str(),"wb");
    
    if (!mpfFile)
    {
        OGRE_EXCEPT(Ogre::Exception::ERR_INVALIDPARAMS, "Unable to open file " + filename + " for writing","CollisionSerializer::exportCollision");
    }

    NewtonCollisionSerialize(collision->getWorld()->getNewtonWorld(), collision->m_col, &CollisionSerializer::_newtonSerializeCallback, this);


    fclose(mpfFile);
  }
开发者ID:Mononofu,项目名称:OTE,代码行数:17,代码来源:OgreNewt_CollisionSerializer.cpp


示例14: GetRealAttribute

Ogre::Real LuaScriptUtilities::GetRealAttribute(
    lua_State* const luaVM,
    const Ogre::String attributeName,
    const int tableIndex)
{
    if (!lua_istable(luaVM, tableIndex))
        return Ogre::Real();

    lua_pushstring(luaVM, attributeName.c_str());
    lua_gettable(luaVM, tableIndex);

    Ogre::Real value = lua_tonumber(luaVM, -1);

    lua_pop(luaVM, 1);

    return value;
}
开发者ID:Bewolf2,项目名称:LearningGameAI,代码行数:17,代码来源:LuaScriptUtilities.cpp


示例15: lock

void
AudioManager::Player::Play( const Ogre::String &file )
{
    boost::recursive_mutex::scoped_lock lock( *m_UpdateMutex );

    // open vorbis file
    if( ov_fopen( const_cast< char* >( file.c_str() ), &m_VorbisFile ) )
    {
        LOG_ERROR( "Can't play file \"" + file + "\"." );
        return;
    }

    // get file info
    m_VorbisInfo = ov_info( &m_VorbisFile, -1.0f );

    // create sound source
    alGenSources( 1, &m_Source );

    // create buffers
    ALuint buffers[ m_ChannelBufferNumber ];
    alGenBuffers( m_ChannelBufferNumber, buffers );

    // set source parameters
    alSourcei( m_Source, AL_LOOPING, AL_FALSE );

    // fill buffers
    for( int i = 0; i < m_ChannelBufferNumber; ++i )
    {
        ALsizei buffer_size = FillBuffer();

        if( buffer_size )
        {
            alBufferData( buffers[ i ], m_VorbisInfo->channels == 1 ? AL_FORMAT_MONO16 : AL_FORMAT_STEREO16, ( const ALvoid* )AudioManager::getSingleton().m_Buffer, ( ALsizei )buffer_size, ( ALsizei )m_VorbisInfo->rate );
            alSourceQueueBuffers( m_Source, 1, &buffers[ i ] );
        }
        else
        {
            m_StreamFinished = true;
            alDeleteBuffers( 1, &buffers[ i ] );
        }
    }

    // start playback
    alSourcePlay( m_Source );
}
开发者ID:sasukeuni,项目名称:q-gears,代码行数:45,代码来源:AudioManager.cpp


示例16: initialise

//-----------------------------------------------------------------------
void AtlasImageTool::initialise (const Ogre::String& configFileName)
{
	if (!configFileName.empty())
	{
		mConfigFile.load(configFileName);
	}
	else
	{
		mConfigFile.load("atlas.cfg");
	}

	mInputFileNames = Ogre::StringUtil::split(mConfigFile.getSetting("InputImage"), ";, ");
	mInputFrames = Ogre::StringUtil::split(mConfigFile.getSetting("Frame"), ";, ");
	mAlpha = Ogre::StringUtil::split(mConfigFile.getSetting("Alpha"), ";, ");
	mOutputImage = mConfigFile.getSetting("OutputImage");
	mImagePath = mConfigFile.getSetting("ImagePath");
	mAtlasImage.setAlwaysUpdate(false); // Manual compilation to speed things up.
}
开发者ID:hsl9999,项目名称:particleuniverse,代码行数:19,代码来源:AtlasImageTool.cpp


示例17:

	MainSkin::MainSkin(const SubWidgetInfo& _info, const Ogre::String& _material, CroppedRectanglePtr _parent, size_t _id) : 
		CroppedRectangleInterface(_info.coord, _info.align, _parent)
	{

		Ogre::OverlayManager& overlayManager = Ogre::OverlayManager::getSingleton();

		mOverlayContainer = static_cast<SharedPanelAlphaOverlayElement*>( overlayManager.createOverlayElement(
			"SharedPanelAlpha", utility::toString("MainSkin_", this)) );

		// устанавливаем колличество саб оверлеев
		mOverlayContainer->setCountSharedOverlay(1);

		//mOverlayContainer->setMetricsMode(Ogre::GMM_PIXELS);
		mOverlayContainer->setPositionInfo(mParent->getLeft() + mCoord.left, mParent->getTop() + mCoord.top, mCoord.width, mCoord.height, 0);
		if (false == _material.empty() && (_info.coord.width != 0)) mOverlayContainer->setMaterialName(_material);

		mParent->_attachChild(this, false);
	}
开发者ID:MyGUI,项目名称:mygui-historical,代码行数:18,代码来源:MyGUI_MainSkin.cpp


示例18: LoadXml

bool TracksXml::LoadXml(Ogre::String file)
{
	TiXmlDocument doc;
	if (!doc.LoadFile(file.c_str()))  return false;
		
	TiXmlElement* root = doc.RootElement();
	if (!root)  return false;

	//  clear
	//Default();
	trks.clear();  trkmap.clear();

	///  tracks
	const char* a;  int i=1;  //0 = none
	TiXmlElement* eTrk = root->FirstChildElement("track");
	while (eTrk)
	{
		TrackInfo t;
		a = eTrk->Attribute("n");			if (a)  t.n = s2i(a);
		a = eTrk->Attribute("name");		if (a)  t.name = std::string(a);
		a = eTrk->Attribute("created");		if (a)  t.created = s2dt(a);
		a = eTrk->Attribute("crtver");		if (a)  t.crtver = s2r(a);
		a = eTrk->Attribute("modified");	if (a)  t.modified = s2dt(a);
		a = eTrk->Attribute("scenery");		if (a)  t.scenery = std::string(a);
		a = eTrk->Attribute("author");		if (a)  t.author = std::string(a);

		a = eTrk->Attribute("fluids");		if (a)  t.fluids = s2i(a);
		a = eTrk->Attribute("bumps");		if (a)  t.bumps = s2i(a);	a = eTrk->Attribute("jumps");		if (a)  t.jumps = s2i(a);
		a = eTrk->Attribute("loops");		if (a)  t.loops = s2i(a);	a = eTrk->Attribute("pipes");		if (a)  t.pipes = s2i(a);
		a = eTrk->Attribute("banked");		if (a)  t.banked = s2i(a);	a = eTrk->Attribute("frenzy");		if (a)  t.frenzy = s2i(a);
		a = eTrk->Attribute("long");		if (a)  t.longn = s2i(a);

		a = eTrk->Attribute("diff");		if (a)  t.diff = s2i(a);
		a = eTrk->Attribute("rating");		if (a)  t.rating = s2i(a);
		a = eTrk->Attribute("rateuser");	if (a)  t.rateuser = s2i(a);
		a = eTrk->Attribute("drivenlaps");	if (a)  t.drivenlaps = s2i(a);

		trks.push_back(t);
		//trkmap[t.name] = &trks.back();
		trkmap[t.name] = i++;
		eTrk = eTrk->NextSiblingElement("track");
	}
	return true;
}
开发者ID:jsj2008,项目名称:stuntrally,代码行数:44,代码来源:TracksXml.cpp


示例19: createWindow

NativeWindowPair ApplicationContextSDL::createWindow(const Ogre::String& name, Ogre::uint32 w, Ogre::uint32 h, Ogre::NameValuePairList miscParams)
{
    NativeWindowPair ret = {NULL, NULL};
    parseWindowOptions(w, h, miscParams);

    Ogre::ConfigOptionMap& ropts = mRoot->getRenderSystem()->getConfigOptions();

    if(!SDL_WasInit(SDL_INIT_VIDEO)) {
        SDL_InitSubSystem(SDL_INIT_VIDEO);
    }

    Uint32 flags = SDL_WINDOW_RESIZABLE;

    if(ropts["Full Screen"].currentValue == "Yes"){
       flags = SDL_WINDOW_FULLSCREEN;
    } else {
       flags = SDL_WINDOW_RESIZABLE;
    }

    ret.native = SDL_CreateWindow(name.c_str(),
                                SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, w, h, flags);

#if OGRE_PLATFORM == OGRE_PLATFORM_EMSCRIPTEN
    SDL_GL_CreateContext(ret.native);
    miscParams["currentGLContext"] = "true";
#else
    SDL_SysWMinfo wmInfo;
    SDL_VERSION(&wmInfo.version);
    SDL_GetWindowWMInfo(ret.native, &wmInfo);
#endif

#if OGRE_PLATFORM == OGRE_PLATFORM_LINUX
    miscParams["parentWindowHandle"] = Ogre::StringConverter::toString(size_t(wmInfo.info.x11.window));
#elif OGRE_PLATFORM == OGRE_PLATFORM_WIN32
    miscParams["externalWindowHandle"] = Ogre::StringConverter::toString(size_t(wmInfo.info.win.window));
#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE
    assert(wmInfo.subsystem == SDL_SYSWM_COCOA);
    miscParams["externalWindowHandle"] = Ogre::StringConverter::toString(size_t(wmInfo.info.cocoa.window));
#endif

    ret.render = mRoot->createRenderWindow(name, w, h, false, &miscParams);
    mWindows.push_back(ret);
    return ret;
}
开发者ID:yiliu1203,项目名称:OGRE,代码行数:44,代码来源:OgreApplicationContextSDL.cpp


示例20: CreateBoneData

void BoneCollisionManager::CreateBoneData(Ogre::Bone *q, Ogre::String Type, Ogre::Vector3 D, Ogre::String MeshName)
{
	Ogre::String Line;

	if (mFile == NULL)
	{
		mFile = fopen((MeshName.c_str()), "w");
	}

	//Write Top Compoment
	Line = "[" + q->getName() + "]"  + "\n";
	fwrite(Line.c_str(), 1, strlen(Line.c_str()), mFile);

	//Write Bone Name
	Line = "boneName=" + q->getName() + "\n";
	//fputs(Line.c_str(),mFile);
	fwrite(Line.c_str(), 1, strlen(Line.c_str()), mFile);

	//Write Type
	Line = "actorShape="+Type+"\n";
	//fputs(Line.c_str(),mFile);
	fwrite(Line.c_str(), 1, strlen(Line.c_str()), mFile);

	//Write Dimensions
	std::stringstream s;
	std::stringstream ss;
	std::stringstream sss;
	s << D.x;
	ss << D.y;
	sss << D.z;
	Line = "dimensions=";
	Line += s.str()+" "+ss.str()+" "+sss.str()+"\n"+"\n";
	fputs(Line.c_str(),mFile);
	
	fflush(mFile);
}
开发者ID:dtbinh,项目名称:mbapengine,代码行数:36,代码来源:BoneCollisionManager.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ ogre::StringStream类代码示例发布时间:2022-05-31
下一篇:
C++ ogre::SkeletonPtr类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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