本文整理汇总了C++中int2::X方法的典型用法代码示例。如果您正苦于以下问题:C++ int2::X方法的具体用法?C++ int2::X怎么用?C++ int2::X使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类int2
的用法示例。
在下文中一共展示了int2::X方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void IGLUShaderVariable::operator= ( int2 val )
{
// Check for a valid shader index
if ( m_varIdx < 0 ) return;
// Check for type mismatches
if ( m_isAttribute )
{
AssignmentToAttribute( "ivec2" );
return;
}
if ( m_varType != GL_INT_VEC2 && m_varType != GL_UNSIGNED_INT_VEC2 )
TypeMismatch( "ivec2" );
// Ensure this program is currently bound, or setting shader values fails!
m_parent->PushProgram();
// For types of variable that can be assigned from our input value, assign them here
if ( m_varType == GL_INT_VEC2 )
glUniform2iv( m_varIdx, 1, val.GetConstDataPtr() );
if ( m_varType == GL_UNSIGNED_INT_VEC2 )
glUniform2ui( m_varIdx, val.X(), val.Y() );
// We have a short "program stack" so make sure to pop off.
m_parent->PopProgram();
}
示例2: mSize
//---------------------------------------------------------------------------------------------------------
BlockGenerator::BlockGenerator( const int2& size, int blockSize ) : mSize(size), mBockSize(blockSize)
{
mNumBlocks = int2(
(int)std::ceil(size.X() / (float) blockSize),
(int)std::ceil(size.Y() / (float) blockSize));
mBlocksLeft = mNumBlocks.X() * mNumBlocks.Y();
mDirection = Right;
mBlock = mNumBlocks / 2;
mStepsLeft = 1;
mNumSteps = 1;
mStartTime = clock();
}
示例3: OnMouseButtonRelease
bool ListBox::OnMouseButtonRelease( const int2& screenPos, uint32_t button )
{
bool eventConsumed = false;
if (button == MS_LeftButton)
{
if (mPressed)
{
if (mSelectionRegion.Contains((float)screenPos.X(), (float)screenPos.Y()))
{
int32_t selIndex = mVertScrollBar->GetScrollValue() + (int32_t)floorf((screenPos.Y() - mSelectionRegion.Top()) / mTextRowHeight);
SetSelectedIndex(selIndex, true);
}
mPressed = false;
eventConsumed = true;
}
}
return eventConsumed;
}