本文整理汇总了C++中Surface::GetOrCreateTexture方法的典型用法代码示例。如果您正苦于以下问题:C++ Surface::GetOrCreateTexture方法的具体用法?C++ Surface::GetOrCreateTexture怎么用?C++ Surface::GetOrCreateTexture使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Surface
的用法示例。
在下文中一共展示了Surface::GetOrCreateTexture方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: nme_gl_bind_bitmap_data_texture
value nme_gl_bind_bitmap_data_texture(value inBitmapData)
{
Surface *surface;
if (AbstractToObject(inBitmapData,surface) )
{
HardwareContext *ctx = gDirectRenderContext;
if (!ctx)
ctx = nme::HardwareContext::current;
if (ctx)
{
Texture *texture = surface->GetOrCreateTexture(*gDirectRenderContext);
if (texture)
texture->Bind(surface,-1);
}
}
return alloc_null();
}
示例2: HardwareRenderer
HardwareRenderer(const GraphicsJob &inJob, const GraphicsPath &inPath, HardwareContext &inHardware)
{
mJob = &inJob;
mPath = &inPath;
mContext = &inHardware;
DirectFBHardwareContext *context = (DirectFBHardwareContext*)&inHardware;
mPrimarySurface = context->mPrimarySurface;
if (mJob->mFill)
{
GraphicsBitmapFill *bmp = mJob->mFill->AsBitmapFill();
if (bmp)
{
Surface *surface = bmp->bitmapData->IncRef();
mTexture = (DirectFBTexture *)surface->GetOrCreateTexture(inHardware);
}
}
}