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


C++ Area::Bottom方法代码示例

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


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

示例1: Area

void					ESVideo::PresentFrame			(GLuint aID, uint32_t aWidth, uint32_t aHeight, const Area& aViewPort, bool aFlip)
{
	//Enter present state
	EnterPresentState();

	//Calculate output area
	Area presentArea;

	if(NoAspect)
	{
		uint32_t x = PresentArea.X, y = PresentArea.Y, w = PresentArea.Width, h = PresentArea.Height;
		Utility::CenterAndScale(x, y, w, h, aViewPort.Width, aViewPort.Height);

		presentArea = Area(x, y, w, h);
	}
	else
	{
		presentArea = PresentArea;
	}

	//Call kiddie present if possible
	if(SupportsShaders())
	{
		Present(aID, aWidth, aHeight, aViewPort, presentArea, aFlip);

		/* Reset vertex buffer */
		ApplyVertexBuffer(VertexBuffer);
	}
	else
	{
		float xl = (float)aViewPort.X / (float)aWidth;
		float xr = (float)aViewPort.Right() / (float)aWidth;
		float yl = (float)aViewPort.Y / (float)aHeight;
		float yr = (float)aViewPort.Bottom() / (float)aHeight;

		if(aFlip)
		{
			std::swap(yl, yr);
		}

		glBindTexture(GL_TEXTURE_2D, aID); glSplat();

		SetVertex(&VertexBuffer[0 * VertexSize], presentArea.X, 		presentArea.Y, 			1.0f, 1.0f, 1.0f, 1.0f, xl, yl);
		SetVertex(&VertexBuffer[1 * VertexSize], presentArea.Right(), 	presentArea.Y, 			1.0f, 1.0f, 1.0f, 1.0f, xr, yl);
		SetVertex(&VertexBuffer[2 * VertexSize], presentArea.Right(),	presentArea.Bottom(),	1.0f, 1.0f, 1.0f, 1.0f, xr, yr);
		SetVertex(&VertexBuffer[3 * VertexSize], presentArea.X,			presentArea.Bottom(),	1.0f, 1.0f, 1.0f, 1.0f, xl, yr);

		glDrawArrays(GL_QUADS, 0, 4); glSplat();
	}

	//Exit present state
	ExitPresentState();
}
开发者ID:kozarovv,项目名称:mednafen-ps3,代码行数:53,代码来源:ESVideo.cpp

示例2:

void					ESVideo::PlaceTexture			(Texture* aTexture, const Area& aDestination, const Area& aSource, uint32_t aColor)
{
	float r = (float)((aColor >> 24) & 0xFF) / 256.0f;
	float g = (float)((aColor >> 16) & 0xFF) / 256.0f;	
	float b = (float)((aColor >> 8) & 0xFF) / 256.0f;
	float a = (float)((aColor >> 0) & 0xFF) / 256.0f;	

	float xl = ((float)aSource.X + .5f) / (float)aTexture->GetWidth();
	float xr = ((float)aSource.Right() - .5f) / (float)aTexture->GetWidth();
	float yl = ((float)aSource.Y + .5f) / (float)aTexture->GetHeight();
	float yr = ((float)aSource.Bottom() - .5f) / (float)aTexture->GetHeight();

	const Area& Clip = ESVideo::GetClip();
	aTexture->Apply();
	SetVertex(&VertexBuffer[0 * VertexSize], Clip.X + aDestination.X, Clip.Y + aDestination.Y, r, g, b, a, xl, yl);
	SetVertex(&VertexBuffer[1 * VertexSize], Clip.X + aDestination.Right(), Clip.Y + aDestination.Y, r, g, b, a, xr, yl);
	SetVertex(&VertexBuffer[2 * VertexSize], Clip.X + aDestination.Right(), Clip.Y + aDestination.Bottom(), r, g, b, a, xr, yr);
	SetVertex(&VertexBuffer[3 * VertexSize], Clip.X + aDestination.X, Clip.Y + aDestination.Bottom(), r, g, b, a, xl, yr);

	glDrawArrays(GL_QUADS, 0, 4);
}
开发者ID:kozarovv,项目名称:mednafen-ps3,代码行数:21,代码来源:ESVideo.cpp

示例3: DoLayout

/**
 * Perform layout on the area.
 */
void Area::DoLayout()
{
	if (Content() == NULL)
		return; // empty areas need no layout

	// if there is a childArea, then it is the childArea that actually contains the content
	Area* area = (fChildArea != NULL) ? fChildArea : this;

	// set content location and size
	area->Content()->MoveTo(floor(area->Left()->Value() + 0.5),
			floor(area->Top()->Value() + 0.5));
	int32 width = (int32)floor(area->Right()->Value() - area->Left()->Value() + 0.5);
	int32 height = (int32)floor(area->Bottom()->Value() - area->Top()->Value() + 0.5);
	area->Content()->ResizeTo(width, height);
}
开发者ID:mariuz,项目名称:haiku,代码行数:18,代码来源:Area.cpp

示例4: Add

BALMLayoutBuilder&
BALMLayoutBuilder::AddToLeft(BView* view, XTab* _left, YTab* top, YTab* bottom)
{
	Area* currentArea = _CurrentArea();
	BReference<XTab> left = _left;
	if (_left == NULL)
		left = fLayout->AddXTab();
	XTab* right = currentArea->Left();
	if (!top)
		top = currentArea->Top();
	if (!bottom)
		bottom = currentArea->Bottom();

	return Add(view, left, top, right, bottom);
}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:15,代码来源:ALMLayoutBuilder.cpp


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