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


C++ LoadResources函数代码示例

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


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

示例1: LoadResources

/**
 * Initialize an EGL context for the current display.
 */
int Engine::InitDisplay()
{
    if( !initialized_resources_ )
    {
        gl_context_->Init( app_->window );
        LoadResources();
        initialized_resources_ = true;
    }
    else
    {
        // initialize OpenGL ES and EGL
        if( EGL_SUCCESS != gl_context_->Resume( app_->window ) )
        {
            UnloadResources();
            LoadResources();
        }
    }

    ShowUI();

    // Initialize GL state.
    glEnable( GL_CULL_FACE );
    glEnable( GL_DEPTH_TEST );
    glDepthFunc( GL_LEQUAL );

    //Note that screen size might have been changed
    glViewport( 0, 0, gl_context_->GetScreenWidth(), gl_context_->GetScreenHeight() );
    renderer_.UpdateViewport();

    tap_camera_.SetFlip( 1.f, -1.f, -1.f );
    tap_camera_.SetPinchTransformFactor( 10.f, 10.f, 8.f );

    return 0;
}
开发者ID:ChronicTheOne,项目名称:platform_development,代码行数:37,代码来源:MoreTeapotsNativeActivity.cpp

示例2: InitUI

/**
 * Initialize an EGL context for the current display.
 */
int Engine::InitDisplay(const int32_t cmd) {
  if (!initialized_resources_) {
    startup_mutex_.lock();
    gl_context_->Init(app_->window);
    InitUI();
    LoadResources();
    initialized_resources_ = true;
    startup_mutex_.unlock();
  } else {
    // initialize OpenGL ES and EGL
    if (EGL_SUCCESS != gl_context_->Resume(app_->window)) {
      UnloadResources();
      LoadResources();
    }

    jui_helper::JUIWindow::GetInstance()->Resume(app_->activity, cmd);
  }

  // Enable culling OpenGL state
  glEnable(GL_CULL_FACE);

  // Enabled depth test OpenGL state
  glEnable(GL_DEPTH_TEST);
  glDepthFunc(GL_LEQUAL);

  // Note that screen size might have been changed
  glViewport(0, 0, gl_context_->GetScreenWidth(),
             gl_context_->GetScreenHeight());
  renderer_.UpdateViewport();

  tap_camera_.SetFlip(1.f, -1.f, -1.f);
  tap_camera_.SetPinchTransformFactor(2.f, 2.f, 8.f);

  return 0;
}
开发者ID:ggfan,项目名称:cpp-android-basic-samples,代码行数:38,代码来源:ButtonClickerNativeActivity_Engine.cpp

示例3: LoadResources

bool ResourceGUIBackend::LoadCommandLine(int argc,const char** argv)
{
  for(int i=1;i<argc;i++) {
    if(argv[i][0] == '-') {
      if(0==strcmp(argv[i],"-l")) {
	LoadResources(argv[i+1],*resources);
	i++;
      }
      else {
	printf("Unknown option %s",argv[i]);
	return 0;
      }
    }
    else {
      const char* ext=FileExtension(argv[i]);
      if(0==strcmp(ext,"xml")) {
	TiXmlDocument doc;
	if(!doc.LoadFile(argv[i])) {
	  printf("Error loading XML file %s\n",argv[i]);
	  return false;
	}
	if(0 == strcmp(doc.RootElement()->Value(),"world")) {
	  XmlWorld xmlWorld;
	  if(!xmlWorld.Load(doc.RootElement(),GetFilePath(argv[i]))) {
	    printf("Error loading world file %s\n",argv[i]);
	    return 0;
	  }
	  if(!xmlWorld.GetWorld(*world)) {
	    printf("Error loading world from %s\n",argv[i]);
	    return 0;
	  }
	}
	else if(0 == strcmp(doc.RootElement()->Value(),"resource_library")) {
	  LoadResources(doc.RootElement(),*resources);
	}
	else {
	  if(!LoadItem(argv[i],*resources))
	    return 0;
	}
      }
      else {
	//try loading into the world
	const char* ext = FileExtension(argv[i]);
	if(world->CanLoadElementExt(ext) && world->LoadElement(argv[i])>= 0) {
	  //loaded successfully
	}
	else {
	  //failed, now try resource library load
	  if(!LoadItem(argv[i],*resources))
	    return 0;
	}
      }
    }
  }
  return true;
}
开发者ID:arocchi,项目名称:Klampt,代码行数:56,代码来源:ResourceGUI.cpp

示例4: LoadResources

