當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。