예제 #1
0
OOBase::SharedPtr<Indigo::Render::Layer> Indigo::UILayer::create_render_layer(Indigo::Render::Window* window)
{
	glm::uvec2 sz(window->window()->size());
	if (sz != size())
		Indigo::logic_pipe()->call(OOBase::make_delegate<OOBase::ThreadLocalAllocator>(this,&Indigo::UILayer::on_layout),sz);

	OOBase::SharedPtr<Indigo::Render::UILayer> group = OOBase::allocate_shared<Indigo::Render::UILayer,OOBase::ThreadLocalAllocator>(window,this,visible(),position(),size());
	if (!group)
		LOG_ERROR(("Failed to allocate group: %s",OOBase::system_error_text()));
	else if (!on_render_create(group.get()))
		group.reset();

	m_render_parent = group.get();

	return OOBase::static_pointer_cast<Indigo::Render::Layer>(group);
}
예제 #2
0
파일: Pipe.cpp 프로젝트: ricktaylor/indigo
static OOBase::SharedPtr<Indigo::detail::IPC::Queue> register_queue(const char* name)
{
	OOBase::SharedPtr<Indigo::detail::IPC::Queue> queue;

	PipeTable::table_t::iterator i = PIPE_TABLE::instance().m_queues.find(name);
	if (i == PIPE_TABLE::instance().m_queues.end())
	{
		OOBase::String str;
		if (!str.assign(name))
			LOG_ERROR_RETURN(("Failed to assign string: %s",OOBase::system_error_text()),queue);

		queue = OOBase::allocate_shared<Indigo::detail::IPC::Queue>();
		if (!queue)
			LOG_ERROR_RETURN(("Failed to allocate queue: %s",OOBase::system_error_text()),queue);

		i = PIPE_TABLE::instance().m_queues.insert(str,queue);
		if (i == PIPE_TABLE::instance().m_queues.end())
		{
			LOG_ERROR(("Failed to insert queue: %s",OOBase::system_error_text()));
			queue.reset();
		}
	}
	return i->second;
}