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


C++ printInfo函数代码示例

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


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

示例1: stopManagers

void ZoneServerImplementation::shutdown() {
	//datagramService->setHandler(NULL);

	stopManagers();

	info("shutting down zones", true);

	for (int i = 0; i < zones->size(); ++i) {
		ManagedReference<Zone*> zone = zones->get(i);

		if (zone != NULL) {
			zone->stopManagers();
			//info("zone references " + String::valueOf(zone->getReferenceCount()), true);
		}
	}

	zones->removeAll();

	info("zones shut down", true);

	printInfo();

	datagramService = NULL;

	info("shut down complete", true);
}
开发者ID:ModTheGalaxy,项目名称:mtgserver,代码行数:26,代码来源:ZoneServerImplementation.cpp

示例2: loadGame

/**
* Laedt, falls moeglich, ein Spiel. Das Spiel wird im GameState gespeichert, dieser muss also ein Pointer sein.
*/
void loadGame(struct GameState *gs, char *filename) {
	char fullFilename[255];
	FILE *file;

	sprintf(fullFilename, "savegames/%s.sav", filename); // kompletten Dateinamen erzeugen

	file = fopen(fullFilename, "r"); // Datei oeffnen. r = read
	if (file == NULL) {
		printError("Oeffnen der Savegame-Datei fehlgeschlagen.\n");
		return;
	}

	char ai0 = (*gs).ai0;
	char ai1 = (*gs).ai1;
	size_t size1 = fread(gs, sizeof(*gs), 1, file);
	(*gs).ai0 = ai0;
	(*gs).ai1 = ai1;

	size_t size2 = fread(history, sizeof(history) * sizeof(char), 1, file);

	fclose(file); // Datei schliessen.

	if (size1 == 0 || size2 == 0) {
		printError("Laden fehlgeschlagen: Der Inhalt des Savegames ist inkompatibel.\n");
	} else {
		printInfo("Spiel geladen.\n");
	}
}
开发者ID:chriskonnertz,项目名称:c2-chess,代码行数:31,代码来源:c2.c

示例3: main

int main(int argc, char **argv)
{
    device = &freenect.createDevice<MyFreenectDevice>(0);
    device->startVideo();
    device->startDepth();
    
    glutInit(&argc, argv);

    glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
    glutInitWindowSize(640, 480);
    glutInitWindowPosition(0, 0);

    window = glutCreateWindow("LibFreenect");
    glClearColor(0.45f, 0.45f, 0.45f, 0.0f);

    glEnable(GL_DEPTH_TEST);
    glEnable(GL_ALPHA_TEST);
    glAlphaFunc(GL_GREATER, 0.0f);

    glMatrixMode(GL_PROJECTION);
    gluPerspective(50.0, 1.0, 900.0, 11000.0);
        
    glutDisplayFunc(&DrawGLScene);
    glutIdleFunc(&idleGLScene);
    glutReshapeFunc(&resizeGLScene);
    glutKeyboardFunc(&keyPressed);
    glutMotionFunc(&mouseMoved);
    glutMouseFunc(&mouseButtonPressed);

    printInfo();

    glutMainLoop();

    return 0;
}
开发者ID:nitrogenlogic,项目名称:libfreenect,代码行数:35,代码来源:cpp_pc_view.cpp

示例4: computeProjectionMatrix

void VoxelGridGPU::setUniformCellSizeFromResolutionAndMapping(float width,
		float height, int resX, int resY, int resZ) {

	if ( ( width / resX )  != ( height / resY) )
	{
		DEBUGLOG->log( "Resolution and dimensions are in an unequal ratio. Cannot compute uniform cell size");
		return;
	}

	this->width = width;
	this->height = height;
	this->resX = resX;
	this->resY = resY;
	this->resZ = resZ;

	this->cellSize = ( width / resX );

	this->depth = this->cellSize * resZ;

	computeProjectionMatrix();

	computeWorldToVoxel();

	printInfo();
}
开发者ID:Secumfex,项目名称:VoxelizationFramework,代码行数:25,代码来源:VoxelGridTools.cpp

示例5: main

