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


C++ Args函数代码示例

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


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

示例1: main

int main(int argc, char **argv)
{
    GLenum type;

    glutInit(&argc, argv);

    if (Args(argc, argv) == GL_FALSE) {
	exit(1);
    }

    glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);

    type = GLUT_RGB;
    type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
    glutInitDisplayMode(type);

    if (glutCreateWindow(*argv) == GL_FALSE) {
	exit(1);
    }

    Init();

    glutReshapeFunc(Reshape);
    glutKeyboardFunc(Key);
    glutDisplayFunc(Draw);
    glutMainLoop();
	return 0;
}
开发者ID:Distrotech,项目名称:mesa-demos,代码行数:28,代码来源:tri-unfilled-userclip-stip.c

示例2: CrlRet

/*******************************************************************
 * Function Name: GetCtr_BlackImg
 * Return Type 	: GrayImg
 * Created On	: Oct 10, 2013
 * Created By 	: hrushi
 * Comments		: Returns a Countour mask on a BlackImage background
 * Arguments	:
 *******************************************************************/
const ColorImg Contour::GetCtrBlackImg( ) const
{
	ColorImg CrlRet(ContourMask.rows, ContourMask.cols);
	CrlRet = CrlRet.Overlay(*this, DISP_DELAY, COLOR_WHITE, false, Args());

	return CrlRet;
}
开发者ID:hnkulkarni,项目名称:DetectCarriedObjs-PerfEval,代码行数:15,代码来源:Contour.cpp

示例3: LOCTEXT

