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

C++ LoadResources函数代码示例

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

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



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


示例16: LoadResources

void GUISystem::CreateGUIWindow()
{
	try
	{
		bool is3D = false;

		tinyxml2::XMLDocument oDocument;
		tinyxml2::XMLError oErr = oDocument.LoadFile(CONFIG.c_str());
		if(oErr != tinyxml2::XML_NO_ERROR)
		{
			MGD_LOG::LOGManager::GetSingleton().WriteLog(MGD_LOG::MGD_ERROR, MAIN_CONTEXT, "Error loading file: %s", CONFIG.c_str());
			return;
		}
		const tinyxml2::XMLElement* pRoot = oDocument.RootElement();
		if(pRoot)
		{
			const tinyxml2::XMLElement* p3D = pRoot->FirstChildElement("Is3D");
			if(p3D)
			{
				is3D = p3D->BoolAttribute("enable");
			}
		}

		//Create RENDERER
		if(is3D)
		{
			m_pOgreGuiRenderer = &CEGUI::OgreRenderer::bootstrapSystem();
		}
		else
		{
			m_pOpenGLGuiRenderer = &CEGUI::OpenGLRenderer::bootstrapSystem();

			m_pOpenGLGuiRenderer->getDefaultRenderingRoot().clearGeometry(CEGUI::RQ_OVERLAY);
			m_pOpenGLGuiRenderer->enableExtraStateSettings(true); // ??
			LoadResources();

		}


	//Setup CEGUI System
	CEGUI::SchemeManager::getSingleton().create("TaharezLook.scheme");

	CEGUI::System::getSingleton().setDefaultMouseCursor("TaharezLook", "MouseArrow");

	//Create window
	m_pGUIWindowManager = &CEGUI::WindowManager::getSingleton();
	m_pGuiWindow = m_pGUIWindowManager->createWindow("DefaultWindow", "MGD_14_GUI/Window");
	m_pGuiWindow->setText("MGD_14 - Game");

	CEGUI::System::getSingleton().setGUISheet(m_pGuiWindow);
	}
	catch (CEGUI::Exception& e)
	{
		MGD_LOG::LOGManager::GetSingleton().WriteLog(MGD_LOG::MGD_ERROR, GUI_CONTEXT, e.getMessage().c_str());
	}
}
开发者ID:Mr3lw00d,项目名称:MGD_GAMEPLAY__MDG14,代码行数:56,代码来源:GUISystem.cpp


示例17: sprintf

void CApp::OpenWindow( )
{
    char cTmp[20];
    sprintf( cTmp, "Lifes: %d", iLife );
    w_Window.create( sf::VideoMode( 800, 600 ), cTmp, sf::Style::Close );
    w_Window.setMouseCursorVisible( true );
    w_Window.setFramerateLimit( 60 );
    if( !LoadResources( ) )
        exit(1);
}
开发者ID:wildcherrycandy,项目名称:Angry-pokemon-game,代码行数:10,代码来源:CApp.cpp


示例18: LoadResources

/**
 * Initialize an EGL context for the current display.
 */
int Engine::InitDisplay(android_app* app) {
  if (!initialized_resources_) {
    gl_context_->Init(app_->window);
    LoadResources();
    initialized_resources_ = true;
  } else if(app->window != gl_context_->GetANativeWindow()) {
    // Re-initialize ANativeWindow.
    // On some devices, ANativeWindow is re-created when the app is resumed
    assert(gl_context_->GetANativeWindow());
    UnloadResources();
    gl_context_->Invalidate();
    app_ = app;
    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();
    } else {
        assert(0);
    }
  }

  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(2.f, 2.f, 8.f);

  return 0;
}
开发者ID:huyu0415,项目名称:android-ndk,代码行数:45,代码来源:TeapotNativeActivity.cpp


示例19: ADDTOCALLSTACK

CResourceScript * CResourceBase::LoadResourcesAdd( LPCTSTR pszNewFileName )
{
	ADDTOCALLSTACK("CResourceBase::LoadResourcesAdd");
	// Make sure this is added to my list of resource files
	// And load it now.

	CResourceScript * pScript = AddResourceFile( pszNewFileName );
	if ( ! LoadResources(pScript))
		return( NULL );
	return( pScript );
}
开发者ID:roberpot,项目名称:Source,代码行数:11,代码来源:CResourceBase.cpp


示例20: LoadResources

CBoss3::CBoss3(int id, SpecificType specific_type, D3DXVECTOR3 pos, int width, int height)
	:CEnemyUseGun(id, specific_type, pos, width, height)
{
	_hp = 20;
	_is_hide = true;
	_last_time_hide = 0;
	_count_time_destroy = 0;
	_x_random = pos.x;
	_y_random = pos.y;
	_enable = false;
	LoadResources();
}
开发者ID:tranletuan,项目名称:game-castlevaina,代码行数:12,代码来源:CBoss3.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ LoadScript函数代码示例发布时间:2022-05-30
下一篇:
C++ LoadResource函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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