本文整理汇总了C++中Area::Right方法的典型用法代码示例。如果您正苦于以下问题:C++ Area::Right方法的具体用法?C++ Area::Right怎么用?C++ Area::Right使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Area
的用法示例。
在下文中一共展示了Area::Right方法的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 = 0, xr = 1, yl = 0, yr = 1;
xl = (float)aSource.X / (float)aTexture->GetWidth();
xr = (float)aSource.Right() / (float)aTexture->GetWidth();
yl = (float)aSource.Y / (float)aTexture->GetHeight();
yr = (float)aSource.Bottom() / (float)aTexture->GetHeight();
aTexture->Apply();
OpenGLHelp::SetVertex(&VertexBuffer[0 * VertexSize], Clip.X + aDestination.X, Clip.Y + aDestination.Y, r, g, b, a, xl, yl);
OpenGLHelp::SetVertex(&VertexBuffer[1 * VertexSize], Clip.X + aDestination.Right(), Clip.Y + aDestination.Y, r, g, b, a, xr, yl);
OpenGLHelp::SetVertex(&VertexBuffer[2 * VertexSize], Clip.X + aDestination.Right(), Clip.Y + aDestination.Bottom(), r, g, b, a, xr, yr);
OpenGLHelp::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::AddBelow(BLayoutItem* item, YTab* _bottom, XTab* left,
XTab* right)
{
Area* currentArea = _CurrentArea();
if (!left)
left = currentArea->Left();
if (!right)
right = currentArea->Right();
YTab* top = currentArea->Bottom();
BReference<YTab> bottom = _bottom;
if (_bottom == NULL)
bottom = fLayout->AddYTab();
return Add(item, left, top, right, bottom);
}