int main(int argc, char *argv[])
{
	char *path = ".";
	if (argc >= 2) {
		path = argv[1];
	}

	DIR *dp = opendir(path);
	if (dp == NULL) {
		perror("Open file");
		exit(1);
	}
	chdir(argv[1]);
	struct dirent *dirbuf;
	struct stat statbuf;
	char *filename[N];
	int index = 0;
	while ((dirbuf = readdir(dp)) != NULL) {
		if ((strcmp(dirbuf->d_name, ".") == 0) || (strcmp(dirbuf->d_name, "..") == 0)) {
			continue;
		}
		filename[index] = (char *)calloc(strlen(dirbuf->d_name), sizeof(char));
		strcpy(filename[index], dirbuf->d_name);
		index++;
	}
	qsort(filename, index - 1, sizeof(filename[0]), cmp);
	for (int i = 0; i < index; i++) {
		printInfo(filename[i]);
	}
	closedir(dp);
	return 0;
}
开发者ID:guoqunabc,项目名称:C-Cplusplus,代码行数:32,代码来源:main.c

示例6: literalTypes

void literalTypes()
{
    std::cout << "##############################################################\n";
    std::cout << " Literal Types:\n";
    std::cout << "##############################################################\n";
    printInfo("1", 1);
    printInfo("1U", 1U);
	printInfo("1L", 1L);
	printInfo("0xFF", 0xFF);
	printInfo("0xFFFF", 0xFFFFF);
	printInfo("0xFFFFFFFF", 0xFFFFFFFF);
	printInfo("0xFFFFFFFFFFFFFFFF", 0xFFFFFFFFFFFFFFFF);
    printInfo("1LLU", 1LLU);
    printInfo("1.2L", 1.2L);
    printInfo("1.2", 1.2);
}
开发者ID:maxrake,项目名称:CppCourse,代码行数:16,代码来源:literalTypes.cpp

示例7: m_currentFBOIndex

Renderer::Renderer(const RenderContext &context) :

m_currentFBOIndex(false),
m_gBuffer(NULL), m_shaderGBuffer(NULL),
m_ping(NULL), m_pong(NULL),
m_firstRender(true),
m_shaderSFQ(NULL),

m_useDeferredShading(false),  m_shaderDSLighting(NULL), m_shaderDSCompositing(NULL), m_dsLightRootNode(NULL), m_dsLightColor(NULL),
m_useReflections(false),      m_shaderRLR(NULL),
m_useAntiAliasing(false),     m_shaderFXAA(NULL),
m_useBloom(false),            m_shaderBloom(NULL),
m_useBlur(false),			  m_shaderBlur(NULL),
m_useRadialBlur(false),		  m_shaderRadialBlur(NULL),
m_useDoF(false),			  m_shaderDoF(NULL), m_shaderDepth(NULL),
m_useSSAO(false),             m_shaderSSAOcalc(NULL), m_shaderSSAOblur(NULL), m_shaderSSAOfinal(NULL),
m_useShadowMapping(false),    m_shaderShadowMapping(NULL), m_smCam(NULL),

m_currentViewMatrix(glm::mat4()), m_currentProjectionMatrix(glm::mat4()),
m_windowWidth(0), m_windowHeight(0)

{
  m_sfq.loadBufferData();
  context.bindContext();
  printInfo();
}
开发者ID:lisawerner,项目名称:GeKo,代码行数:26,代码来源:Renderer.cpp

示例8: _tmain

int _tmain(int argc, _TCHAR* argv[])
{
	int iNum = 0;

	if(argc != 2 && argc !=3)
	{
		printInfo(argc, argv);
		return -1;
	}

	ListInterfaceInfomation();

	//请用户选择一个网卡 
	printf("Enter the interface number (1-%d):",gDevIndex); 
	scanf("%d", &iNum); 
	if(iNum <= 0)
	{
		printf("input error\n");
		return -1;
	}

	ListInterfaceInfomation(GetDev, &iNum);

	ArpSpoof(
		szInterfaceName,
		argv[1],
		argv[2],
		1000 /*ms*/
		);

	return 0;
}
开发者ID:KangLin,项目名称:ArpSpoof,代码行数:32,代码来源:ArpConsole.cpp

示例9: ANativeActivity_onCreate

