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


C++ VisualGraphics::getMaxRightCoordOfCanvas方法代码示例

本文整理汇总了C++中VisualGraphics::getMaxRightCoordOfCanvas方法的典型用法代码示例。如果您正苦于以下问题:C++ VisualGraphics::getMaxRightCoordOfCanvas方法的具体用法?C++ VisualGraphics::getMaxRightCoordOfCanvas怎么用?C++ VisualGraphics::getMaxRightCoordOfCanvas使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在VisualGraphics的用法示例。


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

示例1: monitorRenderMessageProcess

void monitorRenderMessageProcess() {

	static float framesPerSecond = 0.0f;
	static UInt16 frameCount = 0;
	::Rect viewportRect;
	UInt32 elapsedMilliseconds, remainingMilliseconds, totalMilliseconds = 0;
	VisualAudioLab* theVisualAudioLab = NULL;
	VisualPlayerState* theVisualPlayerState = NULL;
	VisualGraphics* theVisualGraphics = NULL;
	UInt8 playState;
	char cStr64[64];
	
	theVisualPlayerState = VisualPlayerState::getInstance();
	
    elapsedMilliseconds = VisualTiming::getElapsedMilliSecsSinceReset("fps");
    
    if (elapsedMilliseconds > 1000) {
        framesPerSecond = (float)frameCount / (float)elapsedMilliseconds * 1000.0f;
        frameCount = 0;
        VisualTiming::resetTimestamp("fps");
    }
	frameCount++;
    
    sprintf(cStr64, "%.2f",  framesPerSecond);
    setProcessInfo("FramesPerSecond", cStr64);
	
	theVisualGraphics = VisualGraphics::getInstance();

	setProcessInfo("RendererName",theVisualGraphics->getRendererName());

	setProcessInfo("RendererVendor",theVisualGraphics->getRendererVendor());

	setProcessInfo("RendererVersion",theVisualGraphics->getRendererVersion());

	sprintf(cStr64, "%#x", theVisualGraphics->getGLVersion());
	setProcessInfo("GLVersion", cStr64);
	
	sprintf(cStr64, "%ld", theVisualGraphics->getMaxTextureSize());
	setProcessInfo("Maximum Texture Size", cStr64);
	
	// screen measurements
	sprintf(cStr64, "width: %d, height: %d, refreshRate: %d", theVisualGraphics->getScreenWidth(), theVisualGraphics->getScreenHeight(), theVisualGraphics->getRefreshRateOfScreen());
	setProcessInfo("Screen", cStr64);
	
	sprintf(cStr64, "%d", theVisualGraphics->getBitsPerPixelOfScreen());
	setProcessInfo("BitsPerPixel", cStr64);
	
	sprintf(cStr64, "%d", theVisualGraphics->getCanvasPixelHeight());
	setProcessInfo("CanvasPixelHeight", cStr64);
	
	sprintf(cStr64, "%d", theVisualGraphics->getCanvasPixelWidth());
	setProcessInfo("CanvasPixelWidth", cStr64);

	::Rect theCanvasRect;
	theVisualGraphics->getCanvasRect(&theCanvasRect);
	sprintf(cStr64, "top: %d, left: %d", theCanvasRect.top, theCanvasRect.left);
	setProcessInfo("CanvasRectTopLeft", cStr64);
	sprintf(cStr64, "bottom: %d, right: %d", theCanvasRect.bottom, theCanvasRect.right);
	setProcessInfo("CanvasRectBottomRight", cStr64);

	::Rect theCanvasSurroundingRect;
	theVisualGraphics->getCanvasSurroundingRect(&theCanvasSurroundingRect);
	sprintf(cStr64, "top: %d, left: %d", theCanvasSurroundingRect.top, theCanvasSurroundingRect.left);
	setProcessInfo("CanvasSurroundRectTopLeft", cStr64);
	sprintf(cStr64, "bottom: %d, right: %d", theCanvasSurroundingRect.bottom, theCanvasSurroundingRect.right);
	setProcessInfo("CanvasSurroundRectBottomRight", cStr64);
	
	sprintf(cStr64, "top: %.2f, left: %.2f", theVisualGraphics->getMaxTopCoordOfCanvas(), theVisualGraphics->getMaxLeftCoordOfCanvas());
	setProcessInfo("CoordMaxTopLeft", cStr64);
	sprintf(cStr64, "bottom: %.2f, right: %.2f", theVisualGraphics->getMaxBottomCoordOfCanvas(), theVisualGraphics->getMaxRightCoordOfCanvas());
	setProcessInfo("CoordMaxBottomRight", cStr64);
	sprintf(cStr64, "near: %.2f, far: %.2f", theVisualGraphics->getMaxNearCoordOfCanvas(), theVisualGraphics->getMaxFarCoordOfCanvas());
	setProcessInfo("CoordMaxNearFar", cStr64);

	theVisualGraphics->getViewportRect(&viewportRect);
	sprintf(cStr64, "top: %d, left: %d, bottom: %d, right: %d",  viewportRect.top, viewportRect.left, viewportRect.bottom, viewportRect.right);
	setProcessInfo("ViewportRect", cStr64);

	playState = theVisualPlayerState->getAudioPlayState();
	switch (playState) {
		case kAudioIsPlaying:
			sprintf(cStr64, "kAudioIsPlaying");
			break;
		case kAudioPlayStarted:
			sprintf(cStr64, "kAudioPlayStarted");
			break;		
		case kAudioPlayResumed:
			sprintf(cStr64, "kAudioPlayResumed");
			break;
		case kAudioPlayPaused:
			sprintf(cStr64, "kAudioPlayPaused");
			break;
		case kAudioIsNotPlaying:
			sprintf(cStr64, "kAudioIsNotPlaying");
			break;
		default:
			sprintf(cStr64, "unknown");
	}
	setProcessInfo("AudioPlayState", cStr64);
	
//.........这里部分代码省略.........
开发者ID:alexpaulzor,项目名称:projectm,代码行数:101,代码来源:VisualDispatch.cpp


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