本文整理汇总了C++中oobase::SharedPtr::parameter方法的典型用法代码示例。如果您正苦于以下问题:C++ SharedPtr::parameter方法的具体用法?C++ SharedPtr::parameter怎么用?C++ SharedPtr::parameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oobase::SharedPtr
的用法示例。
在下文中一共展示了SharedPtr::parameter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
OOBase::SharedPtr<Indigo::Render::SGNode> Indigo::SGQuad::on_render_create(Render::SGGroup* parent)
{
OOBase::SharedPtr<Render::SGNode> node;
bool cached = true;
OOBase::SharedPtr<OOGL::Texture> texture = m_image->make_texture(GL_RGBA8,cached);
if (!texture)
return node;
if (!cached)
{
texture->parameter(GL_TEXTURE_MAG_FILTER,GL_LINEAR);
texture->parameter(GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR);
texture->parameter(GL_TEXTURE_WRAP_S,GL_CLAMP_TO_EDGE);
texture->parameter(GL_TEXTURE_WRAP_T,GL_CLAMP_TO_EDGE);
}
OOBase::SharedPtr< ::SGQuad> quad = OOBase::allocate_shared< ::SGQuad>(AABB(glm::vec3(0.5f,0.5f,0),glm::vec3(0.5f,0.5f,0)),texture,m_transparent,m_colour);
if (!quad)
LOG_ERROR_RETURN(("Failed to allocate: %s\n",OOBase::system_error_text()),node);
node = OOBase::allocate_shared<Render::SGNode>(parent,OOBase::static_pointer_cast<Render::SGDrawable>(quad),visible(),transform());
if (!node)
LOG_ERROR_RETURN(("Failed to allocate: %s\n",OOBase::system_error_text()),node);
return node;
}
示例2:
OOBase::SharedPtr<Indigo::Render::UIDrawable> Indigo::NinePatch::make_drawable(const glm::vec4& colour, bool visible, const glm::ivec2& position, const glm::uvec2& size) const
{
ASSERT_RENDER_THREAD();
if (!valid())
LOG_ERROR_RETURN(("NinePatch::make_drawable called when invalid!"),OOBase::SharedPtr<Indigo::Render::UIDrawable>());
bool is_9 = (m_info->m_borders != glm::uvec4(0));
bool cached = true;
OOBase::SharedPtr<OOGL::Texture> texture = make_texture(GL_RGBA8,cached,is_9 ? 1 : 0);
if (!texture)
return OOBase::SharedPtr<Indigo::Render::UIDrawable>();
if (cached)
{
texture->parameter(GL_TEXTURE_MAG_FILTER,GL_LINEAR);
texture->parameter(GL_TEXTURE_MIN_FILTER,is_9 ? GL_LINEAR : GL_LINEAR_MIPMAP_LINEAR);
texture->parameter(GL_TEXTURE_WRAP_S,GL_CLAMP_TO_EDGE);
texture->parameter(GL_TEXTURE_WRAP_T,GL_CLAMP_TO_EDGE);
}
if (is_9)
return OOBase::allocate_shared<Render::UINinePatch,OOBase::ThreadLocalAllocator>(texture,colour,m_info,visible,position,size);
else
return OOBase::allocate_shared<Render::UIImage,OOBase::ThreadLocalAllocator>(texture,colour,visible,position,size);
}
示例3:
OOBase::SharedPtr<Indigo::Render::Layer> Indigo::ImageLayer::create_render_layer(Render::Window* window)
{
OOBase::SharedPtr< ::ImageLayer> layer;
bool cached = true;
OOBase::SharedPtr<OOGL::Texture> texture = m_image->make_texture(GL_RGBA8,cached,1);
if (!texture)
return layer;
if (!cached)
{
texture->parameter(GL_TEXTURE_MAG_FILTER,GL_LINEAR);
texture->parameter(GL_TEXTURE_MIN_FILTER,GL_LINEAR);
texture->parameter(GL_TEXTURE_WRAP_S,GL_CLAMP_TO_EDGE);
texture->parameter(GL_TEXTURE_WRAP_T,GL_CLAMP_TO_EDGE);
}
layer = OOBase::allocate_shared< ::ImageLayer,OOBase::ThreadLocalAllocator>(texture,window,m_colour);
if (!layer)
LOG_ERROR(("Failed to allocate layer: %s",OOBase::system_error_text()));
return layer;
}