本文整理汇总了C++中ogre::HardwarePixelBufferSharedPtr::blit方法的典型用法代码示例。如果您正苦于以下问题:C++ HardwarePixelBufferSharedPtr::blit方法的具体用法?C++ HardwarePixelBufferSharedPtr::blit怎么用?C++ HardwarePixelBufferSharedPtr::blit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::HardwarePixelBufferSharedPtr
的用法示例。
在下文中一共展示了HardwarePixelBufferSharedPtr::blit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PaintScrollImage
void HTML::PaintScrollImage(Ogre::HardwarePixelBufferSharedPtr pixelBuffer, const Berkelium::Rect& scrollOrigRect, int scroll_dx, int scroll_dy)
{
Berkelium::Rect scrolledRect = scrollOrigRect.translate(scroll_dx, scroll_dy);
Berkelium::Rect scrolled_shared_rect = scrollOrigRect.intersect(scrolledRect);
// Only do scrolling if they have non-zero intersection
if(scrolled_shared_rect.width() == 0 || scrolled_shared_rect.height() == 0)
return;
Berkelium::Rect shared_rect = scrolled_shared_rect.translate(-scroll_dx, -scroll_dy);
size_t width = shared_rect.width();
size_t height = shared_rect.height();
Ogre::TexturePtr shadow = Ogre::TextureManager::getSingleton().createManual("scrollbuf", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::TEX_TYPE_2D, Ogre::Bitwise::firstPO2From(width), Ogre::Bitwise::firstPO2From(height), 1, 1, Ogre::PF_BYTE_BGRA);
{
Ogre::HardwarePixelBufferSharedPtr shadowBuffer = shadow->getBuffer();
Berkelium::Rect borderedScrollRect = GetBorderedRect(shared_rect);
Berkelium::Rect borderedScrolledRect = GetBorderedRect(scrolled_shared_rect);
shadowBuffer->blit(pixelBuffer, Ogre::Box(borderedScrollRect.left(), borderedScrollRect.top(), borderedScrollRect.right(), borderedScrollRect.bottom()), Ogre::Box(0, 0, width, height));
pixelBuffer->blit(shadowBuffer, Ogre::Box(0, 0, width, height), Ogre::Box(borderedScrolledRect.left(), borderedScrolledRect.top(), borderedScrolledRect.right(), borderedScrolledRect.bottom()));
}
Ogre::ResourcePtr shadowResource(shadow);
Ogre::TextureManager::getSingleton().remove(shadowResource);
}