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