void ANativeActivity_onCreate(ANativeActivity* activity,
        void* savedState, size_t savedStateSize) {
	printInfo(activity);
	LOGI(2, "-----ANativeActivity_onCreate");
	//the callbacks the Android framework will call into a native application
	//all these callbacks happen on the main thread of the app, so we'll
	//need to make sure the function doesn't block
	activity->callbacks->onStart = onStart;
	activity->callbacks->onResume = onResume;
	activity->callbacks->onSaveInstanceState = onSaveInstanceState;
	activity->callbacks->onPause = onPause;
	activity->callbacks->onStop = onStop;
	activity->callbacks->onDestroy = onDestroy;
	activity->callbacks->onWindowFocusChanged = onWindowFocusChanged;
	activity->callbacks->onNativeWindowCreated = onNativeWindowCreated;
	activity->callbacks->onNativeWindowResized = onNativeWindowResized;
	activity->callbacks->onNativeWindowRedrawNeeded = onNativeWindowRedrawNeeded;
	activity->callbacks->onNativeWindowDestroyed = onNativeWindowDestroyed;
	activity->callbacks->onInputQueueCreated = onInputQueueCreated;
	activity->callbacks->onInputQueueDestroyed = onInputQueueDestroyed;
	activity->callbacks->onContentRectChanged = onContentRectChanged;
	activity->callbacks->onConfigurationChanged = onConfigurationChanged;
	activity->callbacks->onLowMemory = onLowMemory;

	activity->instance = NULL;
}
开发者ID:GitNooby,项目名称:notes,代码行数:26,代码来源:NativeActivityOne.cpp

示例10: aiDeepMove

/**
* Gibt 1 zurueck, wenn ein Zug ausgefuehrt wurde, sonst 0.
*/
char aiDeepMove(struct GameState *gameState) {
	char from 			= 0;
	char to 			= 0;
	char coordFrom[]	= "??";
	char coordTo[]		= "??";
	int eval 			= 0;
	int bestEvalAdding 	= 0;

	if (loadOpeningBookMove(gameState, coordFrom, coordTo)) {
		from = convertCoordToIndex(coordFrom);
		to = convertCoordToIndex(coordTo);
		printf("Eroeffnungsbuch: ");
	} else {
		timeStamp = time(NULL);
		aiDeepSearch(gameState, &from, &to, &eval, &bestEvalAdding, 0);
		if (debugMode) printDev("Calculation time: %i\n", (int) time(NULL) - timeStamp);
	}

	if (from != 0) {
		convertIndexToCoord(from, coordFrom); 
		convertIndexToCoord(to, coordTo);

		if ((*gameState).board[to] == 0) {
			printInfo("KI zieht mit %c von %s nach %s.\n", getPieceSymbolAsChar((*gameState).board[from]), coordFrom, coordTo);	
		} else {
			printInfo("KI zieht mit %c von %s nach %s und schlaegt %c.\n", getPieceSymbolAsChar((*gameState).board[from]), coordFrom, coordTo, getPieceSymbolAsChar((*gameState).board[to]));	
		}
		
		doMovePartial(gameState, from, to);
		doMoveFinal(gameState, from, to);

		return 1;
	} else {
		printf("Blah 3!\n"); exit(1);
		if (eval <= -valueCheckMate) {
			if (isCheck(gameState)) {
				printInfo("KI ist Schachmatt!\n");		
			} else {
				printInfo("KI gibt auf: Schachmatt in wenigen Zuegen!\n");	
			}
		} else {
			printError("Fehler: Keine Zuege gefunden, aber nicht Schachmatt!"); // DEBUG
		}
		
		return 0;
	}
}
开发者ID:chriskonnertz,项目名称:c2-chess,代码行数:50,代码来源:c2.c

示例11: switch