void FThumbnailSection::BuildSectionContextMenu(FMenuBuilder& MenuBuilder, const FGuid& ObjectBinding)
{
	MenuBuilder.BeginSection(NAME_None, LOCTEXT("ViewMenuText", "View"));
	{
		MenuBuilder.AddSubMenu(
			LOCTEXT("ThumbnailsMenu", "Thumbnails"),
			FText(),
			FNewMenuDelegate::CreateLambda([=](FMenuBuilder& InMenuBuilder){

				TSharedPtr<ISequencer> Sequencer = SequencerPtr.Pin();

				FText CurrentTime = FText::FromString(Sequencer->GetZeroPadNumericTypeInterface()->ToString(Sequencer->GetGlobalTime()));

				InMenuBuilder.BeginSection(NAME_None, LOCTEXT("ThisSectionText", "This Section"));
				{
					InMenuBuilder.AddMenuEntry(
						LOCTEXT("RefreshText", "Refresh"),
						LOCTEXT("RefreshTooltip", "Refresh this section's thumbnails"),
						FSlateIcon(),
						FUIAction(FExecuteAction::CreateRaw(this, &FThumbnailSection::RedrawThumbnails))
					);
					InMenuBuilder.AddMenuEntry(
						FText::Format(LOCTEXT("SetSingleTime", "Set Thumbnail Time To {0}"), CurrentTime),
						LOCTEXT("SetSingleTimeTooltip", "Defines the time at which this section should draw its single thumbnail to the current cursor position"),
						FSlateIcon(),
						FUIAction(
							FExecuteAction::CreateLambda([=]{
								SetSingleTime(Sequencer->GetGlobalTime());
								GetMutableDefault<UMovieSceneUserThumbnailSettings>()->bDrawSingleThumbnails = true;
								GetMutableDefault<UMovieSceneUserThumbnailSettings>()->SaveConfig();
							})
						)
					);
				}
				InMenuBuilder.EndSection();

				InMenuBuilder.BeginSection(NAME_None, LOCTEXT("GlobalSettingsText", "Global Settings"));
				{
					InMenuBuilder.AddMenuEntry(
						LOCTEXT("RefreshAllText", "Refresh All"),
						LOCTEXT("RefreshAllTooltip", "Refresh all sections' thumbnails"),
						FSlateIcon(),
						FUIAction(FExecuteAction::CreateLambda([]{
							GetDefault<UMovieSceneUserThumbnailSettings>()->BroadcastRedrawThumbnails();
						}))
					);

					FPropertyEditorModule& PropertyModule = FModuleManager::LoadModuleChecked<FPropertyEditorModule>("PropertyEditor");

					FDetailsViewArgs Args(false, false, false, FDetailsViewArgs::HideNameArea);
					TSharedRef<IDetailsView> DetailView = PropertyModule.CreateDetailView(Args);
					DetailView->SetObject(GetMutableDefault<UMovieSceneUserThumbnailSettings>());
					InMenuBuilder.AddWidget(DetailView, FText(), true);
				}
				InMenuBuilder.EndSection();
			})
		);
	}
	MenuBuilder.EndSection();
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:60,代码来源:ThumbnailSection.cpp

示例4: main

int
main(int argc, char **argv)
{
  GLenum type;

  glutInit(&argc, argv);
  Args(argc, argv);

  type = GLUT_RGB;
  type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
  glutInitDisplayMode(type);
  glutCreateWindow("ABGR extension");
  if (!glutExtensionSupported("GL_EXT_abgr")) {
    printf("Couldn't find abgr extension.\n");
    exit(0);
  }
#if !GL_EXT_abgr
  printf("WARNING: client-side OpenGL has no ABGR extension support!\n");
  printf("         Drawing only RGBA (and not ABGR) images and textures.\n");
#endif
  Init();
  glutKeyboardFunc(Key);
  glutDisplayFunc(Draw);
  glutMainLoop();
  return 0;             /* ANSI C requires main to return int. */
}
开发者ID:linghushaoxia,项目名称:glut,代码行数:26,代码来源:abgr.c

示例5: GetUserCore

void InternalLink::showPrompt(DesuraId id, Args args)
{
	std::string prompt = args.getArgValue("prompt");
	UserCore::Item::ItemInfoI* item = GetUserCore()->getItemManager()->findItemInfo( id );

	if (prompt == "update")
	{
		std::vector<std::string> a;
		a.push_back("reminder=true");

		showUpdateForm(id, Args(a));
	}
	else if (prompt == "launch")
	{
		LaunchItemDialog* form = new LaunchItemDialog(m_pParent);
		regForm(id, form);

		form->setInfo(item);

		form->Show(true);
		form->Raise();
	}
	else if (prompt == "eula")
	{
		showEULA(id);
	}
	else if (prompt == "preload")
	{
		showPreorderPrompt(id, true);
	}
}
开发者ID:CSRedRat,项目名称:desura-app,代码行数:31,代码来源:InternalLink.cpp

示例6: main

void main(int argc,char** argv)
{
	if(Args(argc,argv)==GL_FALSE)
		auxQuit();

	windW=600;
	windH=300;
	auxInitPosition(0,0,windW,windH);

	windType=AUX_DEPTH16;
	windType|=(rgb)?AUX_RGB:AUX_INDEX;
	windType|=(doubleBuffer)?AUX_DOUBLE:AUX_SINGLE;

	auxInitDisplayMode(windType);

	if(auxInitWindow("速度测试")==GL_FALSE)
		auxQuit();

	auxExposeFunc((AUXEXPOSEPROC)Resize);
	auxReshapeFunc((AUXRESHAPEPROC)Resize);
	auxKeyFunc(AUX_a,Key_a);
	auxKeyFunc(AUX_d,Key_d);
	auxKeyFunc(AUX_f,Key_f);
	auxKeyFunc(AUX_F,Key_F);
	auxKeyFunc(AUX_s,Key_s);
	auxKeyFunc(AUX_t,Key_t);
	auxMainLoop(Paint);
}
开发者ID:alannet,项目名称:example,代码行数:28,代码来源:运行时的控制.cpp

示例7: ADDTOCALLSTACK

void CClient::CharDisconnect()
{
	ADDTOCALLSTACK("CClient::CharDisconnect");
	// Disconnect the CChar from the client.
	// Even tho the CClient might stay active.
	if ( !m_pChar )
		return;

	Announce(false);
	bool fCanInstaLogOut = CanInstantLogOut();
	int iLingerTime = g_Cfg.m_iClientLingerTime;

	// We are not a client anymore
	if ( m_bChatActive )
		g_Serv.m_Chats.QuitChat(this);

	if ( m_pHouseDesign )
		m_pHouseDesign->EndCustomize(true);

	if ( IsTrigUsed(TRIGGER_LOGOUT) )
	{
		CScriptTriggerArgs Args(iLingerTime, fCanInstaLogOut);
		m_pChar->OnTrigger(CTRIG_LogOut, m_pChar, &Args);
		iLingerTime = static_cast<int>(Args.m_iN1);
		fCanInstaLogOut = (Args.m_iN2 != 0);
	}

	m_pChar->ClientDetach();	// we are not a client any more.

	if ( iLingerTime <= 0 )
		fCanInstaLogOut = true;

	// Gump memory cleanup, we don't want them on logged out players
	m_mapOpenedGumps.clear();

	// Layer dragging, moving it to backpack
	CItem *pItemDragging = m_pChar->LayerFind(LAYER_DRAGGING);
	if ( pItemDragging )
		m_pChar->ItemBounce(pItemDragging);

	// log out immediately ? (test before ClientDetach())
	if ( !fCanInstaLogOut )
	{
		// become an NPC for a little while
		CItem *pItemChange = CItem::CreateBase(ITEMID_RHAND_POINT_W);
		ASSERT(pItemChange);
		pItemChange->SetName("Client Linger");
		pItemChange->SetType(IT_EQ_CLIENT_LINGER);
		pItemChange->SetTimeout(iLingerTime);
		m_pChar->LayerAdd(pItemChange, LAYER_FLAG_ClientLinger);
	}
	else
	{
		// remove me from other clients screens now.
		m_pChar->SetDisconnected();
	}

	m_pChar = NULL;
}
开发者ID:bucketyied,项目名称:Source,代码行数:59,代码来源:CClient.cpp

示例8: main

int main( int argc, char **argv )
{
    int success = 0;
    GLcharARB *VertexShaderSource, *FragmentShaderSource;

    int error = 0;

    if (Args(argc, argv) == FALSE)
        exit(0);

    glutInit( &argc, argv );
    glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );
    glutInitWindowSize(500, 500);
    window = glutCreateWindow( "Fire and Smoke" );

    glutIdleFunc( play );
    glutDisplayFunc( display );
    glutKeyboardFunc( key );
    glutReshapeFunc( reshape );

    printOpenGLError();

    if ( !isExtensionSupported( "GL_ARB_shader_objects" )   ||
         !isExtensionSupported( "GL_ARB_fragment_shader" )  ||
         !isExtensionSupported( "GL_ARB_vertex_shader" )    ||
         !isExtensionSupported( "GL_ARB_shading_language_100" ) )
    {
        printf("OpenGL Shading Language extensions not available\n" );
        return 1;
    }

    if( error )
    {
        printf( "ERROR from wglGetProcAddress\n" );
    }

    createPoints( numParticles );

    glDepthFunc( GL_LESS );
    glEnable( GL_DEPTH_TEST );
	glClearColor( 0.0f, 0.67f, 0.94f, 1.0f );

	ParticleTime = 0.0f;

    readShaderSource( "smoke", &VertexShaderSource, &FragmentShaderSource );
    success = installParticleShaders( VertexShaderSource, FragmentShaderSource );

    if ( success )
	{
		glutMainLoop();
	}
	else
	{
		printf( "Error installing particle shaders" );
		scanf( "%d", ParticleTime );
	}

    return 0;
}
开发者ID:b01xy,项目名称:smoke,代码行数:59,代码来源:ogl2particle.c

