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


C++ Loader类代码示例

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


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

示例1:

Water::Water(Loader loader)
{
	float positions[] = { -1.0f, 0.0f, 1.0f, -1.0f, 0.0f, -1.0f, 1.0f, 0.0f, -1.0f, 1.0f, 0.0f, 1.0f };
	int indices[] = { 0, 1, 3, 3, 1, 2 };

	// create a ground-plane that is 2x2 meters and scale it so it becomes 100x100 meters. 
	waterplane = loader.createModel(positions, 12, indices, 6);

	Mat4 scaleMatrix;
	scaleMatrix.loadScale(150, 1, 150);
	waterplane.setModelMatrix(scaleMatrix);

	dudvTexture = loader.loadBMPtexture("water_dudv.bmp");
	normalTexture = loader.loadBMPtexture("water_nomal.bmp");
	shader.createShader("waterVertexShader.glsl", "waterFragmentShader.glsl");
	
	reflectionFrameBuffer = FrameBufferUtilities::createBuffer();
	reflectionTexture = FrameBufferUtilities::createTextureAttachment(REFLECTION_WIDTH, REFLECTION_HEIGHT);
	reflectionDepthBuffer = FrameBufferUtilities::createDepthBufferAttachment(REFLECTION_WIDTH, REFLECTION_HEIGHT);
	FrameBufferUtilities::unbindCurrentBuffer();

	refractionFrameBuffer = FrameBufferUtilities::createBuffer();
	refractionTexture = FrameBufferUtilities::createTextureAttachment(REFRACTION_WIDTH, REFRACTION_HEIGHT);
	refractionDepthTexture = FrameBufferUtilities::createDepthTextureAttachment(REFRACTION_WIDTH, REFRACTION_HEIGHT);
	FrameBufferUtilities::unbindCurrentBuffer();

	double waterheight = 0; 
	reflection_clip_plane = Vec4{ 0, 1, 0, -waterheight + 0.05 }; 
	refraction_clip_plane = Vec4{ 0, -1, 0, -waterheight };
}
开发者ID:Axbri,项目名称:ProceduralTerrainEngine,代码行数:30,代码来源:Water.cpp

示例2:

//Initialize the player.
Player::Player() {
	Loader loader;
	this->tex = loader.loadTexture("assets/pics/player.png");
	this->setTexture(tex);

	this->setTextureRect(sf::IntRect(0, 0, 170, 222));
	this->setOrigin(this->getLocalBounds().width / 2, this->getLocalBounds().height / 2);
	this->setScale(sf::Vector2f(0.3, 0.3));
	
	this->shieldTex = loader.loadTexture("assets/pics/shield.png");
	this->shieldTex.setSmooth(true);
	this->shield.setTexture(shieldTex);
	this->shield.setScale(sf::Vector2f(1.5, 1.5));

	this->spawnPoint = sf::Vector2f(400, 500);
	this->setPosition(sf::Vector2f(spawnPoint));
	this->health = 100;
	this->damage = 10;
	this->ammoDescription = "Red Rays of Happiness";
	this->shieldCharge = 200;
	this->isShielded = false;
	this->setRotation(0);
	this->acceleration = .2f;
	this->maxVelocity = 5.f;
	this->velocity = sf::Vector2f(0, 0);
	this->alive = true;
	this->isDying = false;
	this->pointMultiplier = 1;
	this->rateOfFire = 0.2;
	this->frameCount = 0;
}
开发者ID:Crowmoore,项目名称:T.E.A.R,代码行数:32,代码来源:Player.cpp

示例3: startComponents

/**
 * Loads Config
 * Starts the C64 Components and Threads
 */
void startComponents(char* memPtr,struct _6510_cpu* cpuPtr)
{
    std::cout << "loading components..."<<std::endl;
    memoryManager = new Service::MemoryManager((MemoryCell)memPtr);
    Loader loader = Loader(memoryManager);

    std::cout << "load configfile..."<< std::endl;
    loader.loadConfig();


    std::cout << "starting Sid thread..."<<std::endl;
    Sid::Sid* sid =  new Sid::Sid(memoryManager);

    std::cout << "starting cia thread..."<<std::endl;
    cia = new Cia::Cia(cpuPtr,memoryManager);
    VIC* vic = new VIC(cpuPtr);

    std::cout << "create memoryMap" <<std::endl;
    memMap = new MemoryMap(memoryManager,cpuPtr);
    memMap->draw(0x0,1.1);
    sidThread =thread([sid]{sid->run();});

    C64Clock = new Service::Clock(memoryManager);


    Screen* screen = new Screen(vic,cia,memoryManager,memMap);

    screenThread = thread([screen]{screen->power();});
    C64Clock->addComponent(screen);
    C64Clock->addComponent(cia);




}
开发者ID:tscheims1,项目名称:c64Public,代码行数:39,代码来源:CInterface.cpp

