本文整理汇总了C++中LKSurface::AlphaBlendNotWhite方法的典型用法代码示例。如果您正苦于以下问题:C++ LKSurface::AlphaBlendNotWhite方法的具体用法?C++ LKSurface::AlphaBlendNotWhite怎么用?C++ LKSurface::AlphaBlendNotWhite使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LKSurface
的用法示例。
在下文中一共展示了LKSurface::AlphaBlendNotWhite方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawTerrainAbove
//
// Draw the reachable SHADED terrain glide amoeba
// This is not the outlined perimeter
//
void MapWindow::DrawTerrainAbove(LKSurface& Surface, const RECT& rc) {
// Lets try to make it better understandable with a goto.
// If CAR or GA users dont want amoeba, they should disable it in config.
// Otherwise we should paint it, not hide it automatically!
// Here are the conditions we print this amoeba, otherwise we return;
// First is we are in SIM mode and we changed the altitude;
if (SIMMODE && DerivedDrawInfo.AltitudeAGL>100) goto _doit;
// Second, if we are flying
if (DerivedDrawInfo.Flying) goto _doit;
if (DerivedDrawInfo.GlideFootPrint_valid) goto _doit;
return;
_doit:
#ifndef ENABLE_OPENGL
LKColor whitecolor = LKColor(0xff,0xff,0xff);
LKColor graycolor = LKColor(0xf0,0xf0,0xf0);
LKColor origcolor = TempSurface.SetTextColor(whitecolor);
TempSurface.SetBackgroundTransparent();
TempSurface.SetBkColor(whitecolor);
TempSurface.SelectObject(LK_WHITE_PEN);
TempSurface.SetTextColor(graycolor);
TempSurface.SelectObject(hAboveTerrainBrush);
TempSurface.Rectangle(rc.left,rc.top,rc.right,rc.bottom);
TempSurface.SelectObject(LK_WHITE_PEN);
TempSurface.SelectObject(LKBrush_White);
TempSurface.Polygon(Groundline.data(),Groundline.size());
// need to do this to prevent drawing of colored outline
TempSurface.SelectObject(LK_WHITE_PEN);
#ifdef HAVE_HATCHED_BRUSH
Surface.TransparentCopy(
rc.left,rc.top,
rc.right-rc.left,rc.bottom-rc.top,
TempSurface,
rc.left,rc.top);
#else
Surface.AlphaBlendNotWhite(rc, TempSurface, rc, 255/2);
#endif
// restore original color
TempSurface.SetTextColor(origcolor);
TempSurface.SetBackgroundOpaque();
#else
Canvas& canvas = Surface;
const GLEnable<GL_STENCIL_TEST> stencil;
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
glDepthMask(GL_FALSE);
glStencilFunc(GL_NEVER, 1, 0xFF);
glStencilOp(GL_REPLACE, GL_KEEP, GL_KEEP); // draw 1s on test fail (always)
// draw stencil pattern
glStencilMask(0xFF);
glClear(GL_STENCIL_BUFFER_BIT); // needs mask=0xFF
ScopeVertexPointer vp(Groundline.data());
glDrawArrays(GL_TRIANGLE_FAN, 0, Groundline.size());
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glDepthMask(GL_TRUE);
glStencilMask(0x00);
// draw where stencil's value is 0
glStencilFunc(GL_EQUAL, 0, 0xFF);
canvas.DrawFilledRectangle(rc.left,rc.top,rc.right,rc.bottom, AboveTerrainColor);
#endif
}