示例9: OpenURLInBrowser

bool OpenURLInBrowser(const std::string& URL)
{
  if (URL.empty()) return false;

#ifdef G_OS_WIN32

  std::string URLTmp = URL;
  if (URLTmp.find("file://") == 0)
  {
    URLTmp = URLTmp.substr(7);
  }
  return ((int)(ShellExecute(NULL, "open", LPCSTR(URLTmp.c_str()), NULL, NULL, SW_SHOWNORMAL)) > 32);

  #endif

#ifdef G_OS_UNIX

  std::vector<std::string> Args(2,"");

  Args[0] = "xdg-open";
  Args[1] = URL;

  try { Glib::spawn_async("", Args, Glib::SPAWN_SEARCH_PATH); }
  catch (Glib::SpawnError& E)
  {
    Args[0] = "firefox";
    try { Glib::spawn_async("", Args, Glib::SPAWN_SEARCH_PATH); }
    catch (Glib::SpawnError& E)
    {
      Args[0] = "chrome";
      try { Glib::spawn_async("", Args, Glib::SPAWN_SEARCH_PATH); }
      catch (Glib::SpawnError& E)
      {
        Args[0] = "opera";
        try { Glib::spawn_async("", Args, Glib::SPAWN_SEARCH_PATH); }
        catch (Glib::SpawnError& E)
        {
          Args[0] = "mozilla";
          try { Glib::spawn_async("", Args, Glib::SPAWN_SEARCH_PATH); }
          catch (Glib::SpawnError& E)
          {
            Args[0] = "netscape";
            try { Glib::spawn_async("", Args, Glib::SPAWN_SEARCH_PATH); }
            catch (Glib::SpawnError& E)
            {
              return false;
            }
          }
        }
      }
    }
  }

  return true;
#endif


  return false;
}
开发者ID:VaysseB,项目名称:openfluid,代码行数:59,代码来源:SwissTools.cpp

示例10: Args