示例4: process_lines

void process_lines(vector<string> & lines)
{

    const int nlines = lines.size();  // number of lines
    const int n = nlines - 1; // number of input data
    if (nlines < 2) {
        cout << "number of lines is wrong" << endl;
        exit(EXIT_FAILURE);
    }


    Loader loader; // frontend
    Docker docker; // backend

    for (int i = 0; i < n; ++i) {
        string input = lines[i + 1];
        //cout << input << endl;

        loader.load(input);
        loader.check();

#if 1
        vector<string> tokens = loader.get_tokens();
        for (unsigned int i = 0; i < tokens.size() - 1; ++i)
            cout << tokens[i] << ",";
        cout << tokens[tokens.size() - 1];
#endif
        cout << endl;


        loader.build_complex(docker.complex);
        docker.run();
    }
}
开发者ID:EricTing,项目名称:geauxdock_cs_v2,代码行数:34,代码来源:3_geauxdock.cpp

示例5: throwException

	 //obj = new object
void ExceptionThrower::throwException(const char * exceptionClassName, const char * message)
{
	//This method should be implemented , for now it will be empty..
	Loader * loadclass = Loader::getInstance();
	ClassData* exceptionClassData = loadclass->getClassData(exceptionClassName);
	exceptionObject = new Object(exceptionClassData);
}
开发者ID:BackupTheBerlios,项目名称:ejvm,代码行数:8,代码来源:ExceptionThrower.cpp

示例6: loc