void UIScreen::LoadGroup()
{
	//Logger::Debug("load group started");
	//uint64 loadGroupStart = SystemTimer::Instance()->AbsoluteMS();
	if (groupId < 0)
	{
		if (isLoaded)return;
		
		LoadResources();
		isLoaded = true;
	}else
	{
		for (List<UIScreen*>::iterator t = appScreens.begin(); t != appScreens.end(); ++t)
		{
			UIScreen * screen = *t;
			if ((screen->groupId == groupId) && (!screen->isLoaded))
			{
				screen->LoadResources();
				screen->isLoaded = true;
			}
		}
	}
	//uint64 loadGroupEnd = SystemTimer::Instance()->AbsoluteMS();
	//Logger::Debug("load group finished: %lld", loadGroupEnd - loadGroupStart);
}
开发者ID:abaradulkin,项目名称:dava.framework,代码行数:25,代码来源:UIScreen.cpp

示例5: LoadResources

void ResourceManager::Tick( float /*time*/ ) {
	if( !m_resources_loaded ) {
		LoadResources();
	}


}
开发者ID:Tym17tools,项目名称:Wyrm,代码行数:7,代码来源:resourcemanager.cpp

示例6: Update

    void World::Update()
    {
        if(m_state == IDLE)
        {
            if(LoadResources())
            {

            }
        }
        else if(m_state == PLAYING)
        {
            if(!IsBallInBounds())
            {
                ChangeState(GAMEOVER);
            }
            else
            {
                UpdateBall();
                UpdatePlayer1();
                UpdatePlayer2(); 
            }
        }
        else if(m_state == GAMEOVER)
        {
            if(HasBallCollideLeft())
            {
                m_player2.UpdateScore(1);
            }
            else if(HasBallCollideRight())
            {
                m_player1.UpdateScore(1);
            }
            Restart();
        }
    }
开发者ID:pavelsimo,项目名称:Pong,代码行数:35,代码来源:World.cpp

示例7: LoadDisplayResources

int
LoadDisplayResources( struct display *d )
{
	int i, ret;
	char **ent;

	if (Setjmp( cnftalk.errjmp ))
		return -1; /* may memleak */
	if ((ret = startConfig( GC_gDisplay, &d->cfg.dep, FALSE )) <= 0)
		return ret;
	GSendStr( d->name );
	GSendStr( d->class2 );
	LoadResources( &d->cfg );
/*	Debug( "display(%s, %s) resources: %[*x\n", d->name, d->class2,
           d->cfg.numCfgEnt, ((char **)d->cfg.data) + d->cfg.numCfgEnt );*/
	ret = 1;
	for (i = 0; i < as(dpyVal); i++) {
		if (!(ent = FindCfgEnt( d, dpyVal[i].id )))
			ret = -1;
		else
			ApplyResource( dpyVal[i].id, ent,
			               (char **)(((char *)d) + dpyVal[i].off) );
	}
	if (ret < 0)
		LogError( "Internal error: config reader supplied incomplete data\n" );
	return ret;
}
开发者ID:Fat-Zer,项目名称:tdebase,代码行数:27,代码来源:resource.c

示例8: Control

CheckBox::CheckBox( Framework &fw, Control* Owner ) : Control( fw, Owner ), Checked(false), imagechecked(nullptr), imageunchecked(nullptr)
{
	LoadResources();
	if( buttonclick == nullptr )
	{
		buttonclick = new RawSound( fw, "STRATEGC/INTRFACE/BUTTON1.RAW" );
	}
}
开发者ID:5thAvenue,项目名称:OpenApoc,代码行数:8,代码来源:checkbox.cpp

示例9: LoadResources

CWaterFallE::CWaterFallE(int id, SpecificType specific_type, D3DXVECTOR3 pos, int width, int height)
	:CEffectObject(id, specific_type, pos, width, height)
{	
	_cols = width / GROUND_SIZE_NORMAL_X;
	_rows = height / GROUND_SIZE_NORMAL_Y;
	_countTime = 0;
	LoadResources();
}
开发者ID:tranletuan,项目名称:game-castlevaina,代码行数:8,代码来源:CWaterFallE.cpp

示例10: LoadResources

CSniperBlock::CSniperBlock(int id, SpecificType specific_type, D3DXVECTOR3 pos, int width, int height)
	:CEnemyUseGun(id, specific_type, pos, width, height)
{
	_hp = 1;
	_physical.vx_last = -1;
	_can_impact = true;
	LoadResources();
}
开发者ID:tranletuan,项目名称:game-castlevaina,代码行数:8,代码来源:CSniperBlock.cpp

