本文整理汇总了C++中CTextureReference::GetActualWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ CTextureReference::GetActualWidth方法的具体用法?C++ CTextureReference::GetActualWidth怎么用?C++ CTextureReference::GetActualWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTextureReference
的用法示例。
在下文中一共展示了CTextureReference::GetActualWidth方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PaintEngineWindow
//-----------------------------------------------------------------------------
// Paints the engine window itself
//-----------------------------------------------------------------------------
void CMiniViewportEngineRenderArea::PaintEngineWindow( int x, int y, int w, int h )
{
if ( !enginetools->IsInGame() )
{
surface()->DrawSetColor( Color( 127, 127, 200, 63 ) );
surface()->DrawFilledRect( x, y, x + w, y + h );
}
else
{
CMatRenderContextPtr pRenderContext( g_pMaterialSystem );
g_pMatSystemSurface->DrawSetTextureMaterial( m_nEngineOutputTexture, m_ScreenMaterial );
surface()->DrawSetColor( Color( 0, 0, 0, 255 ) );
int nTexWidth = m_ScreenBuffer->GetActualWidth();
int nTexHeight = m_ScreenBuffer->GetActualHeight();
float flOOWidth = 1.0f / nTexWidth;
float flOOHeight = 1.0f / nTexHeight;
float s0, s1, t0, t1;
s0 = ( 0.5f ) * flOOWidth;
t0 = ( 0.5f ) * flOOHeight;
s1 = ( (float)w - 0.5f ) * flOOWidth;
t1 = ( (float)h - 0.5f ) * flOOHeight;
vgui::surface()->DrawTexturedSubRect( x, y, x+w, y+h, s0, t0, s1, t1 );
PaintOverlayText();
}
}