QMap<QString, QString> Sonnet::Speller::availableDictionaries() const
{
    Loader *l = Loader::openLoader();
    const QStringList lst = l->languages();
    QMap<QString, QString> langs;

    foreach(QString tag, lst) { // krazy:exclude=foreach (no const& because tag is modified below)
        tag = tag.mid(0, tag.indexOf(QLatin1Char('-')));
        int underscorePos = tag.indexOf(QLatin1Char('_'));
        QString cIsoName, lIsoName;
	if (underscorePos != -1 && underscorePos <= 3) {
            cIsoName = tag.mid(underscorePos + 1, 2);
            lIsoName = tag.left(underscorePos);
	}  else {
            lIsoName = tag;
        }
        QLocale loc(tag);
        QString description;

        if (!cIsoName.isEmpty())
            description= QString::fromLatin1("%1 (%2)")
                         .arg(KGlobal::locale()->languageCodeToName(lIsoName))
                         .arg(KGlobal::locale()->countryCodeToName(cIsoName));
        else
            description= KGlobal::locale()->languageCodeToName(lIsoName);
        //qDebug()<<"Dict is "<<tag<<" ( "<<loc.name()<<")"<<", descr = "<<description;
        langs.insert(description, tag);
    }
开发者ID:vasi,项目名称:kdelibs,代码行数:28,代码来源:speller.cpp

示例7: main

void main()
{
	Loader loader;
	Mesh *mesh = new Mesh;
	loader.populatePos(mesh, 0);

	while (true){}
}
开发者ID:NoobLevler,项目名称:Loader,代码行数:8,代码来源:Source.cpp

示例8:

//Constructor takes in the texture path and an id for the Power-Up.
Powerups::Powerups(string path, string id) {	
	Loader loader;
	this->setRadius(20);
	this->tex = loader.loadTexture(path);
	this->tex.setSmooth(true);
	this->setTexture(&tex);
	this->id = id;
}
开发者ID:Crowmoore,项目名称:T.E.A.R,代码行数:9,代码来源:Powerups.cpp

示例9: IsSupported

bool WindowsOperatingSystem::IsSupported(Loader const& rLdr, Architecture const& rArch) const
{
  // At this time, only Windows on x86 is supported
  if ((rLdr.GetName() == "PE" || rLdr.GetName() == "PE+") && rArch.GetName() == "Intel x86")
    return true;

  return false;
}
开发者ID:episeclab,项目名称:medusa,代码行数:8,代码来源:windows.cpp

示例10: Loader

Loader* Loader::create()
{
  Loader* screen = new Loader();
  screen->autorelease();
  screen->retain();

  return screen;
}
开发者ID:tooflya,项目名称:real-steel,代码行数:8,代码来源:Loader.cpp

示例11: run

  int run(int argc, char**argv){
    Loader loader;
    int ord,nproc;
    
    
    try{
      loader= Loader(argv[1],argv[2],argv[3],nproc);
    }catch(int e){
      cout<<"Error cargando el fichero de argumento";
      switch(e){
      case -1: cout<<" 1"<<endl;break;
      case -2: cout<<" 2"<<endl;break;
      case -3: cout<<" 3"<<endl;break;
	
	
      }
      return -1;
    }
    ord = (int)sqrt(nproc);//dimension matrix

    //Create query for get processors' proxies
    // try{
     Ice::ObjectPrx proxy = communicator()->stringToProxy("IceGrid/Query");
     Ice::ObjectPrx col = communicator()->stringToProxy("Collector");
     CollectorPrx collector = CollectorPrx::checkedCast(col);
     // }catch(){
    // }
    
    
  
    Cannon::Matrix A (loader.getA());
    Cannon::Matrix B (loader.getB());
    
    Cannon::Matrix R=  Modify::multiply(A,B);
    cout << "RESULT MATRIZ"<<endl;
    ofstream out("normalresult.m");
    for(int i=0;i<R.ncols;i++){
      for(int j=0;j<R.ncols;j++){
	out << R.data[j+ i*R.ncols] << " ";
	cout<<R.data[j+ i*R.ncols]<< " ";
      }
      out << endl;
      cout << endl;
    }
    out.close();
    vector < Cannon::Matrix> vA = Modify::split(A,ord);
    std::vector< Cannon::Matrix> vB = Modify::split(B,ord);
    
    
    vA = Modify::displace_horizontal(vA,ord);
    vB = Modify::displace_vertical(vB,ord);
    
    
    Dispatch dispatcher(nproc, proxy,collector);//create dispatcher for proccesors
    dispatcher.distr(vA,vB,0);   
    
    return 0;
  }
开发者ID:ruben11291,项目名称:DistributedSystems,代码行数:58,代码来源:MatrixClient.cpp

示例12: stopDownloads

void MrmlView::stopDownloads()
{
    Loader *loader = Loader::self();
    QPtrListIterator<MrmlViewItem> it( m_items );
    for( ; it.current(); ++it ) {
        MrmlViewItem *item = it.current();
        if ( !item->hasRemotePixmap() )
            loader->removeDownload( item->url() );
    }
}
开发者ID:serghei,项目名称:kde3-kdegraphics,代码行数:10,代码来源:mrml_view.cpp

示例13: Loader

	Loader* RootParser15::beginCommon( )
	{
		mFileLoader->deleteFilePartLoader();
		Loader* loader = new Loader(mFileLoader);
		Loader15* loader15 = new Loader15(loader);
		loader->setParserImpl( loader15 );
		mFileLoader->setPartLoader(loader);
		mFileLoader->setParser(loader15);
		return loader;
	}
开发者ID:FishingCactus,项目名称:OpenCOLLADA,代码行数:10,代码来源:COLLADASaxFWLRootParser15.cpp

示例14: ownLoader

ScriptPromise FetchManager::fetch(ScriptState* scriptState, const FetchRequestData* request)
{
    RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scriptState);
    ScriptPromise promise = resolver->promise();

    OwnPtr<Loader> ownLoader(adoptPtr(new Loader(m_executionContext, this, resolver.release(), request)));
    Loader* loader = m_loaders.add(ownLoader.release()).storedValue->get();
    loader->start();
    return promise;
}
开发者ID:335969568,项目名称:Blink-1,代码行数:10,代码来源:FetchManager.cpp

示例15: Loader

	Loader* RootParser14::beginCommonWithId( const char * id)
	{
		mFileLoader->deleteFilePartLoader();
		Loader* loader = new Loader(mFileLoader);
		Loader14* loader14 = new Loader14(loader);
		loader->setParserImpl( loader14 );
		mFileLoader->setPartLoader(loader);
		mFileLoader->setParser(loader14);
		mFileLoader->addToSidTree( id, 0);
		return loader;
	}
开发者ID:FishingCactus,项目名称:OpenCOLLADA,代码行数:11,代码来源:COLLADASaxFWLRootParser14.cpp


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