本文整理汇总了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;
}
示例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;
}
示例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();
}
示例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. */
}
示例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);
}
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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)...);
}
示例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));
}
示例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;
}
示例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);
}
示例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();
}