// Called every time there is a window event
void AppWindow::glutKeyboard ( unsigned char key, int x, int y )
 {
   float inc=0.025f;
   switch ( key )
    { case 27 : exit(1); // Esc was pressed
      case 'i' : printInfo(); return;

      case ' ': _viewaxis = !_viewaxis; break;
      //case 'z' : _normals=!_normals; break;
      case 'n' : _flatn=!_flatn;
                 std::cout<<(_flatn?"Flat...\n":"Smooth...\n");
                 _texturedCylinder.flat(_flatn);
                 break;
      case 'p' : _phong=!_phong;
                  std::cout<<"Switching to "<<(_phong?"Phong shader...\n":"Gouraud shader...\n");
                 _texturedCylinder.phong(_phong);
                 break;
      case 'q' :
            numfaces++;
            _texturedCylinder.build(rt, rb, 1.0f, numfaces);
            break;
      case 'a':
            numfaces = (numfaces > 3) ? numfaces - 1 : numfaces;
            _texturedCylinder.build(rt, rb, 1.0f, numfaces);
            break;
      case 'w':
            rt += inc;
            _texturedCylinder.build(rt, rb, 1.0f, numfaces);
            break;
      case 's':
            rt = (rt - inc > 0.05f) ? rt - inc : rt;
            _texturedCylinder.build(rt, rb, 1.0f, numfaces);
            break;
        case 'e':
            rb += inc;
            _texturedCylinder.build(rt, rb, 1.0f, numfaces);
            break;
        case 'd':
            rb = (rb - inc > 0.05f) ? rb - inc : rb;
            _texturedCylinder.build(rt, rb, 1.0f, numfaces);
            break;
        case 'z':
            textureChoice = !textureChoice;
            break;
        case 'x':
            blendFactor = (blendFactor + inc > 1.0f) ? 1.0f : blendFactor + inc;
            break;
        case 'c':
            blendFactor = (blendFactor - inc < 0.0f) ? 0.0f : blendFactor - inc;
            break;
      
            
      default : return;
	}
     
   if ( _normals ) _lines.build ( _texturedCylinder.NL, GsColor::blue );
     
    redraw(); 
 }
开发者ID:Teknoman117,项目名称:cse170projects,代码行数:60,代码来源:app_window.cpp

示例12: printInfo

void
sprite::loadJson(Json::Value json)
{
    qw = json.get("qw", 32).asInt();
    qh = json.get("qh", 32).asInt();

    for (int i = 0 ; !json["box"][i].isNull() ;i++ )
    {
        struct box boxv;

        Json::Value box = json["box"][i];

        boxv.x = box.get("x", 0).asInt();
        boxv.y = box.get("y", 0).asInt();
        boxv.w = box.get("w", 0).asInt();
        boxv.h = box.get("h", 0).asInt();
        boxv.bits = box.get("bits", 0).asInt();

        boxes.push_back(boxv);
    }

    for (int i = 0 ; !json["frames"][i].isNull() ; i++)
    {
        struct frame framev;
        Json::Value frame = json["frames"][i];

        framev.x = frame.get("x", 0.0).asFloat();
        framev.y = frame.get("y", 0.0).asFloat();
        framev.w = frame.get("w", 0.0).asFloat();
        framev.h = frame.get("h", 0.0).asFloat();
        framev.ox = frame.get("ox", 0.0).asFloat();
        framev.oy = frame.get("oy", 0.0).asFloat();

        for (int y = 0 ; frame["box"][y].isInt() ;y++ )
        {
            framev.boxes.push_back(frame["box"][y].asInt());
        }

        frames.push_back(framev);
    }

    for (int i = 0 ; !json["animations"][i].isNull() ; i++)
    {
        struct animation aniv;
        Json::Value animation = json["animations"][i];

        aniv.loop = animation.get("loop", 1).asInt();
        aniv.interval = animation.get("interval", 10).asInt();
        aniv.next = animation.get("next", 0).asInt();

        for (int y = 0 ; animation["frames"][y].isInt() ;y++ )
        {
            aniv.frames.push_back(animation["frames"][y].asInt());
        }
        animations.push_back(aniv);
    }

    printInfo();
}
开发者ID:kvisle,项目名称:nengine,代码行数:59,代码来源:sprite.cpp

示例13: update

void KoilItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event){

    if(isSelected())    brushColor = selectedColor;
    else                brushColor = normalColor;
    update();
    emit printInfo(QString(""));
    QGraphicsItem::hoverLeaveEvent(event);
}
开发者ID:luigialberti,项目名称:dolomites,代码行数:8,代码来源:koilitem.cpp

示例14: smokeScenario

void smokeScenario(int paper, int tobacco, int matches)
{
	initializeSuplies(paper, tobacco, matches);
	printInfo();
	forkSmokers();
	wait();
	printf("AGENT IS DONE!\n-----\n");
}
开发者ID:chas11man,项目名称:eecs338-assignment1,代码行数:8,代码来源:AGENT.c

示例15: main_t4

int main_t4(int argc, char *argv[]){
	pthread_t tid;
	sun_pthread_create(&tid, NULL, thread_func, NULL);
	printInfo("main thread");
	sleep(1);

	exit(0);
}
开发者ID:yamorn,项目名称:linux-network,代码行数:8,代码来源:simple_thread.c


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