示例11: LoadResources

void ConEmuAbout::DonateBtns_Add(HWND hDlg, int AlignLeftId, int AlignVCenterId)
{
	if (!m_Btns[0].pImg)
		LoadResources();

	RECT rcLeft = {}, rcTop = {};
	HWND hCtrl;

	hCtrl = GetDlgItem(hDlg, AlignLeftId);
	GetWindowRect(hCtrl, &rcLeft);
	MapWindowPoints(NULL, hDlg, (LPPOINT)&rcLeft, 2);
	hCtrl = GetDlgItem(hDlg, AlignVCenterId);
	GetWindowRect(hCtrl, &rcTop);
	int nPreferHeight = rcTop.bottom - rcTop.top;
	MapWindowPoints(NULL, hDlg, (LPPOINT)&rcTop, 2);

	#ifdef _DEBUG
	DpiValue dpi;
	CDpiAware::QueryDpiForWindow(hDlg, &dpi);
	#endif

	int X = rcLeft.left;

	for (size_t i = 0; i < countof(m_Btns); i++)
	{
		if (!m_Btns[i].pImg)
			continue; // Image was failed

		TODO("Вертикальное центрирование по объекту AlignVCenterId");

		int nDispW = 0, nDispH = 0;
		if (!m_Btns[i].pImg->GetSizeForHeight(nPreferHeight, nDispW, nDispH))
		{
			_ASSERTE(FALSE && "Image not available for dpi?");
			continue; // Image was failed?
		}
		_ASSERTE(nDispW>0 && nDispH>0);
		int nY = rcTop.top + ((rcTop.bottom - rcTop.top - nDispH + 1) / 2);

		hCtrl = CreateWindow(L"STATIC", m_Btns[i].ResId,
			WS_CHILD|WS_VISIBLE|SS_NOTIFY|SS_OWNERDRAW,
			X, nY, nDispW, nDispH,
			hDlg, (HMENU)m_Btns[i].nCtrlId, g_hInstance, NULL);

		#ifdef _DEBUG
		if (!hCtrl)
			DisplayLastError(L"Failed to create image button control");
		#endif

		//X += nDispW + (10 * dpi.Ydpi / 96);
		X += nDispW + (nDispH / 3);
	}

	RegisterTip(hDlg);

	UNREFERENCED_PARAMETER(hCtrl);
}
开发者ID:Alexander-Shukaev,项目名称:ConEmu,代码行数:57,代码来源:AboutDlg.cpp

示例12: ResetRect

clsGate::clsGate(LPDIRECT3DDEVICE9 d3ddev, LPD3DXSPRITE _SpriteHandler, int _ID, float _x, float _y):clsObject(_x,_y,80,185)
{
	m_Ani = NULL;
	m_ID = _ID;
	m_x = _x;
	m_y = _y - 15;
	ResetRect();
	LoadResources(d3ddev,_SpriteHandler);
}
开发者ID:SoseUIT034,项目名称:game-2d-mapplestory,代码行数:9,代码来源:clsGate.cpp

示例13: ResetRect

clsGround10::clsGround10(LPDIRECT3DDEVICE9 d3ddev, LPD3DXSPRITE _SpriteHandler, int _ID, float _x, float _y)
{
	m_ID = _ID;
	m_Matdat = NULL;
	m_x = _x;
	m_y = _y;
	ResetRect(0,50,0,50);
	LoadResources(d3ddev,_SpriteHandler);
}
开发者ID:SoseUIT034,项目名称:game-2d-mapplestory,代码行数:9,代码来源:clsGround10.cpp

示例14: ResetRect

clsLadder49::clsLadder49(LPDIRECT3DDEVICE9 d3ddev, LPD3DXSPRITE _SpriteHandler, int _ID, float _x, float _y)
{
	m_ID = _ID;
	m_Sprite = NULL;
	m_x = _x;
	m_y = _y;
	ResetRect(0,20,0,50);
	LoadResources(d3ddev,_SpriteHandler);
}
开发者ID:SoseUIT034,项目名称:game-2d-mapplestory,代码行数:9,代码来源:clsLadder49.cpp

示例15: LoadResources

void InformationState::Init(sf::RenderWindow* screen)
{

	LoadResources(screen);

	InitFont();
	InitText();

}
开发者ID:aguperezpala,项目名称:ggj-11-cpp,代码行数:9,代码来源:InformationState.cpp


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