本文整理汇总了C++中USRect类的典型用法代码示例。如果您正苦于以下问题:C++ USRect类的具体用法?C++ USRect怎么用?C++ USRect使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了USRect类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: UNUSED
//----------------------------------------------------------------//
USRect MOAIDeck::GetBounds ( u32 idx, MOAIDeckRemapper* remapper ) {
UNUSED ( idx );
UNUSED ( remapper );
USRect rect;
rect.Init ( 0.0f, 0.0f, 0.0f, 0.0f );
return rect;
}
开发者ID:mobilehub,项目名称:moai-beta,代码行数:9,代码来源:MOAIDeck.cpp
示例2: GetVtxBounds
//----------------------------------------------------------------//
USRect MOAIQuadBrush::GetVtxBounds () {
USRect rect;
rect.Init ( this->mVtx [ 0 ]);
rect.Grow ( this->mVtx [ 1 ]);
rect.Grow ( this->mVtx [ 2 ]);
rect.Grow ( this->mVtx [ 3 ]);
return rect;
}
开发者ID:Odie,项目名称:moai-beta,代码行数:12,代码来源:MOAIQuadBrush.cpp
示例3: GetVtxBounds
//----------------------------------------------------------------//
USRect USGLQuad::GetVtxBounds () {
USRect rect;
rect.Init ( this->mVtx [ 0 ]);
rect.Grow ( this->mVtx [ 1 ]);
rect.Grow ( this->mVtx [ 2 ]);
rect.Grow ( this->mVtx [ 3 ]);
return rect;
}
开发者ID:,项目名称:,代码行数:12,代码来源:
示例4: GetUVBounds
//----------------------------------------------------------------//
USRect USGLQuad::GetUVBounds () {
USRect rect;
rect.Init ( this->mUV [ 0 ]);
rect.Grow ( this->mUV [ 1 ]);
rect.Grow ( this->mUV [ 2 ]);
rect.Grow ( this->mUV [ 3 ]);
return rect;
}
开发者ID:,项目名称:,代码行数:12,代码来源:
示例5: UNUSED
//----------------------------------------------------------------//
USRect MOAIMesh::GetBounds ( u32 idx, MOAIDeckRemapper* remapper ) {
UNUSED ( idx );
UNUSED ( remapper );
if ( this->mVertexBuffer ) {
return this->mVertexBuffer->GetBounds ();
}
USRect bounds;
bounds.Init ( 0.0f, 0.0f, 0.0f, 0.0f );
return bounds;
}
开发者ID:,项目名称:,代码行数:12,代码来源:
示例6: GetUVBounds
//----------------------------------------------------------------//
USRect MOAIQuadBrush::GetUVBounds () {
USRect rect;
rect.Init ( this->mUV [ 0 ]);
rect.Grow ( this->mUV [ 1 ]);
rect.Grow ( this->mUV [ 2 ]);
rect.Grow ( this->mUV [ 3 ]);
return rect;
}
开发者ID:Odie,项目名称:moai-beta,代码行数:12,代码来源:MOAIQuadBrush.cpp
示例7:
//----------------------------------------------------------------//
void MOAITileDeck2D::DrawPatch ( u32 idx, float xOff, float yOff, float xScale, float yScale ) {
idx = idx - 1;
USCellCoord coord = this->GetCellCoord ( idx );
USRect uvRect = this->GetTileRect ( coord );
uvRect.FlipY ();
USGLQuad quad;
quad.SetVerts ( this->mRect );
quad.SetUVs ( uvRect );
quad.Draw ( xOff, yOff, xScale, yScale );
}
开发者ID:mobilehub,项目名称:moai-beta,代码行数:14,代码来源:MOAITileDeck2D.cpp
示例8:
//----------------------------------------------------------------//
USRect MOAISurfaceDeck2D::GetRect ( u32 idx, MOAIDeckRemapper* remapper ) {
idx = remapper ? remapper->Remap ( idx ) : idx;
idx = idx - 1;
if ( idx < this->mBrushes.Size ()) {
return this->mBrushes [ idx ].mBounds;
}
USRect rect;
rect.Init ( 0.0f, 0.0f, 0.0f, 0.0f );
return rect;
}
开发者ID:,项目名称:,代码行数:14,代码来源:
示例9: SetScissorRect
//----------------------------------------------------------------//
void MOAIGfxDevice::SetScissorRect ( const USRect& rect ) {
USRect& current = this->mScissorRect;
if ( ( current.mXMin != rect.mXMin ) ||
( current.mYMin != rect.mYMin ) ||
( current.mXMax != rect.mXMax ) ||
( current.mYMax != rect.mYMax )) {
this->Flush ();
glScissor (( int )rect.mXMin, ( int )rect.mYMin, ( int )rect.Width (), ( int )rect.Height ());
this->mScissorRect = rect;
}
}
开发者ID:joarb,项目名称:moai-beta,代码行数:15,代码来源:MOAIGfxDevice.cpp
示例10:
USRect MOAIGfxQuadDeck2D::GetRect ( ) {
u32 size = this->mQuads.Size ();
USRect totalRect;
totalRect.Init ( 0.0f, 0.0f, 0.0f, 0.0f );
for ( u32 i = 0; i < size; ++i ) {
MOAIQuadBrush& quad = this->mQuads [ i ];
USRect rect = quad.GetVtxBounds ();
totalRect.Grow ( rect );
}
return totalRect;
}
开发者ID:Odie,项目名称:moai-beta,代码行数:14,代码来源:MOAIGfxQuadDeck2D.cpp
示例11: SetViewport
//----------------------------------------------------------------//
void MOAIGfxDevice::SetViewport ( const USRect& viewport ) {
// set us up the viewport
GLint x = ( GLint )viewport.mXMin;
GLint y = ( GLint )viewport.mYMin;
GLsizei w = ( GLsizei )( viewport.Width () + 0.5f );
GLsizei h = ( GLsizei )( viewport.Height () + 0.5f );
glViewport ( x, y, w, h );
this->mViewRect = viewport;
}
开发者ID:,项目名称:,代码行数:15,代码来源:
示例12: GetXYSectRect
//----------------------------------------------------------------//
bool USFrustum::GetXYSectRect ( const USAffine3D& mtx, USRect& rect ) const {
u32 nHits = 0;
USVec2D hits [ 12 ];
USVec3D nlt = this->mPoints [ NEAR_LT_POINT ];
USVec3D nrt = this->mPoints [ NEAR_RT_POINT ];
USVec3D nrb = this->mPoints [ NEAR_RB_POINT ];
USVec3D nlb = this->mPoints [ NEAR_LB_POINT ];
USVec3D flt = this->mPoints [ FAR_LT_POINT ];
USVec3D frt = this->mPoints [ FAR_RT_POINT ];
USVec3D frb = this->mPoints [ FAR_RB_POINT ];
USVec3D flb = this->mPoints [ FAR_LB_POINT ];
mtx.Transform ( nlt );
mtx.Transform ( nrt );
mtx.Transform ( nrb );
mtx.Transform ( nlb );
mtx.Transform ( flt );
mtx.Transform ( frt );
mtx.Transform ( frb );
mtx.Transform ( flb );
if ( _vecToXYPlane ( nlt, flt, hits [ nHits ])) ++nHits;
if ( _vecToXYPlane ( nrt, frt, hits [ nHits ])) ++nHits;
if ( _vecToXYPlane ( nrb, frb, hits [ nHits ])) ++nHits;
if ( _vecToXYPlane ( nlb, flb, hits [ nHits ])) ++nHits;
if ( _vecToXYPlane ( nlt, nrt, hits [ nHits ])) ++nHits;
if ( _vecToXYPlane ( nrt, nrb, hits [ nHits ])) ++nHits;
if ( _vecToXYPlane ( nrb, nlb, hits [ nHits ])) ++nHits;
if ( _vecToXYPlane ( nlb, nlt, hits [ nHits ])) ++nHits;
if ( _vecToXYPlane ( flt, frt, hits [ nHits ])) ++nHits;
if ( _vecToXYPlane ( frt, frb, hits [ nHits ])) ++nHits;
if ( _vecToXYPlane ( frb, flb, hits [ nHits ])) ++nHits;
if ( _vecToXYPlane ( flb, flt, hits [ nHits ])) ++nHits;
if ( nHits ) {
rect.Init ( hits [ 0 ]);
for ( u32 i = 1; i < nHits; ++i ) {
rect.Grow ( hits [ i ]);
}
return true;
}
return false;
}
开发者ID:Inzaghi2012,项目名称:moai-dev,代码行数:50,代码来源:USFrustum.cpp
示例13: SetViewRect
//----------------------------------------------------------------//
void MOAIGfxDevice::SetViewRect ( USRect rect ) {
USRect deviceRect = rect;
deviceRect = this->mFrameBuffer->WndRectToDevice ( rect );
GLint x = ( GLint )deviceRect.mXMin;
GLint y = ( GLint )deviceRect.mYMin;
GLsizei w = ( GLsizei )( deviceRect.Width () + 0.5f );
GLsizei h = ( GLsizei )( deviceRect.Height () + 0.5f );
glViewport ( x, y, w, h );
this->mViewRect = rect;
}
开发者ID:LOFI,项目名称:moai-dev,代码行数:16,代码来源:MOAIGfxDevice.cpp
示例14:
//----------------------------------------------------------------//
USRect MOAIGfxQuadDeck2D::GetBounds ( u32 idx, MOAIDeckRemapper* remapper ) {
u32 size = this->mQuads.Size ();
if ( size ) {
idx = remapper ? remapper->Remap ( idx ) : idx;
idx = ( idx - 1 ) % size;
MOAIQuadBrush& quad = this->mQuads [ idx ];
return quad.GetVtxBounds ();
}
USRect rect;
rect.Init ( 0.0f, 0.0f, 0.0f, 0.0f );
return rect;
}
开发者ID:SimonRen,项目名称:moai-beta,代码行数:16,代码来源:MOAIGfxQuadDeck2D.cpp
示例15:
//----------------------------------------------------------------//
USBox MOAISurfaceDeck2D::ComputeMaxBounds () {
u32 size = this->mBrushes.Size ();
USRect rect;
rect.Init ( 0.0f, 0.0f, 0.0f, 0.0f );
for ( u32 i = 0; i < size; ++i ) {
rect.Grow ( this->mBrushes [ i ].mBounds );
}
USBox bounds;
bounds.Init ( rect.mXMin, rect.mYMax, rect.mXMax, rect.mYMin, 0.0f, 0.0f );
return bounds;
}
开发者ID:Inzaghi2012,项目名称:moai-dev,代码行数:16,代码来源:MOAISurfaceDeck2D.cpp
示例16: GetRect
//----------------------------------------------------------------//
USRect MOAIGlyph::GetRect ( float x, float y ) const {
USRect rect;
x += ( this->mBearingX );
y -= ( this->mBearingY );
rect.Init (
x,
y,
x + this->mWidth,
y + this->mHeight
);
return rect;
}
开发者ID:,项目名称:,代码行数:17,代码来源:
示例17: DrawRectEdges
//----------------------------------------------------------------//
void MOAIDraw::DrawRectEdges ( USRect rect, u32 edges ) {
rect.Bless ();
MOAILineBrush glLine;
// right
if ( edges & USRect::kRight ) {
glLine.SetVerts ( rect.mXMax, rect.mYMin, rect.mXMax, rect.mYMax );
glLine.Draw ();
}
// top
if ( edges & USRect::kTop ) {
glLine.SetVerts ( rect.mXMin, rect.mYMin, rect.mXMax, rect.mYMin );
glLine.Draw ();
}
// left
if ( edges & USRect::kLeft ) {
glLine.SetVerts ( rect.mXMin, rect.mYMin, rect.mXMin, rect.mYMax );
glLine.Draw ();
}
// bottom
if ( edges & USRect::kBottom ) {
glLine.SetVerts ( rect.mXMin, rect.mYMax, rect.mXMax, rect.mYMax );
glLine.Draw ();
}
}
开发者ID:,项目名称:,代码行数:31,代码来源:
示例18: GetWndToNormMtx
//----------------------------------------------------------------//
USMatrix4x4 MOAIGfxDevice::GetWndToNormMtx () const {
USRect rect = this->mViewRect;
float hWidth = rect.Width () * 0.5f;
float hHeight = rect.Height () * 0.5f;
// Inv Wnd
USMatrix4x4 wndToNorm;
wndToNorm.Translate ( -hWidth - rect.mXMin, -hHeight - rect.mYMin, 0.0f );
USMatrix4x4 mtx;
mtx.Scale (( 1.0f / hWidth ), -( 1.0f / hHeight ), 1.0f );
wndToNorm.Append ( mtx );
return wndToNorm;
}
开发者ID:LOFI,项目名称:moai-dev,代码行数:18,代码来源:MOAIGfxDevice.cpp
示例19: GetNormToWndMtx
//----------------------------------------------------------------//
USMatrix4x4 MOAIGfxDevice::GetNormToWndMtx () const {
USRect rect = this->mViewRect;
float hWidth = rect.Width () * 0.5f;
float hHeight = rect.Height () * 0.5f;
// Wnd
USMatrix4x4 normToWnd;
normToWnd.Scale ( hWidth, -hHeight, 1.0f );
USMatrix4x4 mtx;
mtx.Translate ( hWidth + rect.mXMin, hHeight + rect.mYMin, 0.0f );
normToWnd.Append ( mtx );
return normToWnd;
}
开发者ID:LOFI,项目名称:moai-dev,代码行数:18,代码来源:MOAIGfxDevice.cpp
示例20: glDisable
//----------------------------------------------------------------//
void MOAIGfxDevice::ResetState () {
this->mTop = 0;
this->mPrimCount = 0;
// turn off texture
glDisable ( GL_TEXTURE_2D );
this->mTexture = 0;
// turn off blending
glDisable ( GL_BLEND );
this->mBlendEnabled = false;
// clear the vertex format
this->SetVertexFormat ();
// clear the shader
this->mShader = 0;
// disable backface culling
glDisable ( GL_CULL_FACE );
// reset the pen width
this->mPenWidth = 1.0f;
glLineWidth (( GLfloat )this->mPenWidth );
// reset the point size
this->mPointSize = 1.0f;
// reset the scissor rect
MOAIGfxDevice& device = MOAIGfxDevice::Get ();
USRect scissorRect = device.GetRect ();
glScissor (( int )scissorRect.mXMin, ( int )scissorRect.mYMin, ( int )scissorRect.Width (), ( int )scissorRect.Height ());
this->mScissorRect = scissorRect;
// fixed function reset
if ( !this->IsProgrammable ()) {
// reset the current vertex color
glColor4f ( 1.0f, 1.0f, 1.0f, 1.0f );
// reset the point size
glPointSize (( GLfloat )this->mPointSize );
}
}
开发者ID:,项目名称:,代码行数:46,代码来源:
注:本文中的USRect类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论