void CMempoolComponent::InitFeeEstimate()
{
    fs::path est_path = Args().GetDataDir() / FEE_ESTIMATES_FILENAME;
    CAutoFile est_filein(fsbridge::fopen(est_path, "rb"), SER_DISK, CLIENT_VERSION);
    // Allowed to fail as this file IS missing on first startup.
    if (!est_filein.IsNull())
        ::feeEstimator.Read(est_filein);
    bFeeEstimatesInitialized = true;
}
开发者ID:superbitcoin,项目名称:SuperBitcoin,代码行数:9,代码来源:mempoolcomponent.cpp

示例11: bar

void bar(Args... args) {
  foo(Args()...);
  foo(args = args...);
  foo(reinterpret_cast<void*>(&args)...);
  foo(const_cast<const Args>(args)...);
  foo(static_cast<void*>(&args)...);
  foo(dynamic_cast<void*>(&args)...);
  foo(typeid(Args)...);
}
开发者ID:Nodplus,项目名称:gcc,代码行数:9,代码来源:variadic58.C

示例12: startApp

int LightSpeed::AppBase::main_entry( int argc, wchar_t *argv[], ConstStrW pathname)
{
	AutoArray<ConstStrW> params;
	params.reserve(argc);
	for (int i = 0; i < argc; i++)
		params.add(ConstStrW(argv[i]));		
	appPathname = pathname;
	return startApp(Args(params));
}
开发者ID:ondra-novak,项目名称:lightspeed,代码行数:9,代码来源:app.cpp

示例13: EntryBlock

vector<Value*> AssertionSiteInstrumenter::CollectArgs(
    Instruction *Before, const Automaton& A,
    Module& Mod, IRBuilder<>& Builder) {

  // Find named values to be passed to instrumentation.
  std::map<string,Value*> ValuesInScope;
  for (auto G = Mod.global_begin(); G != Mod.global_end(); G++)
    ValuesInScope[G->getName()] = G;

  auto *Fn = Before->getParent()->getParent();
  for (auto& Arg : Fn->getArgumentList())
    ValuesInScope[Arg.getName()] = &Arg;

  auto& EntryBlock(*Fn->begin());
  for (auto& I : EntryBlock) {
    auto *Inst = dyn_cast<AllocaInst>(&I);
    if (!Inst)
      break;

    ValuesInScope[Inst->getName()] = Builder.CreateLoad(Inst);
  }

  int ArgSize = 0;
  for (auto& Arg : A.getAssertion().argument())
    if (!Arg.free())
      ArgSize = std::max(ArgSize + 1, Arg.index());

  vector<Value*> Args(ArgSize, NULL);

  for (auto& Arg : A.getAssertion().argument()) {
    if (Arg.free())
      continue;

    string Name(BaseName(Arg));

    if (ValuesInScope.find(Name) == ValuesInScope.end()) {
      string s;
      raw_string_ostream Out(s);

      for (auto v : ValuesInScope) {
        Out << "  \"" << v.first << "\": ";
        v.second->getType()->print(Out);
        Out << "\n";
      }

      panic("assertion references non-existent variable '" + BaseName(Arg)
         + "'; was it defined under '#ifdef TESLA'?\n\n"
           "Variables in scope are:\n" + Out.str());
    }

    Args[Arg.index()] =
      GetArgumentValue(ValuesInScope[Name], Arg, Builder, true);
  }

  return Args;
}
开发者ID:cadets,项目名称:tesla-static-analysis,代码行数:56,代码来源:Assertion.cpp

示例14: Args

///////////////////////////////////////////////////////////////////////////////
// AddDependency
///////////////////////////////////////////////////////////////////////////////
void cCmdLineParser::AddDependency(int argId1, int argId2, bool mutual )
{
    // again, no checking for duplicates... would a set
    // prove to be a better container for this operation?
    std::pair< int, int > Args( argId1, argId2 );
    std::pair< std::pair< int, int >, bool > Dep( Args, mutual ); 

    ASSERT(argId1 != argId2);
    mDependencyList.push_back( Dep);
}
开发者ID:brc0x1,项目名称:tripwire-open-source,代码行数:13,代码来源:cmdlineparser.cpp

示例15: FLEXT_ADDMETHOD_

WhiteNoise_ar::WhiteNoise_ar(int argc, t_atom *argv)
{
    FLEXT_ADDMETHOD_(0,"seed",m_seed);

    //parse arguments
    AtomList Args(argc,argv);

    rgen.init(timeseed());

    AddOutSignal();
}    
开发者ID:Angeldude,项目名称:pd,代码行数:11,代码来源:WhiteNoise.cpp


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