本文整理汇总了C++中Control::IsOpaque方法的典型用法代码示例。如果您正苦于以下问题:C++ Control::IsOpaque方法的具体用法?C++ Control::IsOpaque怎么用?C++ Control::IsOpaque使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Control
的用法示例。
在下文中一共展示了Control::IsOpaque方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawWindow
/** This function Draws the Window on the Output Screen */
void Window::DrawWindow()
{
if (!Visible) return; // no point in drawing invisible windows
Video* video = core->GetVideoDriver();
Region clip( XPos, YPos, Width, Height );
//Frame && Changed
if ( (Flags & (WF_FRAME|WF_CHANGED) ) == (WF_FRAME|WF_CHANGED) ) {
Region screen( 0, 0, core->Width, core->Height );
video->SetScreenClip( NULL );
//removed this?
video->DrawRect( screen, ColorBlack );
if (core->WindowFrames[0])
video->BlitSprite( core->WindowFrames[0], 0, 0, true );
if (core->WindowFrames[1])
video->BlitSprite( core->WindowFrames[1], core->Width - core->WindowFrames[1]->Width, 0, true );
if (core->WindowFrames[2])
video->BlitSprite( core->WindowFrames[2], (core->Width - core->WindowFrames[2]->Width) / 2, 0, true );
if (core->WindowFrames[3])
video->BlitSprite( core->WindowFrames[3], (core->Width - core->WindowFrames[3]->Width) / 2, core->Height - core->WindowFrames[3]->Height, true );
}
video->SetScreenClip( &clip );
//Float || Changed
bool bgRefreshed = false;
if (BackGround && (Flags & (WF_FLOAT|WF_CHANGED) ) ) {
DrawBackground(NULL);
bgRefreshed = true;
}
std::vector< Control*>::iterator m;
for (m = Controls.begin(); m != Controls.end(); ++m) {
Control* c = *m;
// FIXME: drawing BG in the same loop as controls can produce incorrect results with overlapping controls. the only case I know of this occuring it is ok due to no BG drawing
// furthermore, overlapping controls are still a problem when NeedsDraw() returns false for the top control, but true for the bottom (see the level up icon on char portraits)
// we will fix both issues later by refactoring with the concept of views and subviews
if (BackGround && !bgRefreshed && !c->IsOpaque() && c->NeedsDraw()) {
const Region& fromClip = c->ControlFrame();
DrawBackground(&fromClip);
}
if (Flags & (WF_FLOAT)) {
// FIXME: this is a total hack. Required for anything drawing over GameControl (nothing really at all to do with floating)
c->MarkDirty();
}
c->Draw( XPos, YPos );
}
if ( (Flags&WF_CHANGED) && (Visible == WINDOW_GRAYED) ) {
Color black = { 0, 0, 0, 128 };
video->DrawRect(clip, black);
}
video->SetScreenClip( NULL );
Flags &= ~WF_CHANGED;
}